chore: initial import for test contour with k3s CI
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
<form method="post" action="{{ path('widget_form_delete', {'id': widget_form.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ widget_form.id) }}">
|
||||
<button class="btn">Delete</button>
|
||||
</form>
|
||||
@@ -0,0 +1,5 @@
|
||||
{% form_theme form 'bootstrap_4_layout.html.twig' %}
|
||||
{{ form_start(form) }}
|
||||
{{ form_widget(form) }}
|
||||
<button class="btn btn-primary">{{ button_label|default('Save') }}</button>
|
||||
{{ form_end(form) }}
|
||||
@@ -0,0 +1,13 @@
|
||||
{% extends 'admin_base.html.twig' %}
|
||||
|
||||
{% block title %}Edit WidgetForm{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Edit WidgetForm</h1>
|
||||
|
||||
{{ include('widget_form/_form.html.twig', {'button_label': 'Update'}) }}
|
||||
|
||||
<a href="{{ path('widget_form_index') }}">back to list</a>
|
||||
|
||||
{{ include('widget_form/_delete_form.html.twig') }}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,34 @@
|
||||
{% extends 'admin_base.html.twig' %}
|
||||
|
||||
{% block title %}WidgetForm{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>{{ widget_form.name }}</h1>
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="jumbotron">
|
||||
{% for input in form_input %}
|
||||
<div class="form-group">
|
||||
<label for="widget_form_{{ input.bitrix24Id }}">{{ input.text }}</label>
|
||||
<a href="{{ path('widget_form_input_edit', {'id': input.id, 'formId': widget_form.id}) }}">Изменить</a>
|
||||
{% if input.type == 'text' %}
|
||||
<input class="form-control" type="text" id="{{ input.bitrix24Id }}">
|
||||
{% elseif input.type == 'phone' %}
|
||||
<input class="form-control" type="text" data-controller="inputMask" id="{{ input.bitrix24Id }}">
|
||||
{% elseif input.type == 'date' %}
|
||||
<input class="form-control" type="text" data-controller="datePicker" id="{{ input.bitrix24Id }}">
|
||||
{% elseif input.type == 'textarea' %}
|
||||
<textarea class="form-control" id="{{ input.bitrix24Id }}"></textarea>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<p>Добавить элемент</p>
|
||||
{{ include('widget_form/_form.html.twig', {'button_label': 'Добавить поле'}) }}
|
||||
</div>
|
||||
</div>
|
||||
<a href="{{ path('widget_form_index') }}">back to list</a>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,37 @@
|
||||
{% extends 'admin_base.html.twig' %}
|
||||
|
||||
{% block title %}WidgetForm index{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Виджет формы</h1>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<th>Name</th>
|
||||
<th>Link</th>
|
||||
<th>actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for widget_form in widget_forms %}
|
||||
<tr>
|
||||
<td>{{ widget_form.id }}</td>
|
||||
<td>{{ widget_form.name }}</td>
|
||||
<td>{{ absolute_url(path('widget_form_show', {'id': widget_form.id})) }}</td>
|
||||
<td>
|
||||
<a href="{{ path('widget_form_editor', {'id': widget_form.id}) }}">настроить поля формы</a> <br>
|
||||
<a href="{{ path('widget_form_edit', {'id': widget_form.id}) }}">редактировать форму</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="3">no records found</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<a href="{{ path('widget_form_new') }}">Create new</a>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,11 @@
|
||||
{% extends 'admin_base.html.twig' %}
|
||||
|
||||
{% block title %}New WidgetForm{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Create new WidgetForm</h1>
|
||||
|
||||
{{ include('widget_form/_form.html.twig') }}
|
||||
|
||||
<a href="{{ path('widget_form_index') }}">back to list</a>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,72 @@
|
||||
{% extends 'base_widget.html.twig' %}
|
||||
|
||||
{% block title %}WidgetForm index{% endblock %}
|
||||
|
||||
{% block js %}
|
||||
<script src="https://smartcaptcha.yandexcloud.net/captcha.js"></script>
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
{% if renderForm %}
|
||||
<form id="wf_cabinet_{{ widget_form.id }}" action="{{ path('widget_form_show', {'id': widget_form.id}) }}" method="POST">
|
||||
{% set query = app.request.query.all %}
|
||||
{% for key, queryParam in query %}
|
||||
{% if key == 'fields' %}
|
||||
{% for field, val in queryParam %}
|
||||
<input type="hidden" name="fields[{{ field }}]" value="{{ val }}">
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if key != 'hidden' and key != 'fields' %}
|
||||
<input type="hidden" name="{{ key }}" value="{{ queryParam }}">
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
<input id="wf_title" type="hidden" name="fields[TITLE]" value="{{ widget_form.name }}">
|
||||
<input id="wf_currency_id" type="hidden" name="fields[CURRENCY_ID]" value="RUB">
|
||||
{% for input in widget_form.widgetFormInputs %}
|
||||
{% set hiddenVal = false %}
|
||||
{% if query.hidden is defined and query.hidden[input.bitrix24Id] is defined %}
|
||||
{% set hiddenVal = query.hidden[input.bitrix24Id] %}
|
||||
{% endif %}
|
||||
<div class="form-group">
|
||||
{% if input.type == 'text' %}
|
||||
{% if hiddenVal == false %}
|
||||
{# <label for="wf_{{ input.bitrix24Id }}">{{ input.text }}</label> #}
|
||||
<input class="form-control" type="text" name="fields[{{ input.bitrix24Id }}]" id="wf_{{ input.bitrix24Id }}" placeholder="{{ input.text }}" required>
|
||||
{% else %}
|
||||
<input class="form-control" type="hidden" name="fields[{{ input.bitrix24Id }}]" id="wf_{{ input.bitrix24Id }}" value="{{ hiddenVal }}">
|
||||
{% endif %}
|
||||
{% elseif input.type == 'phone' %}
|
||||
{# <label for="wf_{{ input.bitrix24Id }}">{{ input.text }}</label> #}
|
||||
<input class="form-control" type="text" name="fields[{{ input.bitrix24Id }}][][VALUE]" data-controller="inputMask" id="wf_{{ input.bitrix24Id }}" placeholder="{{ input.text }}" required>
|
||||
<input type="hidden" name="fields[{{ input.bitrix24Id }}][][VALUE_TYPE]" value="MOBILE" required>
|
||||
{% elseif input.type == 'date' %}
|
||||
<label class="d-block" for="wf_{{ input.bitrix24Id }}">{{ input.text }}</label>
|
||||
<input class="form-control" type="text" name="fields[{{ input.bitrix24Id }}]" data-controller="datePicker" id=" wf_{{ input.bitrix24Id }}" placeholder="{{ input.text }}" required>
|
||||
{% elseif input.type == 'textarea' %}
|
||||
{% if hiddenVal == false %}
|
||||
{# <label for="wf_{{ input.bitrix24Id }}">{{ input.text }}</label> #}
|
||||
<textarea class="form-control" id="wf_{{ input.bitrix24Id }}" name="fields[{{ input.bitrix24Id }}]" placeholder="{{ input.text }}" required></textarea>
|
||||
{% else %}
|
||||
<textarea class="form-control" id="wf_{{ input.bitrix24Id }}" name="fields[{{ input.bitrix24Id }}]">{{ hiddenVal }}</textarea>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
<div class="form-group mb-0">
|
||||
<a class="staff-info__review license-link" href="{{ getPoliticaLink(regionId) }}" target="_blank">Отправляя данные, вы подтверждаете согласие на обработку персональных данных и принимаете условия политики их обработки</a>
|
||||
</div>
|
||||
<div id="smart-captcha"></div>
|
||||
<div class="form-group">
|
||||
<button disabled type="submit" class="btn btn-primary form-control mt-3" data-controller="smartCaptcha" data-form-id="wf_cabinet_{{ widget_form.id }}" data-action="click->smartCaptcha#setYm">Отправить</button>
|
||||
</div>
|
||||
</form>
|
||||
{% else %}
|
||||
<div class="text-center">
|
||||
<img src="/images/checkmark.png" width="150" alt="ok">
|
||||
<p>Ваша заявка отправлена! <br> Мы свяжемся с Вами в ближайшее время.</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user