templates/Resources/resources.html.twig line 1

Open in your IDE?
  1. {% extends "layout/layout.html.twig" %}
  2. {% block title %}GFS - Resources
  3. {% endblock %}
  4. {% block content %}
  5.     <!--Start Main Slider-->
  6.     {% if current_category.sliders is defined %}
  7.         <section class="main-slider-section product-main-slider resources-section-slider">
  8.             <div class="container container-lg">
  9.                 <div class="custom-slider singal-slider main-slider">
  10.                     {% for slide in current_category.sliders %}
  11.                         <div class="slide">
  12.                             <div class="slide-media slide-media-desktop">
  13.                                 <img src="{{slide.sliderimages.data}}" alt="resource banner"/>
  14.                                 
  15.                             </div>
  16.                             <div class="slide-media slide-media-mobile">
  17.                                 <img src="{{slide.sliderimages_mobile.data}}" alt="resource banner mobile"/>
  18.                             </div>
  19.                             <div class="silde-content-box">
  20.                                 <div class="slide-content">
  21.                                     <h1>
  22.                                         <span class="title-sm d-block">{{ slide.localizedfields.data.getLocalizedValue('slidertitle') }}</span>
  23.                                         <span class="title-lg underline-end">{{current_category.name}}</span>
  24.                                     </h1>
  25.                                 </div>
  26.                                 <div class="product-brand d-none">
  27.                                     <img src="{{slide.sliderbrandlogo}}" alt="slide banner logo"/>
  28.                                 </div>
  29.                             </div>
  30.                         </div>
  31.                     {% endfor %}
  32.                 </div>
  33.             </div>
  34.         </section>
  35.     {% endif %}
  36.     <!--End Main Slider-->
  37.     <!--Start Breadcrumbs-->
  38.     <div class="breadcrumb-holder">
  39.         <ol class="breadcrumb">
  40.             <li class="breadcrumb-item">
  41.                 <a href="/{{app.request.locale}}">{{'Home'|trans}}</a>
  42.             </li>
  43.             <li class="breadcrumb-item">{{'Resources'|trans}}</li>
  44.             <li class="breadcrumb-item active" aria-current="page">
  45.                 {{current_category.name}}
  46.             </li>
  47.         </ol>
  48.     </div>
  49.     <!--End Breadcrumbs-->
  50.     <!--Start Info Media-->
  51.     {% if current_category.bannerimage and current_category.name %}
  52.         <section class="training-media-box info-media res-listing-tech">
  53.             {% if current_category.name("en")  == "Business" %}
  54.                 {% for popular in most %}
  55.                     {% if popular.url == "the-future-of-the-hospitality-industry-in-saudi-arabia" %}
  56.                         <div class="container container-sm">
  57.                             <div class="info-section">
  58.                                 <h5>{{current_category.name}}</h5>
  59.                                 <h4>{{popular.name}}</h4>
  60.                                 <p class="slide-media-desktop">{{popular.main_description}}</p>
  61.                                 <p class="slide-media-mobile">{{ popular.main_description|length > 150 ? popular.main_description|slice(0, 150) ~ '...' : popular.main_description  }}
  62.                                     <div class="">
  63.                                         <a href="/{{app.request.locale}}/resource/{{popular.url}}" class="btn btn-custom btn-green">{{'Read More'|trans}}</a>
  64.                                     </div>
  65.                                 </p>
  66.                             </div>
  67.                             <div class="media-section slide-media-desktop">
  68.                                 <video
  69.                                     poster="{{popular.image}}">
  70.                                     {# <source src="{{current_category.bannervideo.data}}" type="video/mp4" /> #}
  71.                                     Your browser does not support the video tag.
  72.                                 </video>
  73.                                 {# <div class="control-options">
  74.                                                                                                                                                                                                                                                                                                                                                                                                                                                                             <i class="fas fa-play-circle"></i>
  75.                                                                                                                                                                                                                                                                                                                                                                                                                                                                             <i class="fas fa-pause-circle"></i>
  76.                                                                                                                                                                                                                                                                                                                                                                                                                                                                           </div> #}
  77.                             </div>
  78.                             <div class="media-section slide-media-mobile">
  79.                                 <video
  80.                                     poster="{{popular.image}}">
  81.                                     {# <source src="{{current_category.bannervideo.data}}" type="video/mp4" /> #}
  82.                                     Your browser does not support the video tag.
  83.                                 </video>
  84.                                 {# <div class="control-options">
  85.                                                                                                                                                                                                                                                                                                                                                                                                                                                                             <i class="fas fa-play-circle"></i>
  86.                                                                                                                                                                                                                                                                                                                                                                                                                                                                             <i class="fas fa-pause-circle"></i>
  87.                                                                                                                                                                                                                                                                                                                                                                                                                                                                           </div> #}
  88.                             </div>
  89.                         </div>
  90.                     {% endif %}
  91.                 {% endfor %}
  92.             {% elseif current_category.name("en") == "Management" %}
  93.                 {% for popular in most %}
  94.                     {% if popular.url == "waste-management-in-the-kitchen" %}
  95.                         <div class="container container-sm">
  96.                             <div class="info-section">
  97.                                 <h5>{{current_category.name}}</h5>
  98.                                 <h4>{{popular.name}}</h4>
  99.                                 <p class="slide-media-desktop">{{popular.main_description}}</p>
  100.                                 <p class="slide-media-mobile">{{ popular.main_description|length > 150 ? popular.main_description|slice(0, 150) ~ '...' : popular.main_description  }}
  101.                                     <div class="">
  102.                                         <a href="/{{app.request.locale}}/resource/{{popular.url}}" class="btn btn-custom btn-green">{{'Read More'|trans}}</a>
  103.                                     </div>
  104.                                 </p>
  105.                             </div>
  106.                             <div class="media-section slide-media-desktop">
  107.                                 <video
  108.                                     poster="{{popular.image}}">
  109.                                     {# <source src="{{current_category.bannervideo.data}}" type="video/mp4" /> #}
  110.                                     Your browser does not support the video tag.
  111.                                 </video>
  112.                                 {# <div class="control-options">
  113.                                                                                                                                                                                                                                                                                                                                                                                                                                                                             <i class="fas fa-play-circle"></i>
  114.                                                                                                                                                                                                                                                                                                                                                                                                                                                                             <i class="fas fa-pause-circle"></i>
  115.                                                                                                                                                                                                                                                                                                                                                                                                                                                                           </div> #}
  116.                             </div>
  117.                             <div class="media-section slide-media-mobile">
  118.                                 <video
  119.                                     poster="{{popular.image}}">
  120.                                     {# <source src="{{current_category.bannervideo.data}}" type="video/mp4" /> #}
  121.                                     Your browser does not support the video tag.
  122.                                 </video>
  123.                                 {# <div class="control-options">
  124.                                                                                                                                                                                                                                                                                                                                                                                                                                                                             <i class="fas fa-play-circle"></i>
  125.                                                                                                                                                                                                                                                                                                                                                                                                                                                                             <i class="fas fa-pause-circle"></i>
  126.                                                                                                                                                                                                                                                                                                                                                                                                                                                                           </div> #}
  127.                             </div>
  128.                         </div>
  129.                     {% endif %}
  130.                 {% endfor %}
  131.             {% endif %}
  132.         </section>
  133.     {% endif %}
  134.     <!--End Info Media-->
  135.     <!--Start Featured Recipes Section-->
  136.     {% if most is not empty %}
  137.         <section class="featured-recipes-section inner-frecipes-section event-detail-slider resources-center">
  138.             <div class="container container-sm">
  139.                 {% for key , popular in most %}
  140.                     {% if popular.url != "waste-management-in-the-kitchen" %}
  141.                         {% if key == 1 %}
  142.                             <h2 class="heading">{{'Most Popular'|trans}}</h2>
  143.                             {# break #}
  144.                         {% endif %}
  145.                     {% endif %}
  146.                 {% endfor %}
  147.                 <div class="featured-recipes">
  148.                     <div class="custom-slider custom-event-slider">
  149.                         {% for popular in most %}
  150.                             {% if popular.url != "waste-management-in-the-kitchen" %}
  151.                                 <div class="slide">
  152.                                     <div class="slide-holder">
  153.                                         <a href="/{{app.request.locale}}/resource/{{popular.url}}">
  154.                                             <figure class="slide-img">
  155.                                                 {% if popular.image is defined %}
  156.                                                     <img src="{{ popular.image }}" alt="{{popular.name}}">
  157.                                                     
  158.                                                 {% endif %}
  159.                                             </figure>
  160.                                         </a>
  161.                                         <div class="slide-content">
  162.                                             <div class="frecipes-box">
  163.                                                 <a href="/{{app.request.locale}}/resource/{{popular.url}}" class="text-decoration-none">
  164.                                                     <h3>{{popular.name}}</h3>
  165.                                                 </a>
  166.                                                 {% if popular.main_description is defined and popular.main_description is not null %}
  167.                                                     <p>{{popular.main_description}}</p>
  168.                                                 {% endif %}
  169.                                             </div>
  170.                                             {% set user = app.session.get('loginUserName') %}
  171.                                             {% if user is not null %}
  172.                                                 <ul class="list-unstyled recipe-info">
  173.                                                     <li class="share" onclick="loyaltyProgram(this,{{ popular.id }},'{{ popular.name }}',50,'Article','Share')">
  174.                                                         <span onclick="sharemodal('Article','{{ app.request.getSchemeAndHttpHost() ~ '/' ~ app.request.locale ~ '/resource/' ~ popular.url}}' ,'{{ "SHARE KNOWLEDGE WITH YOUR FRIENDS"|trans }}')">{{'Share'|trans}}</span>
  175.                                                     </li>
  176.                                                     {% if popular.id in Liked_most_popular_Id %}
  177.                                                         <li class='liked'>{{'Like'|trans}}</li>
  178.                                                     {% else %}
  179.                                                         <li class="like most_popular" onclick="loyaltyProgram(this,{{ popular.id }},'{{ popular.name }}',30,'Article','Like', '{{app.request.locale}}')">{{'Like'|trans}}</li>
  180.                                                     {% endif %}
  181.                                                     <li class="download-black d-none" onclick="loyaltyProgram(this,{{ popular.id }},'{{ popular.name }}',20,'Article','Save')">{{'Download'|trans}}</li>
  182.                                                 </ul>
  183.                                             {% else %}
  184.                                                 <ul class="list-unstyled recipe-info">
  185.                                                     <li class="share" onclick="sharemodal('Article','{{ app.request.getSchemeAndHttpHost() ~ '/' ~ app.request.locale ~ '/resource/' ~ popular.url}}','{{ "SHARE KNOWLEDGE WITH YOUR FRIENDS"|trans }}')">{{'Share'|trans}}</li>
  186.                                                     <li class="like logged-out">{{'Like'|trans}}</li>
  187.                                                     <li class="download-black d-none">{{'Download'|trans}}</li>
  188.                                                 </ul>
  189.                                             {% endif %}
  190.                                         </div>
  191.                                     </div>
  192.                                 </div>
  193.                             {% endif %}
  194.                         {% endfor %}
  195.                     </div>
  196.                     {# <div class="btn-border">
  197.                                                                                                                                                                                                                                                                                                     <button class="btn btn-custom btn-lg-o-black" onclick="explore()">Explore More</button>
  198.                                                                                                                                                                                                                                                                                                   </div> #}
  199.                 </div>
  200.             </div>
  201.         </section>
  202.     {% endif %}
  203.     <!--End Featured Recipes Section-->
  204.     <!--Start Product Box-->
  205.     <section class="product-result-container resources-cat">
  206.         <div class="container container-sm">
  207.             <div class="row">
  208.                 <div class="col-12 col-md-12 col-xl-3 filter-box">
  209.                     <h4 class="title">{{'Filters'|trans}}</h4>
  210.                     <div class="filder-options">
  211.                         <div class="input-holder">
  212.                             <input type="text" placeholder="{{''|trans}}" id="search" value="{{filters.query}}" class="form-control"/>
  213.                         </div>
  214.                     </div>
  215.                     <div class="filter-accordion">
  216.                         {% if categories is not empty %}
  217.                             <div class="card filter-card" id="filter1">
  218.                                 <div class="card-header">
  219.                                     <button type="button" data-toggle="collapse" data-target="#collapse1" aria-expanded="true" aria-controls="collapse1">
  220.                                         {{'Category'|trans}}
  221.                                     </button>
  222.                                 </div>
  223.                                 <div id="collapse1" class="collapse show" data-parent="#filter1">
  224.                                     <div class="card-body">
  225.                                         <ul class="list-unstyled check-list">
  226.                                             {%  for category in categories %}
  227.                                                 <li>
  228.                                                     <input class="styled-checkbox category_checkbox" id="{{category.name}}" type="checkbox" value="{{category.id}}" {{ (category.id in filters.category_ids) ? 'checked' : '' }}/>
  229.                                                     <label for="{{category.name}}">{{category.name}}</label>
  230.                                                 </li>
  231.                                             {% endfor %}
  232.                                         </ul>
  233.                                         <div class="btn-holder clear-filter">
  234.                                             <button class="btn btn-link" onclick="clearFilter('.category_checkbox')">{{'Clear Filter'|trans}}</button>
  235.                                         </div>
  236.                                     </div>
  237.                                 </div>
  238.                             </div>
  239.                         {% endif %}
  240.                         <div class="apply-filter">
  241.                             <a href="javascript:void(0)" class="btn btn-custom btn-green" onclick="searchFilter(this)">{{'Apply Filter'|trans}}</a>
  242.                         </div>
  243.                     </div>
  244.                 </div>
  245.                 <div class="col-12 col-md-12 col-xl-9 product-results">
  246.                     <h2 class="heading all-articles-heading-text">{{'All Articles'|trans}}</h2>
  247.                     <!--End Product Small Banner-->
  248.                     <div
  249.                         class="product-box-holder">
  250.                         <!--Start Featured Recipes Section-->
  251.                         <section class="featured-recipes-section inner-frecipes-section all-training-section resource-listing-grid">
  252.                             <div class="featured-recipes">
  253.                                 <div class="all-training-recip">
  254.                                     {% for resource in resources %}
  255.                                         <div class="slide">
  256.                                             <div class="slide-holder">
  257.                                                 <a href="/{{app.request.locale}}/resource/{{resource.url}}">
  258.                                                     <figure class="slide-img">
  259.                                                         <img src="{{resource.image}}" alt="{{ resource.name }}"/>
  260.                                                     </figure>
  261.                                                 </a>
  262.                                                 <div class="slide-content">
  263.                                                     <div class="frecipes-box">
  264.                                                         <a href="/{{app.request.locale}}/resource/{{resource.url}}" class="text-decoration-none">
  265.                                                             <h3>{{ resource.name }}</h3>
  266.                                                         </a>
  267.                                                         {% if resource.main_description is defined and resource.main_description is not null %}
  268.                                                             <p>{{resource.main_description|raw}}</p>
  269.                                                         {% endif %}
  270.                                                     </div>
  271.                                                     {% set user = app.session.get('loginUserName') %}
  272.                                                     {% if user is not null %}
  273.                                                         <ul class="list-unstyled recipe-info">
  274.                                                             <li class="share" onclick="loyaltyProgram(this,{{ resource.id }},'{{ resource.name }}',10,'Article','Share')">
  275.                                                                 <span onclick="sharemodal('Article','{{ app.request.getSchemeAndHttpHost() ~ '/' ~ app.request.locale ~ '/resource/' ~ resource.url}}' ,'{{ "SHARE KNOWLEDGE WITH YOUR FRIENDS"|trans }}')">{{'Share'|trans}}<span></li>
  276.                                                                     {% if resource.id in Liked_all_recource_Id %}
  277.                                                                         <li class='liked'>{{'Like'|trans}}</li>
  278.                                                                     {% else %}
  279.                                                                         <li class="like all_article" onclick="loyaltyProgram(this,{{ resource.id }},'{{ resource.name }}',10,'Article','Like', '{{app.request.locale}}')">{{'Like'|trans}}</li>
  280.                                                                     {% endif %}
  281.                                                                     <li class="download d-none" onclick="loyaltyProgram(this,{{ resource.id }},'{{ resource.name }}',10,'Article','Save')">{{'Download'|trans}}</li>
  282.                                                                 </ul>
  283.                                                             {% else %}
  284.                                                                 <ul class="list-unstyled recipe-info">
  285.                                                                     <li class="share" onclick="sharemodal('Article','{{ app.request.getSchemeAndHttpHost() ~ '/' ~ app.request.locale ~ '/resource/' ~ resource.url}}') ,'{{ "SHARE KNOWLEDGE WITH YOUR FRIENDS"|trans }}'">{{'Share'|trans}}</li>
  286.                                                                     <li class="like logged-out">{{'Like'|trans}}</li>
  287.                                                                     <li class="download d-none">{{'Download'|trans}}</li>
  288.                                                                 </ul>
  289.                                                             {% endif %}
  290.                                                         </div>
  291.                                                     </div>
  292.                                                 </div>
  293.                                             {% endfor %}
  294.                                         </div>
  295.                                     </div>
  296.                                 </section>
  297.                                 <!--End Featured Recipes Section-->
  298.                             </div>
  299.                         </div>
  300.                     </div>
  301.                 </div>
  302.             </section>
  303.             <!--End Product Box-->
  304.             <!-- Resource Listing More Topics Start-->
  305.             <section class="featured-categories resource-featured-categories">
  306.                 <div class="container container-sm">
  307.                     <div class="featured-categories-section">
  308.                         <h2 class="heading">{{'More Topics'|trans}}</h2>
  309.                         <div class="featured-categories-section-wrapper">
  310.                             {%  for topic in more_topics %}
  311.                                 <div class="featured-categories-section-wrapper-item">
  312.                                     <a href="{{topic.url}}">
  313.                                         <figure class="featured-categories-section-wrapper-item-video">
  314.                                             <div class="media-section">
  315.                                                 <video poster="{{topic.image}}" playsinline>
  316.                                                     {% if topic.video.data is defined %}
  317.                                                         <source src="{{ topic.video.data }}" type="video/mp4">
  318.                                                     {% endif %}
  319.                                                     Your browser does not support the video tag.
  320.                                                 </video>
  321.                                                 {# <div class="control-options">
  322.                                                     <i class="fas fa-play-circle"></i>
  323.                                                     <i class="fas fa-pause-circle"></i>
  324.                                                 </div> #}
  325.                                             </div>
  326.                                         </figure>
  327.                                     </a>
  328.                                     <div class="featured-categories-section-wrapper-item-content">
  329.                                         <a href="{{topic.url}}" class="featured-categories-section-wrapper-item-content-btn">
  330.                                             {{topic.name}}
  331.                                         </a>
  332.                                     </div>
  333.                                 </div>
  334.                             {% endfor %}
  335.                         </div>
  336.                     </div>
  337.                 </div>
  338.             </section>
  339.             
  340.             <script>
  341.                 function searchFilter(e) {
  342.                     let new_path = 'sub_category_id=';
  343.                     let query = '';
  344.                     let category_count = 1
  345.                     $('.category_checkbox').each(function (index, value) {
  346.                         if ($(this).is(':checked')) {
  347.                             
  348.                             if (category_count > 1) {
  349.                                 new_path += '_';
  350.                             }
  351.                             new_path += $(this).val();
  352.                             category_count++;
  353.                         }
  354.                     });
  355.                     if ($('#search').val()) {
  356.                         query = '&query=' + $('#search').val();
  357.                     }
  358.                     window.location.href = '?' + new_path + query;
  359.                 }
  360.                 function clearFilter(c) {
  361.                     $(c).each(function (index, value) {
  362.                         $(this).prop('checked', false);
  363.                     });
  364.                 }
  365.                 let page = 1;
  366.                 function loadMoreProduct() {
  367.                     let add_query = '&';
  368.                     if (!window.location.search) {
  369.                         add_query = '?';
  370.                     }
  371.                     $.ajax({
  372.                     type: "GET",
  373.                     url: window.location.href + add_query + 'page=' + page,
  374.                     data: '',
  375.                     cache: false,
  376.                     beforeSend: function () {
  377.                         $('.btn-load').css('padding-left', '50px');
  378.                         $('.btn-load').css('background-image', 'url(/static/assets/images/loader.gif)');
  379.                     },
  380.                     complete: function () {
  381.                         $('.btn-load').css('padding-left', '15px');
  382.                         $('.btn-load').css('background-image', 'inherit');
  383.                     },
  384.                     success: function (data) {
  385.                         if (data.success) {
  386.                             $('.product-box-holder .new-div').append(data.success);
  387.                             page++;
  388.                         } else if (data.success == '') {
  389.                             $('.btn-load').hide();
  390.                         }
  391.                     }
  392.                     });
  393.                 }
  394.                 //function explore() {
  395.                 //let add_query = '&';
  396.                 //if (!window.location.search) {
  397.                 //add_query = '?';
  398.                 //}
  399.                 //window.location.href = add_query + 'most=1';
  400.                 //}
  401.             </script>
  402.             {% if (app.request.locale =='ar') %}
  403.                 {% set topMenu ="/en/resources/" ~ current_category.url('en') %}
  404.             {% else %}
  405.                 {% set topMenu ="/ar/resources/" ~ current_category.url('ar') %}
  406.             {% endif %}
  407.             <script>
  408.                 var _TopMenuLink = "{{ topMenu }}";
  409.             </script>
  410.             <!-- Resource Listing More Topics End -->
  411.         {% endblock %}