2021-03-29 13:58:05 +02:00
|
|
|
{% set full = full is defined and full %}
|
|
|
|
|
|
|
|
<div class="col-12">
|
2022-09-25 20:43:24 +02:00
|
|
|
<div class="body prose-lg">
|
2021-03-29 13:58:05 +02:00
|
|
|
{% if post.isQuick %}
|
2022-09-21 10:55:43 +02:00
|
|
|
{{ include('page/post/_quick_post.html.twig') }}
|
2021-03-29 13:58:05 +02:00
|
|
|
{% else %}
|
|
|
|
{% if not full %}
|
2022-09-25 20:43:24 +02:00
|
|
|
<div class="_rounded-2xl _shadow-md _p-5 _pb-0 _bg-box">
|
|
|
|
<h2 class="h3 no-margin">
|
|
|
|
<a href="{{ safe_path('blog_menu_post', {post: post.id, slug: post.slug, _domain: _domain}) }}">
|
|
|
|
{{- post.title -}}
|
|
|
|
</a>
|
|
|
|
</h2>
|
|
|
|
|
2022-09-27 20:18:08 +02:00
|
|
|
<ul class="md:flex md:gap-3 pl-0">
|
2022-10-01 10:19:18 +02:00
|
|
|
<li class="md:pl-0 mt-0 inline-block">
|
2022-09-25 20:43:24 +02:00
|
|
|
<time datetime="{{ post.publishedAt|date("Y-m-d") }}" title="{{ post.publishedAt|date("r") }}">
|
|
|
|
{{- 'Le ' ~ post.publishedAt|date("d/m/Y à H\\hi") -}}
|
|
|
|
</time>
|
2021-03-29 13:58:05 +02:00
|
|
|
</li>
|
2022-09-25 20:43:24 +02:00
|
|
|
{% for category in post.categories %}
|
2022-10-01 10:19:18 +02:00
|
|
|
<li class="md:pl-0 mt-0 inline-block">
|
2022-09-25 20:43:24 +02:00
|
|
|
<a href="{{ safe_path('blog_menu_category', {category: category.id, slug: category.slug, _domain: _domain}) }}">
|
|
|
|
{{- category.title -}}
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
{% endfor %}
|
|
|
|
|
|
|
|
{% for tag in post.tags %}
|
2022-10-01 10:19:18 +02:00
|
|
|
<li class="md:pl-0 mt-0 inline-block">
|
2022-09-25 20:43:24 +02:00
|
|
|
<a href="{{ safe_path('blog_menu_search', {tag: tag.label, _domain: _domain}) }}">
|
|
|
|
{{- '#' ~ tag.label -}}
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
{% endfor %}
|
|
|
|
</ul>
|
|
|
|
</div>
|
2021-03-29 13:58:05 +02:00
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
<div class="body-content">
|
|
|
|
{% if post.contentFormat == 'html' %}
|
2022-03-26 14:31:37 +01:00
|
|
|
{{- post.content|murph_url|file_attributes|post -}}
|
|
|
|
{% elseif post.contentFormat == 'markdown' %}
|
|
|
|
{{- post.content|murph_url|file_attributes|markdown('post')|lazy_load -}}
|
|
|
|
{% elseif post.contentFormat == 'editorjs' %}
|
|
|
|
{{- post.content|murph_url|file_attributes|editorjs_to_html|raw -}}
|
2021-03-29 13:58:05 +02:00
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{% if full %}
|
2022-09-11 18:50:04 +02:00
|
|
|
{% set description = setting('post_author_description') %}
|
|
|
|
|
2022-09-25 20:43:24 +02:00
|
|
|
{%- if description and not post.isQuick -%}
|
2022-09-25 18:06:39 +02:00
|
|
|
<div class="body">
|
2022-09-25 20:43:24 +02:00
|
|
|
<div class="rounded-2xl shadow-md p-2 md:p-8 flex justify-start bg-box">
|
2022-09-25 18:06:39 +02:00
|
|
|
{%- set avatar = setting('avatar_image') -%}
|
2022-09-11 18:50:04 +02:00
|
|
|
|
2022-09-25 18:06:39 +02:00
|
|
|
{%- if avatar -%}
|
|
|
|
<p class="mr-8">
|
|
|
|
<img src="{{ asset(avatar)|imagine_filter('site_avatar') }}" alt="Simon Vieille" title="Simon Vieille" class="rounded-full">
|
|
|
|
</p>
|
|
|
|
{%- endif -%}
|
|
|
|
|
2022-09-27 21:44:09 +02:00
|
|
|
<div>
|
|
|
|
{{- description|markdown('post') -}}
|
|
|
|
</div>
|
2022-09-11 18:50:04 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{%- endif -%}
|
|
|
|
|
|
|
|
{%- if similarPosts is defined and similarPosts|length > 0 -%}
|
2022-09-25 18:06:39 +02:00
|
|
|
<div class="body">
|
|
|
|
<div class="grid grid-flow-row-dens grid-cols-3 gap-5">
|
|
|
|
{% for item in similarPosts %}
|
|
|
|
{% set url = safe_path('blog_menu_post', {post: item.id, slug: item.slug, _domain: _domain}) %}
|
2022-09-09 20:10:51 +02:00
|
|
|
|
2022-09-25 20:43:24 +02:00
|
|
|
<div class="card shadow-md col-span-3 md:col-span-1 bg-box">
|
2022-09-25 18:06:39 +02:00
|
|
|
<div class="card">
|
|
|
|
{%- if item.image -%}
|
|
|
|
<figure>
|
|
|
|
<a href="{{ url }}">
|
|
|
|
{% set image = asset(item.image)|imagine_filter('post_preview_filter') %}
|
2022-09-25 20:43:24 +02:00
|
|
|
<img src="{{ asset('build/images/px.png') }}" data-src="{{ image }}" alt="{{ item.title }}">
|
2022-09-25 18:06:39 +02:00
|
|
|
</a>
|
|
|
|
</figure>
|
|
|
|
{%- endif -%}
|
|
|
|
<div class="card-body">
|
|
|
|
<h3 class="card-title">
|
2022-09-09 20:10:51 +02:00
|
|
|
<a href="{{- url -}}">
|
|
|
|
{{- item.title -}}
|
|
|
|
</a>
|
2022-09-25 18:06:39 +02:00
|
|
|
</h3>
|
2022-09-09 20:10:51 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
2022-09-25 18:06:39 +02:00
|
|
|
</div>
|
|
|
|
{% endfor %}
|
2022-09-09 20:10:51 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
2022-09-11 18:50:04 +02:00
|
|
|
{%- endif -%}
|
2022-09-09 20:10:51 +02:00
|
|
|
|
2021-03-29 13:58:05 +02:00
|
|
|
<div class="col-12">
|
|
|
|
<div class="reviews">
|
|
|
|
<hr>
|
|
|
|
|
2021-03-30 13:40:38 +02:00
|
|
|
{% set comments = post.comments({
|
|
|
|
isActive: true,
|
|
|
|
isFirstLevel: true
|
|
|
|
}) %}
|
2021-03-29 13:58:05 +02:00
|
|
|
|
2021-03-30 13:40:38 +02:00
|
|
|
{% if comments|length %}
|
2022-09-25 20:43:24 +02:00
|
|
|
{% for comment in comments %}
|
|
|
|
{{ include('page/post/_comment.html.twig', {comment: comment, level: 1}) }}
|
|
|
|
{% endfor %}
|
2021-03-29 13:58:05 +02:00
|
|
|
{% endif %}
|
|
|
|
|
2022-09-25 22:50:37 +02:00
|
|
|
{% form_theme form with "form_div_layout.html.twig" %}
|
|
|
|
|
2021-03-29 13:58:05 +02:00
|
|
|
<div class="grid" id="form">
|
2022-09-25 22:50:37 +02:00
|
|
|
<form class="form" method="POST" data-form-bot action="{{ safe_url('blog_tech_form_without_javascript', {page: app.request.uri, _domain: _domain}) }}">
|
2021-03-30 13:40:38 +02:00
|
|
|
{% if comments|length %}
|
2021-03-29 13:58:05 +02:00
|
|
|
<hr>
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
<div class="h4">Ajouter un commentaire</div>
|
|
|
|
|
2022-09-25 22:50:37 +02:00
|
|
|
<div class="grid grid-flow-row-dens grid-cols-2 gap-5">
|
|
|
|
<div class="col-span-2 md:col-span-1">
|
|
|
|
{{ form_label(form.author, null, {label_attr: {class: 'label'}}) }}
|
|
|
|
{{ form_widget(form.author, {attr: {class: 'input input-bordered w-full'}}) }}
|
2021-03-29 13:58:05 +02:00
|
|
|
{{ form_errors(form.author) }}
|
|
|
|
</div>
|
2022-09-25 22:50:37 +02:00
|
|
|
<div class="col-span-2 md:col-span-1">
|
|
|
|
{{ form_label(form.website, null, {label_attr: {class: 'label'}}) }}
|
|
|
|
{{ form_widget(form.website, {attr: {class: 'input input-bordered w-full'}}) }}
|
2021-03-29 13:58:05 +02:00
|
|
|
{{ form_errors(form.website) }}
|
|
|
|
</div>
|
2022-09-25 22:50:37 +02:00
|
|
|
<div class="col-span-2">
|
|
|
|
{{ form_label(form.email, null, {label_attr: {class: 'label'}}) }}
|
|
|
|
{{ form_widget(form.email, {attr: {class: 'input input-bordered w-full'}}) }}
|
2021-03-29 13:58:05 +02:00
|
|
|
{{ form_errors(form.email) }}
|
|
|
|
</div>
|
2022-09-25 22:50:37 +02:00
|
|
|
<div class="col-span-2">
|
|
|
|
<div class="label justify-start gap-3">
|
|
|
|
{{ form_widget(form.follow, {attr: {class: 'checkbox'}}) }}
|
|
|
|
<label class="label" for="user_comment_follow">{{ form.follow.vars.label }}</label>
|
|
|
|
</div>
|
2022-02-06 19:36:10 +01:00
|
|
|
</div>
|
2022-09-25 22:50:37 +02:00
|
|
|
<div class="col-span-2">
|
|
|
|
<p class="label">
|
|
|
|
{{- 'Votre commentaire - Vous pouvez utiliser du markdown ' }}
|
|
|
|
</p>
|
|
|
|
|
|
|
|
{{ form_errors(form.content) }}
|
|
|
|
{{ form_widget(form.content, {attr: {cols: 30, rows: 10, class: 'textarea textarea-bordered w-full'}}) }}
|
|
|
|
|
|
|
|
<div class="hidden alert alert-info mt-5" id="answer-alert">
|
|
|
|
<div class="w-full flex justify-between">
|
|
|
|
<div>
|
|
|
|
{{- 'Vous répondez à un commentaire' -}}
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<a href="#" class="btn btn-sm" id="cancel-answer">
|
2021-03-29 13:58:05 +02:00
|
|
|
{{- 'Annuler' -}}
|
2022-09-25 22:50:37 +02:00
|
|
|
</a>
|
|
|
|
</div>
|
2021-03-29 13:58:05 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2022-09-25 22:50:37 +02:00
|
|
|
<div class="col-span-2">
|
2022-09-27 20:30:16 +02:00
|
|
|
<div class="md:flex justify-start gap-3">
|
2022-09-25 22:50:37 +02:00
|
|
|
{{ form_label(form.captcha, null, {label_attr: {class: 'label'}}) }}
|
|
|
|
{{ form_widget(form.captcha, {attr: {class: 'input input-bordered'}}) }}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-span-2">
|
|
|
|
<label class="label justify-start gap-3" for="rgpd">
|
|
|
|
<input type="checkbox" id="rgpd" class="checkbox" required>
|
|
|
|
<span class="label">En validant ce formulaire, vous acceptez que j'utilise votre e-mail pour vous fournir une réponse.</span>
|
|
|
|
</label>
|
|
|
|
</div>
|
2021-03-29 13:58:05 +02:00
|
|
|
|
2022-09-25 22:50:37 +02:00
|
|
|
<div class="col-span-2">
|
|
|
|
<input type="submit" class="btn btn-primary mr-2" value="Publier" />
|
|
|
|
<input type="button" class="btn preview-button" value="Prévisualiser" />
|
|
|
|
</div>
|
2021-03-29 13:58:05 +02:00
|
|
|
|
2022-09-25 22:50:37 +02:00
|
|
|
{{ form_rest(form) }}
|
|
|
|
</div>
|
2021-03-29 13:58:05 +02:00
|
|
|
</form>
|
|
|
|
|
2022-09-25 22:50:37 +02:00
|
|
|
<div id="preview" class="review-body mt-5 mb-5"></div>
|
2021-03-29 13:58:05 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{% if not post.isQuick %}
|
|
|
|
{%
|
|
|
|
set ld = {
|
|
|
|
'@context': 'http://schema.org/',
|
|
|
|
'@type': 'BlogPosting',
|
|
|
|
'headline': post.title,
|
|
|
|
'author': {
|
|
|
|
'@type': 'Person',
|
|
|
|
'name': 'Simon Vieille'
|
|
|
|
},
|
|
|
|
'publisher': {
|
|
|
|
'@type': 'Organization',
|
|
|
|
'name': 'Deblan blog',
|
|
|
|
'logo': {
|
|
|
|
'@type': 'imageObject',
|
2021-03-31 14:58:07 +02:00
|
|
|
'url': asset('build/images/logo.png')
|
2021-03-29 13:58:05 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
'datePublished': post.publishedAt|date("c"),
|
|
|
|
'dateModified': post.updatedAt|date("c"),
|
2021-03-31 14:58:07 +02:00
|
|
|
'image': post.image ? asset(post.image) : null
|
2021-03-29 13:58:05 +02:00
|
|
|
}
|
|
|
|
%}
|
|
|
|
|
|
|
|
<script type="application/ld+json">{{- ld|json_encode(128)|replace({'\\/': '/'})|raw -}}</script>
|
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|