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

{% block title %}{{  block.super }}{% endblock %}

{% block content %}

{% load pagination_tags %}

{% autopaginate topic_list topic_page_size %}

<div id="actionbox">

</div>  

<div id="brd-wrap" class="brd">
  <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>
	<div id="errorbox"> <span></span> </div> 
	
	<!-- begin formbox -->
	<div id="formbox"> 
      <form action="{% url dinette_posttopic %}" method="POST" id="fposttopic"  enctype="multipart/form-data">            
		<table>
		  <tbody>
			{{ topicform.as_table }}
			<tr>
			  <th> </th>
			  <td>
			    <input type="submit" value="Post Topic" onClick="return check_errors_in_form()" />
			    &nbsp; <span class="closebutton"> <a href="" onclick="return hideForm()">close</a>  </span>
			  </td>
			</tr>
		  </tbody>
        </table>
       
        <input type="hidden" name="authenticated"  value="{{ authenticated }}" />
        <input type="hidden" name="categoryid"  value="{{ category.id }}" />
	  </form>
	</div>     
	<!-- formbox ends -->
     
    <!-- brd-main begin -->
	<div id="brd-main">
	  <h1 class="main-title">
	    <a class="permalink" href="{{ topic.category.get_absolute_url }}" rel="bookmark" title="Permanent link to this forum.">
	      {{ topic.category.name }} 
	    </a> 
	  </h1>
	  
	  <!-- bread crumbs begin -->
	  <div id="brd-crumbs-top" class="crumbs gen-content">
	    <p>
		  <span class="crumb crumbfirst">
			<a href="{% url dinette_category %}">{{ config.name  }}</a>
		  </span> 
		  <span class="crumb crumblast">
			<span> &raquo; </span>
			<a href="{{ category.get_absolute_url }}"> {{category.name}}</a>
		  </span>
        
		  {% if authenticated %}
			<a href="#" onclick="return isUserAuthenticated(0)">New Topic</a>        
		  {% else %}
			<a href="{% url dinette_login %}?next={{ category.get_absolute_url }}">Login to start New Topic</a>        
		  {% endif %}
        </p>
	  </div>
	  <!-- bread crumbs end -->
	
	  <div class="main-head">
		<p class="options"><span class="feed first-item"><a href="{% url dinette_feed_url category.getCategoryString %}"> RSS </a></span></p>	
		<h2 class="hn"><span><span class="item-info">Topics </span></span></h2>
	  </div>

	  <div class="main-subhead">
		<p class="item-summary forum-views">
		  <span>
			<strong class="subject-title">Topics</strong> in this forum with details of 
			<strong class="info-replies">replies</strong>, 
			<strong class="info-views">views</strong>, 
			<strong class="info-lastpost">last post</strong>.
		  </span>
		</p>
	  </div>

	  <div id="topicslist" class="main-content main-forum forum-views">
		{% for topic in topic_list %}     
		  {% include 'dinette/topic_detail_frag.html' %}  
		{% endfor %}
	  </div>
	 
	  <div  id="belowpostreplybox" class="crumbs gen-content">
	  	{% paginate %}	
	  </div>
  
	  <div id="brd-pagepost-end" class="main-pagepost gen-content">
	  </div>
	</div>
    <!-- brd-main ends -->

	<div class="hr"><hr /></div>
	{{ block.super }}
	
  </div>
</div>
{% endblock %}