templates/shop/masters.html.twig line 1

Open in your IDE?
  1. {% extends 'nav.html.twig' %}
  2. {% block title %}Мастера{% endblock %}
  3. {% block content %}
  4.     <section class="jumbotron text-center" style="margin-bottom: 0; padding-top: 125px">
  5.         <div class="container">
  6.             <h1 class="jumbotron-heading">Не нашли желаемые товары?</h1>
  7.             <p class="lead text-muted">
  8.                 Предлагаем сформировать индивидуальный заказ. Как только найдётся мастер, готовый выполнить ваш заказ - мы вам позвоним.
  9.             </p>
  10.             <div class="d-grid gap-2 d-sm-flex justify-content-sm-center">
  11.                 <a {% if app.user %} onclick="showAddIndividualProductForm()" {% else %}  href="/login" {% endif %} class="btn btn-primary btn-lg my-2" style="margin-right: 1.5rem">Формировать заказ</a>
  12.                 <a class="btn btn-secondary btn-lg my-2" style="color: #FFFFFF !important;" {% if app.user %} onclick="showAskQuestionModal()" {% else %} href="/login" {% endif %}>Узнать условия</a>
  13.             </div>
  14.         </div>
  15.     </section>
  16.     <div class="album py-5 bg-light">
  17.         <div class="container">
  18.             <div class="row">
  19.                 {% for master in masters %}
  20.                 <div class="col-md-4">
  21.                     <div class="card mb-4 box-shadow" style="width: 350px; height: 650px">
  22.                         <img class="card-img-top" data-src="holder.js/100px225?theme=thumb&amp;bg=55595c&amp;fg=eceeef&amp;text=Thumbnail" alt="Thumbnail [100%x225]" style="height: 450px; width: 350px; display: block;object-fit: cover" src="data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%22348%22%20height%3D%22225%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20348%20225%22%20preserveAspectRatio%3D%22none%22%3E%3Cdefs%3E%3Cstyle%20type%3D%22text%2Fcss%22%3E%23holder_18d690bb713%20text%20%7B%20fill%3A%23eceeef%3Bfont-weight%3Abold%3Bfont-family%3AArial%2C%20Helvetica%2C%20Open%20Sans%2C%20sans-serif%2C%20monospace%3Bfont-size%3A17pt%20%7D%20%3C%2Fstyle%3E%3C%2Fdefs%3E%3Cg%20id%3D%22holder_18d690bb713%22%3E%3Crect%20width%3D%22348%22%20height%3D%22225%22%20fill%3D%22%2355595c%22%3E%3C%2Frect%3E%3Cg%3E%3Ctext%20x%3D%22116.68333435058594%22%20y%3D%22120.3%22%3EThumbnail%3C%2Ftext%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E" data-holder-rendered="true">
  23.                         <div class="card-body">
  24.                             <p class="card-text">{{ master.name }} {{ master.lastname }}</p>
  25.                             <p class="card-text text-muted" style="height: 70px">{{ master.Aboutme }}</p>
  26.                             <div class="d-flex justify-content-between align-items-center">
  27.                                 <div class="btn-group flex-shrink-1">
  28.                                     <button type="button" class="btn btn-sm btn-outline-dark" style="font-size: 14px">Сделать заказ</button>
  29.                                     <button type="button" class="btn btn-sm btn-outline-dark" style="font-size: 14px">Работы мастера</button>
  30.                                 </div>
  31.                                 <small class="text-muted" style="font-size: 14px">
  32.                                    {% if (master.specialties != null) %}
  33.                                        {{ master.specialties.title }}
  34.                                    {% endif %}
  35.                                 </small>
  36.                             </div>
  37.                         </div>
  38.                     </div>
  39.                 </div>
  40.                 {% endfor %}
  41.             </div>
  42.         </div>
  43.     </div>
  44.     <div class="modal fade bd-example-modal-lg" id="MastersModal" tabindex="-1" role="dialog">
  45.         <div class="modal-dialog modal-lg" style="max-width: 800px">
  46.             <div id="MastersModalContent" class="modal-content" style="top: 100px;">
  47.             </div>
  48.         </div>
  49.     </div>
  50. {% endblock %}
  51. {% block pagescripts %}
  52.     <script>
  53.         /**
  54.          * Показывает форму создания заказа на индивидуальный продукт
  55.          */
  56.         function showAddIndividualProductForm() {
  57.             $('#MastersModal').on('hidden.bs.modal', function () {
  58.                 closeModal();
  59.             });
  60.             let url = '/addIndividualProduct';
  61.             sendPostRequest(url)
  62.                 .then(function (response) {
  63.                     document.getElementById('MastersModalContent').innerHTML = response;
  64.                     $('#MastersModal').modal('show');
  65.                 });
  66.         }
  67.         /**
  68.          * Закрывает модальное окно создания заказа на индивидуальный продукт
  69.          */
  70.         function closeModal() {
  71.             $('#MastersModal').modal('hide');
  72.         }
  73.         /**
  74.          * Отправляет форму создания заказа
  75.          */
  76.         function submitAddIndividualProductForm() {
  77.             event.preventDefault();
  78.             let form = document.getElementById('addIndividualProductForm')
  79.             let formData = new FormData(form);
  80.             let url = '/addIndividualProduct';
  81.             sendPostRequest(url, formData)
  82.                 .then(function () {
  83.                     showSuccessAlert('Заказ успешно создан');
  84.                     setTimeout(function () {
  85.                         closeModal();
  86.                     }, 1000);
  87.                 })
  88.         }
  89.         /**
  90.          * Открывает модально окно 'Узнать подробности'
  91.          */
  92.         function showAskQuestionModal() {
  93.             let url = '/about/question';
  94.             $('#MastersModal').on('hidden.bs.modal', function () {
  95.                closeModal()
  96.             });
  97.             sendPostRequest(url)
  98.                 .then(function (response) {
  99.                     $('#MastersModal').modal('show');
  100.                     document.getElementById('MastersModalContent').innerHTML = response;
  101.                 });
  102.         }
  103.         /**
  104.          * Отправляет форму 'Задать вопрос' на сервер
  105.          */
  106.         function submitQuestionForm() {
  107.             let url = '/about/question';
  108.             let form = document.getElementById('questionForm');
  109.             let formData = new FormData(form);
  110.             sendPostRequest(url, formData)
  111.                 .then(function () {
  112.                     showSuccessAlert('Вопрос успешно создан!');
  113.                     setTimeout(function () {
  114.                         location.reload();
  115.                     }, 500);
  116.                 })
  117.         }
  118.     </script>
  119. {% endblock %}