templates/frontend/blog/articles_model_1.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block title %}  {%  for p in frontend_page %}
  3.                     {% if p.adminLink == page_admink_link %} {{p.name}}{% endif %}{% endfor %}{% endblock %}
  4. {% block css %}
  5.     <style>
  6.         .card {
  7.             border: none;
  8.             color: #fff;
  9.             border-radius: 12px
  10.         }
  11.         .user-timing {
  12.             right: 9px;
  13.             bottom: 9px;
  14.             color: #fff
  15.         }
  16.         .views-content {
  17.             color: #606271
  18.         }
  19.         .views {
  20.             font-size: 12px
  21.         }
  22.         .dots {
  23.             display: flex;
  24.             height: 10px;
  25.             width: 10px;
  26.             background-color: green;
  27.             border-radius: 50%;
  28.             margin-left: 5px;
  29.             margin-bottom: 6px
  30.         }
  31.         .days-ago {
  32.             margin-top: -10px;
  33.             color: #606271
  34.         }
  35.         .snipimage img {
  36.             height: 150px
  37.         }
  38.         .widget {
  39.             position: relative;
  40.             display: block;
  41.             margin-bottom: 30px;
  42.         }
  43.         .widget_title {
  44.             background-color: #fff;
  45.             z-index: 3;
  46.         }
  47.         .widget_title:after {
  48.             position: relative;
  49.             display: inline-block;
  50.             bottom: 35px;
  51.             left: 52%;
  52.             content: " ";
  53.             width: 50%;
  54.             border-top: 2px solid #eee;
  55.             z-index: 1;
  56.         }
  57.         .widget_black h2:after {
  58.             display: table;
  59.             position: relative;
  60.             left: 50%;
  61.             bottom: 10px;
  62.             height: 2px;
  63.             content: " ";
  64.             text-shadow: none;
  65.             width: 15%;
  66.             background-color: #000;
  67.             z-index: 2;
  68.         }
  69.         .widget i:hover {
  70.             color: #f7510f;
  71.             cursor: pointer;
  72.         }
  73.         .widget_adv {
  74.             text-align: center;
  75.             margin: 30px;
  76.         }
  77.         .widget_advertisement {
  78.             text-align: center;
  79.             margin: 30px 0;
  80.         }
  81.         .widget_body img {
  82.             float: left;
  83.             position: relative;
  84.             margin-right: 25px;
  85.         }
  86.         .widget .add_img {
  87.             display: inline-block;
  88.             padding: 12px 12px;
  89.         }
  90.         .widget .media {
  91.             margin-top: 0;
  92.             margin-bottom: 30px;
  93.         }
  94.         .widget .media-heading {
  95.             margin-bottom: 5px;
  96.             font-size: 15px;
  97.             line-height: 18px;
  98.         }
  99.         .widget .media-date {
  100.             color: #b2b0b0;
  101.         }
  102.         .widget_article_social {
  103.             color: #a5a5a5;
  104.             margin-top: 15px;
  105.         }
  106.         .widget_article_social i {
  107.             padding: 5px;
  108.             margin-right: 5px;
  109.             color: #fff;
  110.             font-size: 10px;
  111.             background-color: #a5a5a5;
  112.         }
  113.         .widget_article_social span {
  114.             margin-right: 10px;
  115.         }
  116.         .widget_article_social a {
  117.             font-weight: bold;
  118.         }
  119.         .widget_img {
  120.             text-align: center;
  121.             margin: 0 auto;
  122.         }
  123.         .widget .adv_img {
  124.             display: inline-block;
  125.         }
  126.         .widget_body .btn {
  127.             border-radius: 0;
  128.         }
  129.         .widget hr {
  130.             border-color: #e0e0e0;
  131.         }
  132.         .widget-title hr {
  133.             border-width: 4px;
  134.             margin-bottom: 0;
  135.         }
  136.         .widget-title hr:before {
  137.             width: 80px;
  138.             background-color: #ddd;
  139.             display: block;
  140.             height: 4px;
  141.             position: relative;
  142.             content: "";
  143.             top: -4px;
  144.         }
  145.         .widget_divider {
  146.             display: inline-block;
  147.             vertical-align: baseline;
  148.             zoom: 1;
  149.             width: 98%;
  150.             position: relative;
  151.             text-align: right;
  152.             text-transform: uppercase;
  153.             font-size: 11px;
  154.         }
  155.         .widget_divider::after {
  156.             content: '';
  157.             display: block;
  158.             width: 75%;
  159.             left: 0;
  160.             text-align: right;
  161.             position: absolute;
  162.             top: 12px;
  163.             border-top: 1px solid #f1f1f1;
  164.         }
  165.         .media-body, .media-left, .media-right{
  166.             display: table-cell;
  167.             vertical-align: top;
  168.         }
  169.         .media-left, .media > .pull-left{
  170.             padding-right: 10px;
  171.         }
  172.         .media-body{
  173.         }
  174.         .padded {
  175.             padding: 100px 0;
  176.         }
  177.         .wrapper-grey {
  178.             background: #F4F4F4;
  179.         }
  180.         .avatar {
  181.             width: 30px;
  182.             border-radius: 50%;
  183.         }
  184.         .avatar-bordered {
  185.             box-shadow: 0 1px 2px rgba(0,0,0,0.2);
  186.             border: white 1px solid;
  187.         }
  188.         .avatar-large {
  189.             width: 50px;
  190.         }
  191.         /* .banner {
  192.           color: white;
  193.           text-align: center;
  194.           height: 100vh;
  195.           background-size: cover !important;
  196.           display: flex;
  197.           align-items: center;
  198.           justify-content: center;
  199.         }
  200.         .banner h1 {
  201.           font-size: 50px;
  202.           font-weight: bold;
  203.           text-shadow: 0px 1px rgba(0, 0, 0, 0.2);
  204.         }
  205.         .banner p {
  206.           font-size: 25px;
  207.           font-weight: lighter;
  208.           color: rgba(255, 255, 255, 0.8);
  209.           margin-bottom: 50px;
  210.         } */
  211.         .card {
  212.             height: 250px;
  213.             text-shadow: 0 1px 3px rgba(0,0,0,0.6);
  214.             background-size: cover !important;
  215.             color: white;
  216.             position: relative;
  217.             border-radius: 5px;
  218.             margin-bottom: 20px;
  219.         }
  220.         .card-user {
  221.             position: absolute;
  222.             right: 10px;
  223.             top: 10px;
  224.         }
  225.         .card-category {
  226.             position: absolute;
  227.             top: 10px;
  228.             left: 10px;
  229.             font-size: 20px;
  230.         }
  231.         .card-description {
  232.             position: absolute;
  233.             bottom: 10px;
  234.             left: 10px;
  235.         }
  236.         .card-description h2 {
  237.             font-size: 22px;
  238.         }
  239.         .card-description p {
  240.             font-size: 15px;
  241.         }
  242.         .card-link {
  243.             position: absolute;
  244.             top: 0;
  245.             bottom: 0;
  246.             width: 100%;
  247.             z-index:2;
  248.             background: black;
  249.             opacity: 0;
  250.         }
  251.         .card-link:hover{
  252.             opacity: 0.1;
  253.         }
  254.         .features img {
  255.             width: 100px;
  256.         }
  257.         .features h2 {
  258.             font-size: 20px;
  259.             margin-bottom: 10px;
  260.         }
  261.         .features p {
  262.             font-size: 15px;
  263.             font-weight: lighter;
  264.         }
  265.     </style>
  266. {% endblock %}
  267. {% block body %}
  268.     <div class=" d-flex flex-column flex-row-fluid">
  269.         <div class="card-body row ">
  270.             {%  for p in frontend_page %}
  271.                 {% if p.adminLink == page_admink_link %}
  272.                     <a href="{{ path('app_show_frontend_page',{'slug':p.slug}) }}"><h1 style="font-weight: bolder;font-size: 38px;margin-bottom: 15px" class="bold text-left text-primary">{{ p.name }}
  273.                             <em class="fs-5"> >>
  274.                                 {% for cat in categories %}
  275.                                     {% if cat.id == cat_current %}
  276.                                         {{ cat.name }}
  277.                                     {% endif %}
  278.                                 {% endfor %}
  279.                             </em>
  280.                     </h1>
  281.                     </a>
  282.                 {% endif %}
  283.             {% endfor %}
  284.             <div class="container-fluid categorie-div" style="margin-top: 18px;background: #f3f3f3" >
  285.                 <div class="d-flex align-items-center" style="width: 100%">
  286.                     <div class="flex-shrink-0">
  287.                         <a href="#" class="btn-left btn-link p-2 toggle3 text-dark"><i class="bi bi-caret-left"></i></a>
  288.                     </div>
  289.                     <div class="flex-grow-1  o-hidden">
  290.                         <ul class="nav nav-blog nav-fill small position-relative flex-nowrap div-ul-link">
  291.                             {%  for cat in categories %}
  292.                                 <li class="nav-item">
  293.                                     <a href="{{ path('app_show_category_articles',{'slug':cat.slug})  }}" class="header-nav-link" style="">{{ cat.name }}</a>
  294.                                 </li>
  295.                             {% endfor %}
  296.                         </ul>
  297.                     </div>
  298.                     <div class="flex-shrink-0">
  299.                         <a href="#" class="btn-right btn-link toggle3 p-2 text-dark"><i class="bi bi-caret-right"></i></a>
  300.                     </div>
  301.                 </div>
  302.             </div>
  303.             <div class="separator" style="border-width: 5px"></div>
  304.             <div class="container mt-4">
  305.                 <div class=" p-3 row">
  306.                     <div class="col-lg-8">
  307.                         {% for a in articles_to_display %}
  308.                             {% if a.image_cover is not defined %}
  309.                                 <div class="row mb-8">
  310.                                     <div class="col-md-3 col-lg-3 col-sm-12">
  311.                                         <div class="position-relative snipimage">
  312.                                             <a href="{{ path('blog_show_article',{'slug':a.slug}) }}">
  313.                                                 {% if a.imageCoverMini != '' %}
  314.                                                     <img style="object-fit: cover;width: 300px;" src="{{ asset('uploads/'~a.imageCoverMini) }}" class=" img-fluid  img-responsive">
  315.                                                 {% else %}
  316.                                                     {% if a.imageCover != '' %}
  317.                                                         <img style="object-fit: cover;width: 300px;" src="{{ asset('uploads/'~a.imageCover) }}" class=" img-fluid  img-responsive">
  318.                                                     {% else %}
  319.                                                         <img style="object-fit: cover;width: 300px" src="{{ asset('assets/media/avatars/blank.png') }}" class=" img-fluid img-responsive">
  320.                                                     {% endif %}
  321.                                                 {% endif %}
  322.                                             </a>
  323.                                         </div>
  324.                                     </div>
  325.                                     <div class="col-md-9 col-lg-9 col-sm-12">
  326.                                         <div class="mt-2">
  327.                                             <div class="d-flex justify-content-between align-items-center">
  328.                                                 <a href="{{ path('blog_show_article',{'slug':a.slug}) }}"><h5 class="mb-1">{{ a.title}} </h5></a>
  329.                                             </div>
  330.                                             <div class="d-flex justify-content-md-start justify-content-between views-content mt-2">
  331.                                                 <a href="{{ path('blog_show_article',{'slug':a.slug}) }}">
  332.                                                     {{ a.content|striptags|u.truncate(200, '...')|raw  }}
  333.                                                 </a>
  334.                                             </div>
  335.                                             <div class="d-flex align-items-center mb-2">
  336.                                                 <div class="ms-3">
  337.                                                     {% if a.user is defined and a.user is not null %} <a href="{{ path('app_show_article_redactor',{'id':a.user.profile~'-'~a.user.id}) }}" class="fs-5 fw-bolder text-gray-900 text-hover-primary me-1 ">{{ a.user.surname}} {{ a.user.name}}</a>  {% endif %}
  338.                                                     <span class="text-muted fs-7 mb-1"><span class="bi bi-clock"></span> {{ a.date|date('Y-m-d') }}</span>
  339.                                                 </div>
  340.                                             </div>
  341.                                         </div>
  342.                                     </div>
  343.                                 </div>
  344.                             {% else %}
  345.                                 <div class="row mb-8" style="background-color: #f7f7f7">
  346.                                     <div class="col-md-3 col-lg-3 col-sm-12">
  347.                                         <div class="position-relative snipimage">
  348.                                             <a target="_blank" href="{{ educati_article_show~a.slug }}">
  349.                                                 <img style="object-fit: cover;width: 300px;" src="{{ educati_uploads_dir }}{{ a.image_cover }}" class=" img-fluid  img-responsive">
  350.                                             </a>
  351.                                         </div>
  352.                                     </div>
  353.                                     <div class="col-md-9 col-lg-9 col-sm-12">
  354.                                         <div class="mt-2">
  355.                                             <div class="d-flex justify-content-between align-items-center">
  356.                                                 <a target="_blank" href="{{ educati_article_show~a.slug }}"><h5 class="mb-1">{{ a.title}} </h5></a>
  357.                                             </div>
  358.                                             <div class="d-flex justify-content-md-start justify-content-between views-content mt-2">
  359.                                                 <a target="_blank" href="{{ educati_article_show~a.slug }}">
  360.                                                     {{ a.content|striptags|u.truncate(200, '...')|raw  }}
  361.                                                 </a>
  362.                                             </div>
  363.                                             <div class="d-flex align-items-center mb-2">
  364.                                                 <div class="ms-3">
  365.                                                     <span class="text-muted fs-7 mb-1"><span class="bi bi-clock"></span> {{ a.date|date('Y-m-d') }}</span>
  366.                                                 </div>
  367.                                             </div>
  368.                                         </div>
  369.                                     </div>
  370.                                 </div>
  371.                             {% endif %}
  372.                             <div class="separator" style="margin-bottom: 20px; height: 4px"></div>
  373.                         {% endfor %}
  374.                         {{ knp_pagination_render(articles) }}
  375.                     </div>
  376.                     {% if school_global.display_educati_news %}
  377.                     <div class="col-lg-4 col-md-4 col-sm-12">
  378.                             {% include 'frontend/blog/ads_list.html.twig' %}
  379.                     </div>
  380.                     {% endif %}
  381.                 </div>
  382.             </div>
  383.             {{ knp_pagination_render(articles) }}
  384.         </div>
  385.     </div>
  386. {% endblock %}
  387.  {% block js %}
  388.      <script src="{{ asset('assets/plugins/custom/ckeditor/ckeditor-classic.bundle.js') }}"></script>
  389.      <script id="templateAds" type="text/html">
  390.          <div class="col-md-12">
  391.              <div class="card" style="max-height: 220px; background: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.2)), url('{{ educati_uploads_dir }}[[image]]');">
  392.                  <div class="card-category" style="text-shadow: 1px 1px 2px #7f3e98, 0 0 1em #7f3e98, 0 0 0.2em #7f3e98;">[[title]]</div>
  393.                  <div class="card-description">
  394.                      <p style="text-shadow: 1px 1px 2px #7f3e98, 0 0 1em #7f3e98, 0 0 0.2em #7f3e98;">[[content]]</p>
  395.                  </div>
  396.                  <a target="_blank" class="card-link" href="[[link]]" ></a>
  397.              </div>
  398.          </div>
  399.      </script>
  400.      <script>
  401.          $.ajax({
  402.              url: "{{educati_ads_list}}"+"10/0?lang="+getCookie('lang'),
  403.              type: 'GET',
  404.              dataType: 'json',
  405.              success: function(res){
  406.                  let templateRep = document.getElementById("templateAds");
  407.                  let templateRepHtml = templateRep.innerHTML;
  408.                  let listHtml = "";
  409.                  res.data.forEach(function (e){
  410.                      let link = "{{educati_ads_show}}";
  411.                      link = link+e.slug;
  412.                      listHtml += templateRepHtml
  413.                          .replace("[[image]]",e.image)
  414.                          .replace("[[link]]",link)
  415.                          .replace("[[title]]",e.title)
  416.                          .replace("[[content]]",e.description);
  417.                  });
  418.                  $('#ads_list').html(listHtml);
  419.              },
  420.              error :function (error) {
  421.                  console.log(error);
  422.              }
  423.          });
  424.      </script>
  425.      <script>
  426.          $('.toggle3').click(function(){
  427.              $('.nav-blog').toggleClass("justify-content-end");
  428.              $('.toggle3').toggleClass("text-light");
  429.          });
  430.      </script>
  431.  {% endblock %}