You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
122 lines
5.0 KiB
122 lines
5.0 KiB
{% load cms_tags djangocms_forms_tags i18n sekizai_tags staticfiles %}
|
|
|
|
<div class="consultation consultation-form" ng-controller="ModalFormCtrl" class="modal-form">
|
|
<script type="text/ng-template" id="modalFormTemplate-{{ instance.id }}.html">
|
|
<div class="modal-body modal-consultation">
|
|
<img src="{% with 'imgs/phone.png' as image_static %}{% static image_static %}{% endwith %}">
|
|
<div class="forms" id="{{ instance.form_id }}">
|
|
{% if instance.title != instance.name %}
|
|
<h1 class="title">{{ instance.title }}</h1>
|
|
<h2 class="title">{% trans 'Service' %} «{{ instance.name }}»</h2>
|
|
{% else %}
|
|
<h1 class="title">{{ instance.name }}</h1>
|
|
{% endif %}
|
|
|
|
{% if instance.description %}
|
|
<div class="description">
|
|
{{ instance.description|safe }}
|
|
</div>
|
|
{% endif %}
|
|
<div class="form-wrapper">
|
|
<form action="{{ form.submission_url }}" method="POST" enctype="multipart/form-data" onsubmit="yaCounter950321.reachGoal('Callback'); return true;">
|
|
<div class="form-errors" style="display:none;"></div>
|
|
|
|
<div class="field-wrapper">
|
|
|
|
<label for="name">
|
|
{% trans 'Name' %}
|
|
</label>
|
|
<p>
|
|
{{ form.name }}
|
|
</p>
|
|
{% if form.email %}
|
|
<p>{% trans 'We can call you or anwser by email' %}</p>
|
|
<div id="contact-type" ng-tabs class="tabs-plugin">
|
|
<ul class="tabs-list list-unstyled list-inline">
|
|
<li ng-tab-head="active"><a ng-click="$event.preventDefault()" href="#contact-phone">{% trans 'Call' %}</a></li>
|
|
|
|
<li ng-tab-head="active"><a ng-click="$event.preventDefault()" href="#contact-email">{% trans 'Email' %}</a>
|
|
</ul>
|
|
|
|
<div id="contact-phone" ng-tab-body class="tab-body">
|
|
{{ form.phone }}
|
|
</div>
|
|
|
|
<div id="contact-email" ng-tab-body class="tab-body">
|
|
<p>{{ form.email }}</p>
|
|
<label for="comment">
|
|
{% trans 'Question' %}
|
|
</label>
|
|
<p>{{ form.comment }}</p>
|
|
</div>
|
|
</div>
|
|
{% else %}
|
|
<label for="phone">
|
|
{% trans 'Phone' %}
|
|
</label>
|
|
<p>
|
|
{{ form.phone }}
|
|
</p>
|
|
|
|
<label for="subject">
|
|
{% trans 'Subject' %}
|
|
</label>
|
|
<p>
|
|
{{ form.subject }}
|
|
</p>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
|
|
{% csrf_token %}
|
|
{% for hidden in form.hidden_fields %}
|
|
{{ hidden }}
|
|
{% endfor %}
|
|
<div class="button-wrapper submit">
|
|
<button class="form-button btn btn-primary" type="submit" value="{{ instance.submit_btn_txt }}">{{ instance.submit_btn_txt }}</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<div class="form-success" style="display: none;">
|
|
{% if instance.post_submit_msg %}
|
|
<p>{{ instance.post_submit_msg|safe }}</p>
|
|
{% else %}
|
|
{% blocktrans %}
|
|
<h3>Submission successful</h3>
|
|
<p>Thank You! Your form has been successfully submitted!</p>
|
|
{% endblocktrans %}
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</form>
|
|
</div>
|
|
</script>
|
|
|
|
<button class="btn btn-consultation" ng-click="open('{{ instance.id }}');" onclick="yaCounter950321.reachGoal('CallbackOpen'); return true;" value="">{{ instance.title }}</button>
|
|
|
|
</div>
|
|
|
|
{% addtoblock "js" %}
|
|
<script src="{% static 'js/djangocms_forms/libs/jquery.form.min.js' %}"></script>
|
|
<script src="{% static 'js/djangocms_forms/djangocms_forms.js' %}"></script>
|
|
<script type="text/javascript">
|
|
$(function() {
|
|
if(typeof consultation_link == "undefined") {
|
|
$( "[href^='#consultation'" ).click(function(e) {
|
|
event.preventDefault();
|
|
|
|
angular.element($('.consultation-form')[0]).scope().open({{ instance.id }});
|
|
yaCounter950321.reachGoal('CallbackOpen');
|
|
});
|
|
|
|
consultation_link = true;
|
|
}
|
|
});
|
|
</script>
|
|
|
|
{% endaddtoblock %}
|
|
|