{% extends 'base.html.twig' %}
{% block title %} {% for p in frontend_page %}
{% if p.adminLink == page_admink_link %} {{p.name}}{% endif %}{% endfor %}{% endblock %}
{% block css %}
<style>
.card {
border: none;
color: #fff;
border-radius: 12px
}
.user-timing {
right: 9px;
bottom: 9px;
color: #fff
}
.views-content {
color: #606271
}
.views {
font-size: 12px
}
.dots {
display: flex;
height: 10px;
width: 10px;
background-color: green;
border-radius: 50%;
margin-left: 5px;
margin-bottom: 6px
}
.dot {
height: 6px;
width: 6px;
margin-left: 3px;
margin-right: 3px;
margin-top: 2px !important;
background-color: {% if first_color != ''%}{{first_color}}{% else %}#7f3e98{% endif %};
border-radius: 50%;
display: inline-block
}
.days-ago {
margin-top: -10px;
color: #606271
}
.snipimage img {
height: 150px
}
.widget {
position: relative;
display: block;
margin-bottom: 30px;
}
.widget_title {
background-color: #fff;
z-index: 3;
}
.widget_title:after {
position: relative;
display: inline-block;
bottom: 35px;
left: 52%;
content: " ";
width: 50%;
border-top: 2px solid #eee;
z-index: 1;
}
.widget_black h2:after {
display: table;
position: relative;
left: 50%;
bottom: 10px;
height: 2px;
content: " ";
text-shadow: none;
width: 15%;
background-color: #000;
z-index: 2;
}
.widget i:hover {
color: #f7510f;
cursor: pointer;
}
.widget_adv {
text-align: center;
margin: 30px;
}
.widget_advertisement {
text-align: center;
margin: 30px 0;
}
.widget_body img {
float: left;
position: relative;
margin-right: 25px;
}
.widget .add_img {
display: inline-block;
padding: 12px 12px;
}
.widget .media {
margin-top: 0;
margin-bottom: 30px;
}
.widget .media-heading {
margin-bottom: 5px;
font-size: 15px;
line-height: 18px;
}
.widget .media-date {
color: #b2b0b0;
}
.widget_article_social {
color: #a5a5a5;
margin-top: 15px;
}
.widget_article_social i {
padding: 5px;
margin-right: 5px;
color: #fff;
font-size: 10px;
background-color: #a5a5a5;
}
.widget_article_social span {
margin-right: 10px;
}
.widget_article_social a {
font-weight: bold;
}
.widget_img {
text-align: center;
margin: 0 auto;
}
.widget .adv_img {
display: inline-block;
}
.widget_body .btn {
border-radius: 0;
}
.widget hr {
border-color: #e0e0e0;
}
.widget-title hr {
border-width: 4px;
margin-bottom: 0;
}
.widget-title hr:before {
width: 80px;
background-color: #ddd;
display: block;
height: 4px;
position: relative;
content: "";
top: -4px;
}
.widget_divider {
display: inline-block;
vertical-align: baseline;
zoom: 1;
width: 98%;
position: relative;
text-align: right;
text-transform: uppercase;
font-size: 11px;
}
.widget_divider::after {
content: '';
display: block;
width: 75%;
left: 0;
text-align: right;
position: absolute;
top: 12px;
border-top: 1px solid #f1f1f1;
}
.media-body, .media-left, .media-right{
display: table-cell;
vertical-align: top;
}
.media-left, .media > .pull-left{
padding-right: 10px;
}
.media-body{
}
marquee p {
display: contents;
}
.padded {
padding: 100px 0;
}
.wrapper-grey {
background: #F4F4F4;
}
.avatar {
width: 30px;
border-radius: 50%;
}
.avatar-bordered {
box-shadow: 0 1px 2px rgba(0,0,0,0.2);
border: white 1px solid;
}
.avatar-large {
width: 50px;
}
/* .banner {
color: white;
text-align: center;
height: 100vh;
background-size: cover !important;
display: flex;
align-items: center;
justify-content: center;
}
.banner h1 {
font-size: 50px;
font-weight: bold;
text-shadow: 0px 1px rgba(0, 0, 0, 0.2);
}
.banner p {
font-size: 25px;
font-weight: lighter;
color: rgba(255, 255, 255, 0.8);
margin-bottom: 50px;
} */
.card {
height: 250px;
text-shadow: 0 1px 3px rgba(0,0,0,0.6);
background-size: cover !important;
color: white;
position: relative;
border-radius: 5px;
margin-bottom: 20px;
}
.card-user {
position: absolute;
right: 10px;
top: 10px;
}
.card-category {
position: absolute;
top: 10px;
left: 10px;
font-size: 20px;
}
.card-description {
position: absolute;
bottom: 10px;
left: 10px;
}
.card-description h2 {
font-size: 22px;
}
.card-description p {
font-size: 15px;
}
.card-link {
position: absolute;
top: 0;
bottom: 0;
width: 100%;
z-index:2;
background: black;
opacity: 0;
}
.card-link:hover{
opacity: 0.1;
}
.features img {
width: 100px;
}
.features h2 {
font-size: 20px;
margin-bottom: 10px;
}
.features p {
font-size: 15px;
font-weight: lighter;
}
</style>
{% endblock %}
{% block body %}
<div class=" d-flex flex-column flex-row-fluid" style="">
<div class="card-body row ">
{% for p in frontend_page %}
{% if p.adminLink == page_admink_link %}
<h1 style="font-weight: bolder;font-size: 38px;margin-bottom: 5px" class="bold text-left text-primary">{{ p.name }}</h1>
{% endif %}
{% endfor %}
{% if school_notifs|length >0 or educati_notifs|length>0 %}
<div class="">
<div class="row">
<div class="col-md-12">
<div class="d-flex justify-content-between align-items-center breaking-news " style="
border-bottom-style: solid;border-bottom-color: {% if first_color != ''%}{{first_color}}{% else %}#7f3e98{% endif %}24!important;border-bottom-width: 2px;
">
<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();">
{% if school_notifs|length >0 %}
{% for no in school_notifs %}
{% if no.startAt is not null %}
{% if date_now >= no.startAt %}
{% if no.expiredAt is not null %}
{% if no.expiredAt >= date_now %}
{{ no.content|raw}} <i class="dot" style="margin-right: 40px"></i>
{% endif %}
{% else %}
{{ no.content|raw}} <i class="dot" style="margin-right: 40px"></i>
{% endif %}
{% endif %}
{% else %}
{% if no.expiredAt is not null %}
{% if no.expiredAt >= date_now %}
{{ no.content|raw}} <i class="dot" style="margin-right: 10px"></i>
{% endif %}
{% else %}
{{ no.content|raw}} <i class="dot" style="margin-right: 10px"></i>
{% endif %}
{% endif %}
{% endfor %}
{% endif %}
{% for n in educati_notifs %}
<span>{{ n.content|raw }}</span><i class="dot" style="margin-right: 10px"></i>
{% endfor %}
</marquee>
</div>
</div>
</div>
</div>
{% endif %}
<div class="container-fluid categorie-div" style="margin-top: 18px;background: #f3f3f3;">
<div class="d-flex align-items-center" style="width: 100%">
<div class="flex-shrink-0">
<a href="#" class="btn-left btn-link p-2 toggle3 text-dark"><i class="bi bi-caret-left"></i></a>
</div>
<div class="flex-grow-1 o-hidden">
<ul class="nav nav-blog nav-fill small position-relative flex-nowrap div-ul-link">
{% for cat in categories %}
<li class="nav-item">
<a href="{{ path('app_show_category_articles',{'slug':cat.slug}) }}" class="header-nav-link" style="">{{ cat.name }}</a>
</li>
{% endfor %}
</ul>
</div>
<div class="flex-shrink-0">
<a href="#" class="btn-right btn-link toggle3 p-2 text-dark"><i class="bi bi-caret-right"></i></a>
</div>
</div>
</div>
<div class="separator" style="border-width: 5px"></div>
<div class="container mt-4">
<div class=" p-3 row">
<div class="col-lg-8">
{% for a in articles_to_display %}
{% if a.image_cover is not defined %}
<div class="row mb-8">
<div class="col-md-3 col-lg-3 col-sm-12">
<div class="position-relative snipimage">
<a href="{{ path('blog_show_article',{'slug':a.slug}) }}">
{% if a.imageCoverMini != '' %}
<img style="object-fit: cover;width: 300px;" src="{{ asset('uploads/'~a.imageCoverMini) }}" class=" img-fluid img-responsive">
{% else %}
{% if a.imageCover != '' %}
<img style="object-fit: cover;width: 300px;" src="{{ asset('uploads/'~a.imageCover) }}" class=" img-fluid img-responsive">
{% else %}
<img style="object-fit: cover;width: 300px" src="{{ asset('assets/media/avatars/blank.png') }}" class=" img-fluid img-responsive">
{% endif %}
{% endif %}
</a>
</div>
</div>
<div class="col-md-9 col-lg-9 col-sm-12">
<div class="mt-2">
<div class="d-flex justify-content-between align-items-center">
<a href="{{ path('blog_show_article',{'slug':a.slug}) }}"><h5 class="mb-1">{{ a.title}} </h5></a>
</div>
<div class="fs-13 mb-2" style="color: #7a7a7a">
<span class="mr-2 badge badge-primary">{{ a.category.name }} </span>
</div>
<div class="d-flex justify-content-md-start justify-content-between views-content mt-2">
<a href="{{ path('blog_show_article',{'slug':a.slug}) }}">
{{ a.content|striptags|u.truncate(200, '...')|raw }}
</a>
</div>
<div class="d-flex align-items-center mb-2">
<div class="ms-3">
{% 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 %}
<span class="text-muted fs-7 mb-1"><span class="bi bi-clock"></span> {{ a.date|date('Y-m-d') }}</span>
</div>
</div>
</div>
</div>
</div>
{% else %}
<div class="row mb-8" style="background-color: #f7f7f7">
<div class="col-md-3 col-lg-3 col-sm-12">
<div class="position-relative snipimage">
<a target="_blank" href="{{ educati_article_show~a.slug }}">
<img style="object-fit: cover;width: 300px;" src="{{ educati_uploads_dir }}{{ a.image_cover }}" class=" img-fluid img-responsive">
</a>
</div>
</div>
<div class="col-md-9 col-lg-9 col-sm-12">
<div class="mt-2">
<div class="d-flex justify-content-between align-items-center">
<a target="_blank" href="{{ educati_article_show~a.slug }}"><h5 class="mb-1">{{ a.title}} </h5></a>
</div>
<div class="fs-13 mb-2" style="color: #7a7a7a">
<span class="mr-2 badge badge-primary">{{ a.category.name }} </span>
</div>
<div class="d-flex justify-content-md-start justify-content-between views-content mt-2">
<a target="_blank" href="{{ educati_article_show~a.slug }}">
{{ a.content|striptags|u.truncate(200, '...')|raw }}
</a>
</div>
<div class="d-flex align-items-center mb-2">
<div class="ms-3">
<span class="text-muted fs-7 mb-1"><span class="bi bi-clock"></span> {{ a.date|date('Y-m-d') }}</span>
</div>
</div>
</div>
</div>
</div>
{% endif %}
<div class="separator" style="margin-bottom: 20px; height: 4px"></div>
{% endfor %}
{{ knp_pagination_render(articles) }}
</div>
{% if school_global.display_educati_news %}
<div class="col-lg-4 col-md-4 col-sm-12">
{% include 'frontend/blog/ads_list.html.twig' %}
</div>
{% endif %}
</div>
</div>
</div>
</div>
{% endblock %}
{% block js %}
<script src="{{ asset('assets/plugins/custom/ckeditor/ckeditor-classic.bundle.js') }}"></script>
<script id="templateAds" type="text/html">
<div class="col-md-12">
<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]]');">
<div class="card-category" style="text-shadow: 1px 1px 2px #7f3e98, 0 0 1em #7f3e98, 0 0 0.2em #7f3e98;">[[title]]</div>
<div class="card-description">
<p style="text-shadow: 1px 1px 2px #7f3e98, 0 0 1em #7f3e98, 0 0 0.2em #7f3e98;">[[content]]</p>
</div>
<a target="_blank" class="card-link" href="[[link]]" ></a>
</div>
</div>
</script>
<script>
$.ajax({
url: "{{educati_ads_list}}"+"10/0?lang="+getCookie('lang'),
type: 'GET',
dataType: 'json',
success: function(res){
let templateRep = document.getElementById("templateAds");
let templateRepHtml = templateRep.innerHTML;
let listHtml = "";
res.data.forEach(function (e){
let link = "{{educati_ads_show}}";
link = link+e.slug;
listHtml += templateRepHtml
.replace("[[image]]",e.image)
.replace("[[link]]",link)
.replace("[[title]]",e.title)
.replace("[[content]]",e.description);
});
$('#ads_list').html(listHtml);
},
error :function (error) {
console.log(error);
}
});
</script>
<script>
$('.toggle3').click(function(){
$('.nav-blog').toggleClass("justify-content-end");
$('.toggle3').toggleClass("text-light");
});
</script>
{% endblock %}