{% extends 'base_no_card.html' %}
{% load crispy_forms_tags %}
{% load static %}

{% block main %}
{% if page.blog_art %}
	{% for item in page.blog_art %}
		<div class="card mb-2" style="background-color: rgba(250,250,250,0.88);" >
			<div class="card-header">
				<h2>{{item.b_titre}}</h2>
			</div>
			<div class="card-body">
			<p class="card-text">
			<a class="text-dark text-decoration-none" href="{% url 'blog_play' item.b_titre_slugify %}">
				{{item.b_description|safe}}
			</a>
			</p>
			</div>
			<div class="card-footer">
				Publier le {{item.b_publdate|date:"m N Y à H:i"}} {% if item.b_cat.all %} | {%for cat in item.b_cat.all %}<a class="text-dark text-decoration-none" href="{% url 'blog_tag' cat.cb_titre_slgify %}">{{ cat.cb_titre }}</a>{% if not forloop.last %}, {% endif %}{% endfor %}{% endif %}
			</div>
		</div>
	{% endfor %}
{% endif %}
{% endblock %}

{% block right_panel %}
{% if page.p_right != "" %}
<div class="card" style="background-color: rgba(250,250,250,0.88);" >
<div class="card-body">
	<p class="card-text">{{page.p_right|safe}}</p>
	<h4> Les Catégories </h4>
	<p>
	{% for cat in page.blog_cat %}
		<a href="{% url 'blog_tag' cat.cb_titre_slgify %}" class="btn btn-dark mb-2" tabindex="-1" role="button" aria-disabled="true">{{cat.cb_titre}}</a>
	{% endfor %}
	</p>
	{% if page.retour %}
	<p>
		<a href="{% url page.retour %}" class="btn btn-dark mb-2" tabindex="-1" role="button" aria-disabled="true"><i class="fas fa-undo-alt"></i> Retour</a>

	</p>
	{% endif %}
	
</div>
</div>
{% endif %}
{% endblock %}
