custom/static-plugins/LDSCustom/src/Resources/views/rcpmanager/page/detail.html.twig line 153

Open in your IDE?
  1. {% sw_extends '@NdsRecipeManager/rcpmanager/page/detail.html.twig' %}
  2. {% import "@NdsRecipeManager/rcpmanager/macro/elements.html.twig" as element %}
  3. {% block recipe_detail_content %}
  4.     <div class="breadcrumb cms-breadcrumb container">
  5.         <nav aria-label="breadcrumb">
  6.             <ol class="breadcrumb" itemscope="">
  7.                 <li class="breadcrumb-item">
  8.                     <a href="/Ratgeber/" class="breadcrumb-link " title="Ratgeber">
  9.                         <link href="/Ratgeber/">
  10.                         <span class="breadcrumb-title">Ratgeber</span>
  11.                     </a>
  12.                     <meta content="c0c12d827e83419290c94dcea4e770c8">
  13.                 </li>
  14.                 <div class="breadcrumb-placeholder">
  15.                     {% sw_icon 'arrow-medium-right' style { 'size': 'fluid', 'pack': 'solid'} %}
  16.                 </div>
  17.                 <li class="breadcrumb-item">
  18.                     <a href="/rezepte" class="breadcrumb-link" title="Rezepte">
  19.                         <link href="/rezepte">
  20.                         <span class="breadcrumb-title">Rezepte</span>
  21.                     </a>
  22.                     <meta content="0fe843ef52434f4491ce6678ff405042">
  23.                 </li>
  24.                 <div class="breadcrumb-placeholder">
  25.                     {% sw_icon 'arrow-medium-right' style { 'size': 'fluid', 'pack': 'solid'} %}
  26.                 </div>
  27.                 <li class="breadcrumb-item" aria-current="page">
  28.                     <div itemprop="item">
  29.                         <div itemprop="name">{{ recipe.translated.name }}</div>
  30.                     </div>
  31.                 </li>
  32.             </ol>
  33.         </nav>
  34.     </div>
  35.     {% block recipe_detail_inner %}
  36.         <div class="recipe">
  37.             {% block recipe_detail_info %}
  38.                 <div class="product-detail-content">
  39.                     <div class="recipe-detail-main">
  40.                         <div class="row">
  41.                             <div class="col-12">
  42.                                 <h1 class="recipe-title">{{ recipe.translated.name }}</h1>
  43.                             </div>
  44.                         </div>
  45.                         {% block recipe_detail_image %}
  46.                             <div class="row">
  47.                                 <div class="col-12 col-lg-8">
  48.                                     <div class="recipe-detail-media">
  49.                                         {% if recipe.cover %}
  50.                                             {% set attributes = {
  51.                                                 'class': 'img-fluid',
  52.                                                 'alt': (recipe.media.translated.alt ?: recipe.media.fileName),
  53.                                                 'title': (recipe.media.translated.title ?: recipe.media.fileName)
  54.                                             } %}
  55.                                             {% sw_thumbnails 'recipe-image-thumbnail' with {
  56.                                                 media: recipe.cover,
  57.                                                 sizes: {
  58.                                                     "xs" : "500px",
  59.                                                     "sm" : "315px",
  60.                                                     "md" : "390px",
  61.                                                     "lg" : "350px",
  62.                                                     "xl" : "520px",
  63.                                                 }
  64.                                             } %}
  65.                                         {% else %}
  66.                                             <div class="recipe-image-placeholder">
  67.                                                 {% sw_icon 'placeholder' style {
  68.                                                     'size': 'fluid'
  69.                                                 } %}
  70.                                             </div>
  71.                                         {% endif %}
  72.                                     </div>
  73.                                     <div class="row">
  74.                                         <div class="col-6">
  75.                                             {% if recipe.preparationTime is not empty %}
  76.                                                 <div class="prepare-duration">
  77.                                                     <span class="circle">{{ recipe.preparationTime }}
  78.                                                         {{ "minutes"|trans|sw_sanitize }}</span>
  79.                                                     <span>Zubereitungszeit</span>
  80.                                                 </div>
  81.                                             {% endif %}
  82.                                         </div>
  83.                                         <div class="col-6">
  84.                                             {% if recipe.difficulty is not empty %}
  85.                                                 <div class="prepare-difficulty">
  86.                                                     <span class="circle"><img src="{{ asset('bundles/ldscustom/spoon.png', 'asset') }}"></span>
  87.                                                     <span>{{ recipe.difficulty.translated.name }}</span>
  88.                                                 </div>
  89.                                             {% endif %}
  90.                                         </div>
  91.                                     </div>
  92.                                     {% block recipe_source%}
  93.                                         <div class="recipe-source">
  94.                                             {{ "source"|trans|sw_sanitize }}:
  95.                                             {{ app.request.uri }}
  96.                                         </div>
  97.                                     {% endblock %}
  98.                                     {% if recipe.description %}
  99.                                         {% block recipe_description %}
  100.                                             <p>{{ recipe.translated.description|sw_sanitize }}</p>
  101.                                         {% endblock %}
  102.                                     {% endif %}
  103.                                     {% if recipe.translated.preparation %}
  104.                                         {% block recipe_preperation %}
  105.                                             <div class="recipe-preparation">
  106.                                                 <h2 class="mb-4 preparationTitle">{{ "preparation"|trans }}</h2>
  107.                                                 <div class="preparation">
  108.                                                     {{ recipe.translated.preparation|sw_sanitize }}
  109.                                                 </div>
  110.                                             </div>
  111.                                         {% endblock %}
  112.                                     {% endif %}
  113.                                     {% if recipe.translated.subhead is defined %}
  114.                                         <div class="recipe-tipp">
  115.                                             {{"lds.recipe.tipp"|trans}}<br>
  116.                                             {{ recipe.translated.subhead }}
  117.                                         </div>
  118.                                     {% endif %}
  119.                                     {% if recipe.hasTags() %}
  120.                                         <div class="recipe-tags">
  121.                                             {% block recipe_assignment_tags %}
  122.                                                 {% if recipe.hasTags() %}
  123.                                                     <div class="col-auto">
  124.                                                         <div class="product-detail-configurator-group">
  125.                                                             <div class="product-detail-configurator-group-title">
  126.                                                                 {{ "tags"|trans }}
  127.                                                             </div>
  128.                                                             <div class="product-detail-configurator-options">
  129.                                                                 {% for tag in recipe.tags.elements|sort((a, b) => a.slug|lower > b.slug|lower) %}
  130.                                                                     <div class="product-detail-configurator-option">
  131.                                                                         <span class="product-detail-configurator-option-input is-combinable"></span>
  132.                                                                         <a href="{{ seoUrl('rcp.frontend.tag', { slug: tag.translated.slug }) }}" class="product-detail-configurator-option-label is-display-text">
  133.                                                                             {{ tag.translated.name }}
  134.                                                                         </a>
  135.                                                                     </div>
  136.                                                                 {% endfor %}
  137.                                                             </div>
  138.                                                         </div>
  139.                                                     </div>
  140.                                                 {% endif %}
  141.                                             {% endblock %}
  142.                                         </div>
  143.                                     {% endif %}
  144.                                     <div class="recipe-category">
  145.                                         {% block recipe_assignment_category %}
  146.                                             {{parent()}}
  147.                                         {% endblock %}
  148.                                     </div>
  149.                                 </div>
  150.                                 <div class="col-12 col-lg-4">
  151.                                     <div class="recipe-sidebar">
  152.                                         {% if recipe.ingredients.elements %}
  153.                                             {% block recipe_ingredients %}
  154.                                                 <div class="recipe-ingredients">
  155.                                                     <h2 class="mb-4">{{ "ingredients"|trans|sw_sanitize }}</h2>
  156.                                                     {% block recipe_ingredients_portion_calculator %}
  157.                                                         {% if recipe.portionCalculatorActive %}
  158.                                                             <template data-portion-calculator></template>
  159.                                                             <div id="portionCalculator">
  160.                                                                 <p>
  161.                                                                     <label for="portionQuantity">
  162.                                                                         {{ 'portions'|trans|sw_sanitize }}
  163.                                                                     </label>
  164.                                                                     <input type="number" value="{{ recipe.portionQuantity }}" min="1" max="20" id="portionQuantity">
  165.                                                                 </p>
  166.                                                             </div>
  167.                                                         {% endif %}
  168.                                                     {% endblock %}
  169.                                                     {% block recipe_ingredients_table %}
  170.                                                         <table class="table ingredients">
  171.                                                             {% for ingredient in recipe.ingredients %}
  172.                                                                 {% if not ingredient.product %}
  173.                                                                     {{ element.ingredientTableRow(ingredient, recipe.portionQuantity) }}
  174.                                                                 {% endif %}
  175.                                                             {% endfor %}
  176.                                                         </table>
  177.                                                         {% set availableProducts = 0 %}
  178.                                                         {% for ingredient in recipe.ingredients %}
  179.                                                             {% if ingredient.product.active %}
  180.                                                                 {% set availableProducts = availableProducts + 1 %}
  181.                                                             {% endif %}
  182.                                                         {% endfor %}
  183.                                                         {% if config('NdsRecipeManager.config.addAllProductsToCart') && (availableProducts > 0) %}
  184.                                                             <form action="{{ path('frontend.checkout.line-item.add') }}" method="post" data-add-to-cart="true">
  185.                                                                 {{ sw_csrf('frontend.checkout.line-item.add') }}
  186.                                                                 {% for ingredient in recipe.ingredients %}
  187.                                                                     {% if ingredient.product.active %}
  188.                                                                         <input type="hidden" name="redirectTo" value="frontend.cart.offcanvas">
  189.                                                                         <input type="hidden" name="lineItems[{{ ingredient.product.id }}][id]" value="{{ ingredient.product.id }}">
  190.                                                                         <input type="hidden" name="lineItems[{{ ingredient.product.id }}][type]" value="product">
  191.                                                                         <input type="hidden" name="lineItems[{{ ingredient.product.id }}][referencedId]" value="{{ ingredient.product.id }}">
  192.                                                                         <input type="hidden" name="lineItems[{{ ingredient.product.id }}][stackable]" value="1">
  193.                                                                         <input type="hidden" name="lineItems[{{ ingredient.product.id }}][removable]" value="1">
  194.                                                                         <input type="hidden" name="lineItems[{{ ingredient.product.id }}][quantity]" value="1">
  195.                                                                         <input type="hidden" name="product-name" value="{{ ingredient.product.name }}">
  196.                                                                     {% endif %}
  197.                                                                 {% endfor %}
  198.                                                                 <button class="btn btn-primary btn-sm addAllToCart">
  199.                                                                     {% sw_icon 'cart' style {
  200.                                                                         'color': 'light',
  201.                                                                         'size' : 'xs'
  202.                                                                     } %}
  203.                                                                     {{ 'addAllProductsToCart'|trans|sw_sanitize }}
  204.                                                                 </button>
  205.                                                             </form>
  206.                                                         {% endif %}
  207.                                                     {% endblock %}
  208.                                                 </div>
  209.                                             {% endblock %}
  210.                                         {% endif %}
  211.                                         {% block recipe_detail_print%}
  212.                                             <a onclick="window.print()" class="recipe-print">
  213.                                                 <div class="mr-0">{%  sw_icon('printer') %}</div>
  214.                                                 {{ "print"|trans|sw_sanitize }}
  215.                                             </a>
  216.                                         {% endblock %}
  217.                                     </div>
  218.                                 </div>
  219.                             </div>
  220.                         {% endblock %}
  221.                         <div class="row">
  222.                             <div class="col-12 mt-5">
  223.                                 {% set prods = page.extensions.lds_recipe_data.data %}
  224.                                 {% set config = {
  225.                                     'title': {
  226.                                         'value': "lds.recipe.sliderTitle"|trans
  227.                                     },
  228.                                     'border': {
  229.                                         'value': false
  230.                                     },
  231.                                     'rotate': {
  232.                                         'value': false
  233.                                     },
  234.                                     'products': {
  235.                                         'value': prods
  236.                                     },
  237.                                     'boxLayout': {
  238.                                         'value': 'standard'
  239.                                     },
  240.                                     'elMinWidth': {
  241.                                         'value': '300px'
  242.                                     },
  243.                                     'navigation': {
  244.                                         'value': true
  245.                                     },
  246.                                     'displayMode': {
  247.                                         'value': 'minimal'
  248.                                     },
  249.                                     'verticalAlign': {
  250.                                         'value': 'top'
  251.                                     },
  252.                                 } %}
  253.                                 {% sw_include "@Storefront/storefront/element/cms-element-recipe-product-slider.html.twig" with {
  254.                                     sliderConfig: config,
  255.                                     element: {
  256.                                         'data': {
  257.                                             'products': {
  258.                                                 elements: prods
  259.                                             }
  260.                                         },
  261.                                         type: 'product-slider'
  262.                                     }
  263.                                 } %}
  264.                             </div>
  265.                         </div>
  266.                     </div>
  267.                 </div>
  268.             {% endblock %}
  269.         </div>
  270.         {% if recipe.hasRelatedRecipes %}
  271.             {% block recipe_related_recipes %}
  272.                 {{parent()}}
  273.             {% endblock %}
  274.         {% endif %}
  275.     {% endblock %}
  276. {% endblock %}