templates/themesWebsite/blog_cvs/articles/list.html.twig line 1

Open in your IDE?
  1. {% extends 'themesWebsite/blog_cvs/base.html.twig' %}
  2. {% block title %}{{ page.shortTitle }}{% endblock title %}
  3. {% block description %}{{ page.shortDescription }}{% endblock description %}
  4. {% block robots %}{{ page.robots }}{% endblock robots %}
  5. {% block meta_social %}
  6.     {{ parent() }}
  7.     {% include "/themesWebsite/blog_cpn/components/socialmedia.html.twig" with { 'page':page,'social_type':'website' } %}
  8. {% endblock meta_social %}
  9. {% block body %}
  10.     <section class="bg-cover primary-bg-dark" style="background:url(assets/img/bg2.png)no-repeat; margin-top:72px;">
  11.         <div class="container">
  12.             <div class="row">
  13.                 <div class="col-lg-12 col-md-12">
  14.                     <h2 class="ipt-title text-light">{{ page.title|raw }}</h2>
  15.                     {% if page.description is not null %}<span class="ipn-subtitle text-light opacity-75">{{ page.description|raw }}<</span>{% endif %}
  16.                 </div>
  17.             </div>
  18.         </div>
  19.     </section>
  20.     <section class="gray-simple">
  21.         <div class="container">
  22.             <div class="row gx-4 gy-4">
  23.                 {% for article in pagination %}
  24.                 <div class="col-xl-4 col-lg-4 col-md-12 col-sm-12">
  25.                     <div class="jobstock-grid-blog">
  26.                         <div class="jobstock-grid-blog-thumb">
  27.                             {% if article.image.name is not null %}
  28.                                 <img class="img-fluid" src="{{ vich_uploader_asset(article, 'imageFile')|imagine_filter('articles_preview2') }}" alt="{{ article.title }}" loading="lazy" />
  29.                             {% else %}
  30.                                 <img class="img-fluid" src="/uploads/no_data.png" loading="lazy" alt="{{ article.title }}" />
  31.                             {% endif %}
  32.                         </div>
  33.                         <div class="jobstock-grid-blog-body">
  34.                             <div class="jobstock-grid-body-header">
  35.                                 <div class="jobstock-grid-posted"><span>26 Feb 2023</span></div>
  36.                                 <div class="jobstock-grid-title">
  37.                                     <h4>
  38.                                         {% if article.type == "article" %}
  39.                                             <a href="{{ path('blog_article',{'slug': article.slug}) }}">{{ article.title }}</a>
  40.                                         {% elseif article.type == "fiche" %}
  41.                                             <a href="{{ article.url }}">{{ article.title }}</a>
  42.                                         {% endif %}
  43.                                     </h4>
  44.                                 </div>
  45.                             </div>
  46.                             <div class="jobstock-grid-body-middle">
  47.                                 {% if article.subtitle is not empty %}<p>{{ article.subtitle }}</p>{% endif %}
  48.                             </div>
  49.                             <div class="jobstock-grid-body-footer">
  50.                                 {% if article.type == "article" %}<a href="{{ path('blog_article',{'slug': article.slug}) }}" class="btn btn-blog-link">Lecture</a>
  51.                                 {% elseif article.type == "fiche" %}<a href="{{ article.url }}" class="btn btn-blog-link">Lecture</a>{% endif %}
  52.                             </div>
  53.                         </div>
  54.                     </div>
  55.                 </div>
  56.                 {% endfor %}
  57.             </div>
  58.             {{ knp_pagination_render(pagination,'components/pagination/pagination.html.twig') }}
  59.         </div>
  60.     </section>
  61.     {% if blocks is not empty %}
  62.         {% for block in blocks %}
  63.             {% if is_granted("ROLE_SUPER_ADMIN") %}<div id='block_{{ block.id }}'>{% endif %}
  64.             {% if (block.onlyVisitor == true) and (block.visibilityUser == false)  and app.user is null %}
  65.                 {# VISITEUR #}
  66.                 {% include "/themesWebsite/blog_cvs/components/pages/collections.html.twig" with {'block':block,'newsletter':formNewsletter,'contact':form} %}
  67.             {% elseif (block.onlyVisitor == false) and (block.visibilityUser == true)  and app.user is not null %}
  68.                 {#  CONNECTE #}
  69.                 {% include "/themesWebsite/blog_cvs/components/pages/collections.html.twig" with {'block':block,'newsletter':formNewsletter,'contact':form} %}
  70.             {% elseif (block.onlyVisitor is null) and (block.visibilityUser is null) %}
  71.                 {#  VISITEUR + CONNECTE #}
  72.                 {% include "/themesWebsite/blog_cvs/components/pages/collections.html.twig" with {'block':block,'newsletter':formNewsletter,'contact':form} %}
  73.             {% endif %}
  74.             {% if is_granted("ROLE_SUPER_ADMIN") %}</div>{% endif %}
  75.             {% if is_granted("ROLE_SUPER_ADMIN") %}
  76.                 {% if (block.onlyVisitor == true) and (block.visibilityUser == false)  and app.user is null %}
  77.                     {# VISITEUR #}
  78.                     {% include "/themesWebsite/blog_cvs/components/pages/block_superadmin.html.twig" with {'block':block,'page':page} %}
  79.                 {% elseif (block.onlyVisitor == false) and (block.visibilityUser == true)  and app.user is not null %}
  80.                     {#  CONNECTE #}
  81.                     {% include "/themesWebsite/blog_cvs/components/pages/block_superadmin.html.twig" with {'block':block,'page':page} %}
  82.                 {% elseif (block.onlyVisitor is null) and (block.visibilityUser is null) %}
  83.                     {#  VISITEUR + CONNECTE #}
  84.                     {% include "/themesWebsite/blog_cvs/components/pages/block_superadmin.html.twig" with {'block':block,'page':page} %}
  85.                 {% endif %}
  86.             {% endif %}
  87.         {% endfor %}
  88.     {% endif %}
  89.     <div id="show_modal"></div>
  90. {% endblock body %}
  91. {% block footer_js %}
  92.     {% if is_granted("ROLE_SUPER_ADMIN") %}
  93.         <script>
  94.             function displayEdit(state) {
  95.                 $(".edit-spm").each(function(i) {
  96.                     $(this).css('display',state)
  97.                 });
  98.                 $(".edit-spmd").each(function(i) {
  99.                     $(this).css('display',state)
  100.                 });
  101.                 $(".edit-spmc").each(function(i) {
  102.                     $(this).css('display',state)
  103.                 });
  104.                 $(".edit-spmh").each(function(i) {
  105.                     $(this).css('display',state)
  106.                 });
  107.             }
  108.             var isCtrl = false;$(document).keyup(function (e) {
  109.                 if(e.which == 17) isCtrl=false;
  110.             }).keydown(function (e) {
  111.                 if(e.which == 17) isCtrl=true;
  112.                 if(e.which == 66 && isCtrl == true) {
  113.                     var editDisplay = $("#spm").attr('editspm');
  114.                     if(editDisplay == "1") {
  115.                         displayEdit("none");
  116.                         $("#spm").attr('editspm','0');
  117.                     } else {
  118.                         displayEdit("block");
  119.                         $("#spm").attr('editspm','1');
  120.                     }
  121.                     return false;
  122.                 }
  123.             });
  124.             $('.edit-spm').click(function (data) {
  125.                 $.get(Routing.generate('bo_pageshasblocks_components_edit_cover',{'page':$(this).attr('page'),'id':$(this).attr('item')})).done(function(data2) {
  126.                     $("#show_modal").html(data2);
  127.                     $("#modaldisplay").modal('show');
  128.                 });
  129.             });
  130.             $('.edit-spmd').click(function (data) {
  131.                 $.get(Routing.generate('bo_pageshasblocks_components_edit_classic',{'page':$(this).attr('page'),'id':$(this).attr('item')})).done(function(data2) {
  132.                     $("#show_modal").html(data2);
  133.                     $("#modaldisplay").modal('show');
  134.                 });
  135.             });
  136.             $('.edit-spmh').click(function (data) {
  137.                 $.get(Routing.generate('bo_pageshasblocks_components_edit_html',{'page':$(this).attr('page'),'id':$(this).attr('item')})).done(function(data2) {
  138.                     $("#show_modal").html(data2);
  139.                     $("#modaldisplay").modal('show');
  140.                 });
  141.             });
  142.             $('.edit-spmc').click(function (data) {
  143.                 $.get(Routing.generate('bo_pageshasblocks_components_edit_custom',{'page':$(this).attr('page'),'id':$(this).attr('item')})).done(function(data2) {
  144.                     $("#show_modal").html(data2);
  145.                     $("#modaldisplay").modal('show');
  146.                 });
  147.             });
  148.         </script>
  149.     {% endif %}
  150. {% endblock footer_js %}