{% extends 'base.html.twig' %}
{% block metaTitle %}{{ blog.titel }} - {{ parent() }}{% endblock %}
{% block body %}
{% include('/user/firma/_firmenfarben.html.twig') %}
<script src="{{ asset('/vendor/slick/slick.min.js') }}"></script>
<link rel="stylesheet" href="{{ asset('/vendor/slick/slick.css') }}"/>
<link rel="stylesheet" href="{{ asset('/vendor/slick/slick-theme.css') }}"/>
<div class="page-title-overlap pt-4 hintergrundfarbe schriftfarbe">
<div class="container d-lg-flex justify-content-between py-2 py-lg-3">
<div class="order-lg-2 mb-3 mb-lg-0 pt-lg-2">
<div class="small d-flex text-center text-lg-end flex-lg-nowrap justify-content-center justify-content-lg-start schriftfarbe">
<a class="me-2" href="{{ path('user_start') }}"><span class="schriftfarbe">Home</span></a> >
<span class="mx-2">Blog</span>
</div>
</div>
<div class="order-lg-1 pe-lg-4 text-center text-lg-start">
<h3 class="schriftfarbe mb-0">{{ blog.titel }}</h3>
<a href="javascript:history.back()"><h5 class="schriftfarbe mb-0 mt-3"><i class="mdi mdi-arrow-left-bold me-2">Zurück</i></h5></a>
</div>
</div>
</div>
<!-- Page Title-->
<section class="container mb-3 pb-3">
<div class="bg-light shadow-lg rounded-3 overflow-hidden">
{% if blog.aktiv == 0 %}
<div class="d-flex flex-wrap align-items-center bg-danger justify-content-center pt-3">
<h3 class="text-white">Blog noch nicht aktiviert</h3>
</div>
{% endif %}
<div class="col-12" id="user-dateien-geöffnet">
<div class="card border-0">
<div class="card-body">
<div class="row justify-content-center mt-md-2 mx-lg-3">
<div class="col-lg-12 mt-0">
<div class="text-center mb-1">
<h1>{{ blog.titel }}</h1>
</div>
{% if blog.anhang is defined and blog.anhang|length != 1 %}
<div class="text-center d-none d-sm-block">
<img class="rounded" id="bild-gross" src="{{ asset('/uploads/blogs/' ~ blog.firma.id ~ '/titelbild/' ~ blog.id ~ '/' ~ blog.titelbild) }}"
style="max-height: 500px">
</div>
{% else %}
{% for anhang in blog.anhang %}
<div class="text-center d-none d-sm-block">
<img class="rounded" id="bild-gross"
src="{{ path ('oeffentliche_dateien_anzeigen',{firmaId:blog.firma.id, dateiname:anhang.datei.speichername}) }}"
style="max-height: 500px">
</div>
{% endfor %}
{% endif %}
{% if blog.anhang is defined and blog.anhang|length > 1 %}
<div class="slick-slider mt-3 ms-sm-3 me-sm-3">
{% for anhang in blog.anhang %}
<div class="mx-2">
<img class="kleines-bild" style="cursor: pointer;"
src="{{ path ('oeffentliche_dateien_anzeigen',{firmaId:blog.firma.id, dateiname:anhang.datei.speichername}) }}">
</div>
{% endfor %}
</div>
{% endif %}
<div class="js-editor mx-n2 mt-5">
{{ blog.text|replace({"<a href": "<a target=_blank href"})|raw }}
</div>
{% if blog.quote|length > 0 %}
<blockquote class="testimonial pt-4 pb-4">
<div class="card border-0 shadow-sm">
<span class="testimonial-mark"></span>
<div class="card-body fs-md">
<i>
{{ blog.quote| nl2br }}
</i>
</div>
</div>
</blockquote>
{% endif %}
<div class="js-editor mx-n2">
{{ blog.text2|replace({"<a href": "<a target=_blank href"})|raw }}
</div>
<footer class="d-flex align-items-center text-left pt-4">
{% if blog.firma.logo|length > 0 %}
<img class="rounded" src="{{ asset('uploads/firmen/logo/' ~ blog.firma.id ~ '/'~ blog.firma.logo ) }}" width="70">
{% endif %}
<div class="ps-3">
<p class="fs-lg mb-n1">{{ blog.firma.firmenname }}</p>
</div>
</footer>
<!-- Post tags + sharing-->
<div class="d-flex flex-wrap justify-content-between pt-4">
<div class="mt-3">
{% if blog.firma.webseite is not null %}
<a class="btn-social bs-facebook me-2 mb-2" href="{{ blog.firma.webseite }}" target="_blank">
<i class="ci-globe"></i>
</a>
{% endif %}
{% if blog.firma.facebook is not null %}
<a class="btn-social bs-facebook me-2 mb-2" href="{{ blog.firma.facebook }}" target="_blank">
<i class="ci-facebook"></i>
</a>
{% endif %}
{% if blog.firma.instagram is not null %}
<a class="btn-social bs-instagram me-2 mb-2" href="{{ blog.firma.instagram }}" target="_blank">
<i class="ci-instagram"></i>
</a>
{% endif %}
{% if blog.firma.youtube is not null %}
<a class="btn-social bs-youtube me-2 mb-2" href="{{ blog.firma.youtube }}" target="_blank">
<i class="ci-youtube"></i>
</a>
{% endif %}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<script>
jQuery(function ($) {
$('.slick-slider').slick({
infinite: false,
dots: false,
draggable: false,
arrows: true,
slidesToShow: 8,
slidesToScroll: 6,
responsive: [
{
breakpoint: 1024,
settings: {
slidesToShow: 8,
slidesToScroll: 6
}
},
{
breakpoint: 900,
settings: {
slidesToShow: 6,
slidesToScroll: 4
}
},
{
breakpoint: 780,
settings: {
slidesToShow: 4,
slidesToScroll: 2
}
},
{
breakpoint: 600,
settings: {
slidesToShow: 2,
slidesToScroll: 1
}
},
{
breakpoint: 480,
settings: {
slidesToShow: 1,
slidesToScroll: 1
}
}
]
});
$('.kleines-bild').on('click', function (event) {
$('#bild-gross').attr('src', $(this).attr('src'));
});
});
</script>
{% endblock %}