{% extends "base.html.twig" %}
{# empty elements #}
{% block header %}{% endblock %}
{% block toolbar %}{% endblock %}
{% block footer %}{% endblock %}
{% block bottom %}{% endblock %}
{% block body %}
<script>
{# Quick fix to double scrollbar issue #}
document.documentElement.setAttribute("style", "overflow: visible;");
</script>
{# Render the appropriate template file. #}
{# adjusting so all landing pages are 1 template type ... 1 column full #}
{% if true or page.template == 1 %}
{# <div class="container-fluid"> #}
{% set background = page.getContentMetaValueByKey("rcs_body_background_color") %}
{% if background %}
<style>
.top-wrap {
display: table;
}
</style>
<div class="lp-wrapper" style="background: {{ background }}; padding-top: 15px; padding-bottom: 15px; min-height: 100vh; display: block;">
{% endif %}
<div class="container" style="background: #fff; max-width: 800px;">
<style>
{# hack ... can't think of a better way right now... #}
.top-wrap:after {
height: 0;
}
</style>
{% if message is defined %}
<div class="row mt-3">
<div class="col-sm-12">
<div class="alert alert-{{ message.type }}">
{{ message.text }}
</div>
</div>
</div>
{% endif %}
<div class="row">
<div class="col-sm-12">
{#
{% if page.hasContent() %}
{{ page.getContentFull() | raw }}
#}
{# Only do this if landing page uses the new admin interface #}
{% if page.isNewLandingPage() %}
{# display the landing page #}
<div class="row">
<div class="col-sm-12">
{# Header #}
<div class="row" style="min-height: 10px;">
<div class="col-sm-12" style="background: {{page.getLPHeaderColor()}};">
{% set hide_alert_block = true %}
{% include "includes/messages.html.twig" %}
{{ page.getLPHeader()|raw }}
</div>
</div>
{# Body #}
<div class="row">
{# Left Column #}
<div class="col-md-6 p-3" style="background: {{page.getLPLeftColor()}};">
{{ page.getLPLeft()|raw }}
{# Form #}
{% set buttonColor = (page.getContentMetaValueByKey("btn_color") ? page.getContentMetaValueByKey("btn_color") : "#A41822") %}
{% set buttonText = (page.getContentMetaValueByKey("btn_text") ? page.getContentMetaValueByKey("btn_text") : "Submit") %}
{# Use the form object if it's set #}
{% set form = page.getForm() %}
{% if form %}
<form method="post" class="py-4" enctype="multipart/form-data">
{% for field in form.getFormFields() %}
<label class="btn-block custom-frm-label">
{% if field.getDescription() %}
<span class="rtooltip">{{field.getTitle()}} <i class="fa fa-question-circle"></i>:
<div class="rtooltiptext" style="">
{{field.getDescription()}}
{#RoofersCoffeeShop offers users the ability to post messages, submit information, and upload images to be used on this site. This information is shared with advertisers and partners associated with RoofersCoffeeShop.
<br><br>
You acknowledge that you have permission related to Content, Information, and Images submitted and that they do not violate any copyright laws or privacy.
<br><br>
RoofersCoffeeShop is not responsible for the content or accuracy of any information posted and shall not be responsible for any decisions made based on such information.
<br><br>
NOTE: Only PNG, JPG, GIF, PDF file types are supported.#}
</div>
</span>
{% else %}
<span>{{field.getTitle()}}:</span>
{% endif %}
</label>
{% if field.getType() == constant("App\\Entity\\FormField::TEXT_FIELD") %}
<input
type="text"
class="form-control"
{#placeholder="Your First Name"#}
name="lead_custom[{{field.getTitle()}}]"
{% if field.getRequired() %} required {% endif %}
/>
{% elseif field.getType == constant("App\\Entity\\FormField::TEXT_AREA") %}
<textarea
class="form-control"
{#placeholder="Your First Name"#}
name="lead_custom[{{field.getTitle()}}]"
{% if field.getRequired() %} required {% endif %}
></textarea>
{% elseif field.getType == constant("App\\Entity\\FormField::DROP_DOWN") %}
<select class="form-control" name="lead_custom[{{field.getTitle()}}]" {% if field.getRequired() %} required {% endif %}>
{% for option in field.getFormFieldOptions() %}
<option value="{{ option.getValue() }}">{{ option.getValue() }}</option>
{% endfor %}
</select>
{% elseif field.getType == constant("App\\Entity\\FormField::RADIO_BUTTONS") %}
{% for option in field.getFormFieldOptions() %}
<div class="form-check">
<label class="form-check-label">
<input class="form-check-input" type="radio" name="lead_custom[{{ field.getTitle() }}]" value="{{ option.getValue() }}" {% if field.getRequired() %} required {% endif %}>
{{ option.getValue() }}
</label>
</div>
{% endfor %}
{% elseif field.getType == constant("App\\Entity\\FormField::CHECK_BOXES") %}
{% for option in field.getFormFieldOptions() %}
<div class="form-check">
<label class="form-check-label">
<input class="form-check-input" type="checkbox" name="lead_custom[{{ field.getTitle() }}][]" value="{{ option.getValue() }}">
{{ option.getValue() }}
</label>
</div>
{% endfor %}
{% elseif field.getType == constant("App\\Entity\\FormField::IMAGE") %}
<input type="hidden" name="lead_custom_img[{{field.getTitle()|replace({' ': ''})}}]" value="{{field.getTitle()}}" />
<input
type="file"
name="img_{{field.getTitle()|replace({' ': ''})}}"
class="form-control"
{% if field.getRequired() %} required {% endif %}
accept="image/png,image/gif,image/jpeg,image/jpeg,application/pdf"
/>
{% elseif field.getType == constant("App\\Entity\\FormField::FILE") %}
<input type="hidden" name="lead_custom_file[{{field.getTitle()|replace({' ': ''})}}]" value="{{field.getTitle()}}" />
<input
type="file"
name="file_{{field.getTitle()|replace({' ': ''})}}"
class="form-control"
{% if field.getRequired() %} required {% endif %}
{#accept="image/png,image/gif,image/jpeg,image/jpeg,application/pdf"#}
/>
{% endif %}
{% endfor %}
<div class="form-row g-recaptcha" data-sitekey="6LeEIlMUAAAAAGhdmJJLdJHPxaWx2GqBjber5n6B" required></div>
{% if page.getLPOptIn() %}
<label class="btn-block pt-4">
<input
type="checkbox"
name="lead[optin]"
value="yes"
required
/>
<span>{{page.getLPOptIn()}}</span>
</label>
{% endif %}
<div style="text-align: center;">
<button
class="btn mt-3"
type="submit"
style="color: #fff; background: {{buttonColor}};"
>{{buttonText}}</button>
</div>
</form>
{# Else use a shortcode for the form if one is set #}
{% elseif page.getLPFormCode() %}
{{ page.getLPFormCode() | wordpress | raw }}
{% else %}
{# Otherwise use the selected pre-set fields #}
<form method="post" class="py-4" enctype="multipart/form-data">
{% if page.getLPFormFirstname() %}
<label class="btn-block"><span>First Name:</span>
<input
type="text"
class="form-control"
placeholder="Your First Name"
name="lead[firstname]"
required
/>
</label>
{% endif %}
{% if page.getLPFormLastname() %}
<label class="btn-block"><span>Last Name:</span>
<input
type="text"
class="form-control"
placeholder="Your Last Name"
name="lead[lastname]"
required
/>
</label>
{% endif %}
{% if page.getLPFormCompany() %}
<label class="btn-block"><span>Company:</span>
<input
type="text"
class="form-control"
placeholder="Your Company"
name="lead[company]"
/>
</label>
{% endif %}
{% if page.getLPFormAddress1() %}
<label class="btn-block"><span>Address Line 1:</span>
<input
type="text"
class="form-control"
placeholder="Your Address Line 1"
name="lead[address1]"
/>
</label>
{% endif %}
{% if page.getLPFormAddress2() %}
<label class="btn-block"><span>Address Line 2:</span>
<input
type="text"
class="form-control"
placeholder="Your Address Line 2"
name="lead[address2]"
/>
</label>
{% endif %}
{% if page.getLPFormCity() %}
<label class="btn-block"><span>City:</span>
<input
type="text"
class="form-control"
placeholder="Your City"
name="lead[city]"
/>
</label>
{% endif %}
{% if page.getLPFormState() %}
<label class="btn-block"><span>State / Region:</span>
<input
type="text"
class="form-control"
placeholder="Your State / Region"
name="lead[state]"
/>
</label>
{% endif %}
{% if page.getLPFormZip() %}
<label class="btn-block"><span>Zip Code:</span>
<input
type="text"
class="form-control"
placeholder="Your Zip Code"
name="lead[zip]"
/>
</label>
{% endif %}
{% if page.getLPFormPhone() %}
<label class="btn-block"><span>Phone:</span>
<input
type="text"
class="form-control"
placeholder="Your Phone"
name="lead[phone]"
required
/>
</label>
{% endif %}
{% if page.getLPFormEmail() %}
<label class="btn-block"><span>Email:</span>
<input
type="text"
class="form-control"
placeholder="Your Email Address"
name="lead[email]"
required
/>
</label>
{% endif %}
{% if page.getLPFormContractorType() %}
<label class="btn-block"><span>Type of Contractor:</span></label>
<label class="btn-block">
<input
type="radio"
name="lead[contractor_type]"
value="Primarily Residential"
required
/>
<span>Primarily Residential</span>
</label>
<label class="btn-block">
<input
type="radio"
name="lead[contractor_type]"
value="Primarily Commercial"
required
/>
<span>Primarily Commercial</span>
</label>
<label class="btn-block">
<input
type="radio"
name="lead[contractor_type]"
value="Both"
required
/>
<span>Both</span>
</label>
<label class="btn-block">
<input
type="radio"
name="lead[contractor_type]"
value="Not a Contractor"
required
/>
<span>Not a Contractor</span>
</label>
{% endif %}
{% if page.getLPFormImage() %}
<label class="btn-block">
<span class="rtooltip">Attach Image <i class="fa fa-question-circle"></i>:
<div class="rtooltiptext" style="top: -305px;left:120px;width:350px;">
RoofersCoffeeShop offers users the ability to post messages, submit information, and upload images to be used on this site. This information is shared with advertisers and partners associated with RoofersCoffeeShop.
<br><br>
You acknowledge that you have permission related to Content, Information, and Images submitted and that they do not violate any copyright laws or privacy.
<br><br>
RoofersCoffeeShop is not responsible for the content or accuracy of any information posted and shall not be responsible for any decisions made based on such information.
<br><br>
NOTE: Only PNG, JPG, GIF, PDF file types are supported.
</div>
</span>
{#
<input type="hidden" name="lead_custom_img[{{field.getTitle()|replace({' ': ''})}}]" value="{{field.getTitle()}}" />
<input
type="file"
name="img_{{field.getTitle()|replace({' ': ''})}}"
class="form-control"
{% if field.getRequired() %} required {% endif %}
/>
#}
<input type="hidden" name="lead_custom_img[attachment]" value="attachment" />
<input
type="file"
name="img_attachment"
class="form-control"
accept="image/png,image/gif,image/jpeg,image/jpeg,application/pdf"
/>
</label>
{% endif %}
<div class="form-row g-recaptcha" data-sitekey="6LeEIlMUAAAAAGhdmJJLdJHPxaWx2GqBjber5n6B"></div>
{% if page.getLPOptIn() %}
<label class="btn-block pt-4">
<input
type="checkbox"
name="lead[optin]"
value="yes"
required
/>
<span>{{page.getLPOptIn()}}</span>
</label>
{% endif %}
<div style="text-align: center;">
<button
class="btn mt-3"
type="submit"
style="color: #fff; background: {{buttonColor}};"
>{{buttonText}}</button>
</div>
</form>
{% endif %}
</div>
{# Right Column #}
<div class="col-md-6 p-3" style="background: {{page.getLPRightColor()}};">
{{ page.getLPRight()|raw }}
</div>
</div>
{# Footer #}
<div class="row" style="min-height: 10px;">
<div class="col-md-12 p-3" style="background: {{page.getLPFooterColor()}};">
{{ page.getLPFooter()|raw }}
</div>
</div>
</div>
</div>
{% else %}
{# looks to be working ... #}
{% set modules = page.getContentMetaValueByKey("mtm_content_modules") %}
{% if modules %}
{% set modules = unserialize(modules) %}
{% include "content/tmpl/mtm-module-loop.html.twig" %}
{% endif %}
{#
<table class="table">
{% for meta in page.getContentMeta() %}
<tr>
<td>{{ meta.getMetakey() }}:</td>
<td>{{ meta.getMetavalue() }}</td>
</tr>
{% endfor %}
</table>
#}
{% endif %}
</div>
</div>
</div>
{% if background is not empty %}
</div>
{% endif %}
{% else %}
<div class="container">
<div class="row">
<div class="col-sm-8">
{{ page.content_full | raw }}
</div>
<div class="col-sm-4">
[Sidebar]
</div>
</div>
</div>
{% endif %}
{% endblock %}