{% extends "dinette/base.html" %}

{% block content %}

<!-- brd-wrap begins -->
<div id="brd-wrap" class="brd">
    
<!-- brd-index begins -->
<div id="brd-index" class="brd-page basic-page">
{% include 'dinette/header_frag.html' %}
{% include 'dinette/announce_frag.html' %}

<p></p>

<div class="hr"><hr /></div>
<!-- brd-main begins -->
<div id="brd-main">
{% for forum in forums_list %}
  {% if user_access_list|get_digit:forloop.counter  %}
  <h1 class="main-title">{{ forum }}</h1>
  <div class="main-head">
    <h2 class="hn"><span>{{ forum }}</span></h2>
  </div>

  <div class="main-subhead">
    <p class="item-summary">
	  <span>
	    <strong class="subject-title">Forum  </strong> in this category with details of 
		<strong class="info-topics">topics</strong>,
		<strong class="info-posts">posts</strong>, 
		<strong class="info-lastpost">last post</strong>
	  </span>
	</p>
  </div>
  
  <!-- category-#id begins -->
  <div id="category{{category.id}}" class="main-content main-category">
    {% for category in forum.category_set.all %}
	<!-- forum48 begins -->
    <div id="forum48" class="main-item odd main-first-item">
	  <span class="icon "><!-- --></span>
                
	  <div class="item-subject">
		<h3 class="hn"><a href="{% url dinette_index category.slug %}"><span> {{category}} </span></a></h3>
		<p>{{ category.description }} 
		  <span class="modlist">
		    (Moderated by
		    {% for moderator in category.moderated_by.all %}
			  <a href="{{ moderator.get_profile.get_absolute_url }}">{{moderator}}</a>{% if not forloop.last %}, {% endif %}
		    {% endfor %}    
		    )
		  </span>
		</p>
	  </div>
                
	  <ul class="item-info">
		<li class="info-topics">
		  <strong>{{ category.ftopics_set.all.count }} </strong> <span class="label">topics</span>
		</li>
		<li class="info-posts">
		  <strong>{{ category.noofPosts }} </strong> <span class="label">posts</span>
		</li>
		<li class="info-lastpost">
		  <span class="label">Last post:</span>
		  <strong>{{ category.lastPostDatetime|date:"jS F Y H:i A" }}</strong> 
		  <cite>by {{ category.lastPostedUser }}</cite>
		</li>
	  </ul>
	</div>
	<!-- forum48 ends -->
	{% endfor %}
  </div>
  <!-- category-#id ends -->
  {% endif %}
{% endfor %}
</div>
<!-- brd-main ends -->

<!-- forum_qpost -->

<!-- brd-stats begins -->
<div id="brd-stats" class="gen-content">
  <h2 class="hn"><span>Forum statistics</span></h2>
  <ul>
	<li class="st-users">
	  <span>Total number of registered users: <strong>{{ totalusers }} </strong></span>
	</li>
    <li class="st-users">
	  <span>Newest registered user: 
	    <strong>
		  <a href="{{ last_registered_user.get_profile.get_absolute_url }}">
		    {{ last_registered_user.username }}
		  </a>
		</strong>
	  </span>
	</li>
	<li class="st-activity">
	  <span>Total number of topics: <strong>{{ totaltopics }}</strong></span>
	</li>
	<li class="st-activity">
	  <span>Total number of posts: <strong> {{ totalposts }} </strong></span>
	</li>
	<li class="st-activity">
	  <span>Users Online: <strong> {{ users_online }} </strong></span>
	</li>
  </ul>
</div>
<!-- brd-stats ends -->

<div class="hr"><hr /></div>

{{ block.super }}

</div><!-- brd-index ends -->
</div><!-- brd-wrap ends -->

{% endblock %}
