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