{% extends "1-col-sidebar.html.twig" %}
{# single post #}
{% block column %}
<!-- here down to -->
{% if site_code == constant("App\\Entity\\Content::SITE_RCS") %}
{% include "includes/curtain-ads/classified.html.twig" %}
{% elseif site_code == constant("App\\Entity\\Content::SITE_MCS") %}
{% include "includes/curtain-ads/classified-mcs.html.twig" %}
{% endif %}
<!-- here -->
<h1 class="post-title" style="margin-bottom: 0">{{ content.title }}</h1>
<div style="margin: 15px 0px 15px;">
<span class="job-type" style="margin-right: 25px;">{{ region }}</span>
{% if content_meta._job_location is defined and content_meta._job_location is not empty %}
<span class="location" style="margin-right: 25px;">
<i class="fa fa-map-marker"></i>
<a href="https://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=
{{ content_meta._job_location|replace({' ': '+'}) }} "
title="Click to view a Google Map" target="_blank">
{{ content_meta._job_location }}
</a>
</span>
{% endif %}
<span class="date-posted" style="margin-right: 25px;"><i class="fa fa-calendar"></i> Posted {{ post_age_format(date(content.publishedat|date).diff( date("now"))) }}</span>
</div>
<div class="row" style="margin: 20px 0 20px;">
{% if content.hasVideoMedia() %}
<div class="col-4">
{{ content.getVideoMediaTag("","", autoplay)|raw }}
</div>
<div class="col-8">
{% elseif content.getFeaturedImageTag() is not empty %}
<div class="col-4">
{{ content.getFeaturedImageTag("","")|raw }}
</div>
<div class="col-8">
{% else %}
<div class="col-12">
{% endif %}
<strong style="font-size: 1.2em;">{{ content_meta._company_name }}</strong>
<span style="float: right;">
{% if content_meta._company_phone is defined and content_meta._company_phone is not empty %}
<a href="tel:{{ content_meta._company_phone }}" class="phone"><i class="fa fa-phone"></i> {{ content_meta._company_phone }}</a>
{% endif %}
{% if content_meta._company_website is defined and content_meta._company_website is not empty %}
<a href="{{ content_meta._company_website|external_link }}" class="website"><i class="fa fa-link"> </i>Website</a>
{% endif %}
</span>
<div>{{ content.contentfull|wordpress|raw }}</div>
{% set listing_file = content.getMediaGroupContainers() %}
{% if listing_file is defined and listing_file | length %}
{# simply grab the first file for now - in the future we may add more files... #}
{% set listing_file = listing_file[0].getMediaGroup() %}
{% set listing_file = listing_file.getMediaGroupItems() %}
{% set listing_file = listing_file[0].getMedia() %}
{% else %}
{% set listing_file = false %}
{% endif %}
{% set listing_file_title = content.getContentMetaValueByKey("_file_title") %}
{% if listing_file %}
<div class="row my-3">
<div class="col-md-12">
<a class="btn btn-secondary float-right" href="{{ listing_file.getURL() }}" >Download {{ listing_file_title ? listing_file_title : "File" }}</a>
</div>
</div>
{% endif %}
<br>
<div>
To reply to this listing, contact {{ content_meta._company_contact }} by clicking "Request More Information" and filling out the form below.
</div>
</div>
</div>
{#social share buttons#}
{% include "includes/social-share.html.twig" %}
<div style="margin-bottom: 20px;margin-top: 20px">
<button class="button" href="" id="infoButton" style="padding: 15px;">Request More Information</button>
</div>
<div id="infoForm" style="display: none;">
<form method="post" action="{{ path('classified_request_info',
{ 'contact_email' : content_meta._application, 'contact_name' : content_meta._company_contact, 'listing_title' : content.title }) }}" enctype="multipart/form-data">
<div class="row form-row">
<div class="col-sm-6">
<label class="form-label" for="fname">First Name</label>
<input type="text" class="form-control" id="fname" name="fname" placeholder="First Name" required>
</div>
<div class="col-sm-6">
<label class="form-label" for="lname">Last Name</label>
<input type="text" class="form-control" id="lname" name="lname" placeholder="Last Name" required>
</div>
</div>
<div class="row form-row">
<div class="col-sm-6">
<label class="form-label" for="email">Email</label>
<input type="text" class="form-control" id="email" name="email" placeholder="Email Address" required>
</div>
</div>
<div class="row form-row">
<div class="col-sm-6">
<label class="form-label" for="resume">Upload your Resumé</label>
<input type="file" class="form-control-file" id="resume" name="resume">
</div>
</div>
<div class="row form-row">
<div class="col-12">
<label class="form-label" for="message">Your Message</label>
<textarea class="form-control" id="message" name="message" placeholder="Your Message" required></textarea>
</div>
</div>
<div class="form-row g-recaptcha" data-sitekey="6LeEIlMUAAAAAGhdmJJLdJHPxaWx2GqBjber5n6B"></div>
<button type="submit" class="button">Submit</button>
</form>
</div>
<br>
<script>
$( "#infoButton" ).click(function() {
$( "#infoForm" ).toggle();
});
</script>
{% endblock %}