{% extends 'base.html' %}

{% load i18n %}
{% load static %}
{% load forum_filter %}

{% block extra_js %}
	<script src="{% static 'js/js/forum.js' %}"></script>
{% endblock %}

{% block content %}

<div class="container">

	{% if user.id %}
		{% include "musette/notification.html" %}
	{% endif %}

	<div class="panel panel-default">
		<div class="panel-heading"><h4>{% trans "Forums" %}</h4></div>
	  	<div class="panel-body">
	    	{% for category in categories %}
	    		<h4><u>{% trans "Category" %}: {{category.name}}</u></h4>
		    	<div class="list-group">
				  	{% for forum in category.idcategory|in_category %}
				  		<div class="container-fluid">
						  	<a href="/forum/{{ forum.name }}/" class="list-group-item">
						  		<span class="badge" style="margin-top: 5px">{{ forum.topics_count }}</span>
						    	<h4 class="list-group-item-heading">{{ forum.name }}</h4>
						    	<p class="list-group-item-text">{{ forum.description|safe }}</p>
						  	</a>
					  	</div>
					  	<hr>
					{% empty %}
						<p> {% trans "Please, you add forums and categories in the administrator." %} <p>
				  	{% endfor %}
				</div>
			{% empty %}
				<p> {% trans "Please, you add forums and categories in the administrator." %} <p>
			{% endfor %}

	  	</div>
	</div>

</div>

{% endblock %}