deblan.tv/src/Deblan/Bundle/BlogBundle/Resources/views/Default/thePost.html.twig

181 lines
5.6 KiB
Twig

<article>
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
{% if full is not defined %}
<h1><a href="{{ cms_path('post', {id: post.id, post: post.slug}) }}">{{ post.title }}</a></h1>
{% endif %}
{% if post.contentFormat == 'html' %}
{{ post.content|post|transform_url }}
{% endif %}
{% if post.contentFormat == 'markdown' %}
{{ post.content|markdown|transform_url }}
{% endif %}
</div>
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<ul class="labels">
{% for category in post.categories %}
<li><span class="label"><a href="{{ cms_path('category', {id: category.id, category: category.slug}) }}">{{ category.title }}</a></span></li>
{% endfor %}
{% for tag in post.tagsCollection %}
{% if tag|trim is not empty %}
<li><span class="label"><a href="{{ cms_path('tag', {tag: tag}) }}">#{{ tag }}</a></span></li>
{% endif %}
{% endfor %}
</ul>
</div>
</div>
</div>
</article>
{#
<article class="post" id="post-{{ post.id }}">
<header>
<h1><a href="{{ cms_path('post', {id: post.id, post: post.slug}) }}">{{ post.title }}</a></h1>
<div class="meta">
<address class="author">
<span class="glyphicon glyphicon-user"></span>
<a rel="author" href="{{ cms_path('about') }}">{{ post.user.username|capitalize }}</a>
</address>
<time datetime="{{ post.publishedAt|date("Y-m-d") }}" title="{{ post.publishedAt|date("r") }}">
<span class="glyphicon glyphicon-calendar"></span>
{{ post.publishedAt|date("d/m/Y à H\\hi") }}
</time>
<ul class="labels">
{% for category in post.categories %}
<li><span class="label label-primary"><a href="{{ cms_path('category', {id: category.id, category: category.slug}) }}">{{ category.title }}</a></span></li>
{% endfor %}
{% for tag in post.tagsCollection %}
{% if tag|trim is not empty %}
<li><span class="label label-success"><a href="{{ cms_path('tag', {tag: tag}) }}">#{{ tag }}</a></span></li>
{% endif %}
{% endfor %}
</ul>
</div>
</header>
<div class="page-content">
{% if post.contentFormat == 'html' %}
{{ post.content|post|transform_url }}
{% endif %}
{% if post.contentFormat == 'markdown' %}
{{ post.content|markdown|transform_url }}
{% endif %}
</div>
{% if full is defined and false %}
<footer>
<script type="text/javascript">
var addthis_share = {
url: '{{ app.request.getSchemeAndHttpHost() ~ cms_path('post', {id: post.id, post: post.slug}) }}'
}
</script>
<div class="addthis_toolbox addthis_default_style addthis_32x32_style">
<a class="addthis_button_preferred_1"></a>
<a class="addthis_button_preferred_2"></a>
<a class="addthis_button_preferred_3"></a>
<a class="addthis_button_preferred_4"></a>
<a class="addthis_button_compact"></a>
<a class="addthis_counter addthis_bubble_style"></a>
</div>
</footer>
{% endif %}
</article>
#}
{% if full is defined %}
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
{% if post.hasComments %}
<hr />
{% for comment in post.orderedComments %}
{% if comment.active and not comment.parentCommentId %}
{{ include('DeblanBlogBundle:Default:theComment.html.twig', {level: 1}) }}
{% endif %}
{% endfor %}
{% endif %}
<div class="comments">
<div id="form"></div>
<hr />
<h2>Ajouter un commentaire</h2>
<div class="alert alert-info hide" id="answer_inprogress">
<button id="cancel_answer" class="btn btn-default pull-right">Annuler</button>
<p>Vous répondez à un commentaire.</p>
</div>
<form class="form-horizontal" method="post" data-secured role="form" data-target="{{ cms_path('post', {id: post.id, post: post.slug}) }}" action="{{ cms_path('bot') }}">
<div class="form-group">
<label class="col-sm-2 control-label" for="comment_Author">Auteur</label>
<div class="col-sm-10">
{{ form_widget(form.Author) }}
{{ form_errors(form.Author) }}
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label" for="comment_Website">Site web</label>
<div class="col-sm-10">
{{ form_widget(form.Website) }}
{{ form_errors(form.Website) }}
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label" for="comment_Email">Email</label>
<div class="col-sm-10">
{{ form_widget(form.Email) }}
{{ form_errors(form.Email) }}
<span class="help-block">L'email n'est pas affiché. Vous pouvez utiliser un avatar à l'aide de <a href="http://fr.gravatar.com/">Gravatar</a>.</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label" for="comment_Content">Commentaire</label>
<div class="col-sm-10">
{{ form_widget(form.Content) }}
{{ form_errors(form.Content) }}
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label"></label>
<div class="col-sm-10">
<label>{{ form_widget(form.Follow) }} M'informer des nouveaux commentaires</label>
{{ form_errors(form.Follow) }}
</div>
</div>
<div class="form-group submit">
<label class="col-sm-2 control-label">Publier</label>
<div class="col-sm-10">
<input type="submit" class="btn btn-primary" value="Publier" />
</div>
</div>
{{ form_widget(form.ParentCommentId) }}
{{ form_rest(form) }}
</form>
</div>
</div>
</div>
</div>
{% endif %}