{% extends 'base.html' %}

{% block head %}
<title>India Theatre Forum - {{ current_issue.title }}</title>
<script type="text/javascript" src="/static/js/jquery.color.js"></script>
<script type="text/javascript" src="/static/js/utils.js"></script>
<script type="text/javascript">
var ERANG_ISSUE_ID = {{ current_issue.id }};
</script>
<script type="text/javascript" src="/static/js/erang/erang.js"></script>
<link rel="stylesheet" href="/static/css/erang/erang.css" />
<link rel="stylesheet" href="/static/css/erang/comments.css" />
{% endblock %}

{% block body %}
<script type="text/html" id="tmpl_issue_list">
  <ul class="newsletterList">
    <% for (var i=0; i<issues.length; i++) { 
      var issue = issues[i]; 
      if (issue.id === ERANG_ISSUE_ID) { var classname="currentIssue" } else { var classname="otherIssue"}
    %>
      <li>
        <a href="?issue_id=<%= issue.id %>" class="<%= classname %>"><%= issue.title %></a>
        <br />
        <span class="date"></span>
      </li>
    <% } %>
  </ul>
  <div class="navBtns" data-terms="<%= search_terms %>" data-page="<%= page_no %>">
    <% if (hasPrev) { %><span class="prevBtn">&lt; Previous</span><% } %>
    <% if (hasNext) { %><span class="nextBtn">Next &gt;</span><% } %>
  </div>

</script>
  <div id="leftMenu">
    <div class="homeLink">
      <h3><img src="/static/images/favicon.ico" title="India Theatre Forum" alt="" /> <a href="/" title="India Theatre Forum Home">&nbsp;Home</a> </h3>
    </div>
    <div id="issueListWrapper">
      <h3>Past Issues:</h3>
      <form id="searchForm" action="" method="get" />
        <input id="issueSearch" data-placeholder="Search" /><input id="searchSubmit" type="submit" value="Go" />
      </form>
      <div class="issueListContainer">
      </div>
    </div>
    <div id="subscribe">
      <a name="subscribe"></>
      <h3>Subscribe:</h3>
      <form id="subscribeForm">
        <input id="email" name="email" data-placeholder="E-Mail" /><br />
        <button id="subscribeBtn">Subscribe!</button>
      </form>
    </div>
  </div>

{% load erangtags %}
  <div id="newsletterContent">
    {% autoescape off %}
    {{ current_issue.html|absolutify_links }}
    {% endautoescape %}
    <div id="commentWrapper">
      {% load comments %}
      <h3>Comments and Feedback</h3>
      <a name="comments"></a>
      {% get_comment_list for erang_organised.issue current_issue.id as comment_list %}

      {% ifnotequal comment_list|length 0 %}
        <div id="comments_list">
<!--
          <h4 class="responsesHeader">
            Responses:
          </h4>
-->
          {% for comment in comment_list %}
            <div class="comment {% cycle 'commentOdd' 'commentEven' %}">
              <div class="comment_user">
              {{ comment.user_name }}:
              </div>
              <div class="comment_comment">
              {{ comment.comment }}
              </div>
            </div>
          {% endfor %}
        </div>
      {% endifnotequal %}


      {% get_comment_form for current_issue as form %}

      <div id="comment_form">
        <h4 class="formHeader">
          Leave a Response:
        </h4>
        <form action="{% comment_form_target %}" method="POST">{% csrf_token %}
          <input type="hidden" name="next" value="/erang/?issue_id={{ current_issue.id }}" />
          <table id="form_table">
            <tr class="leave_response">
              <th></th>
              <td>
               
              </td>
            </tr>
        {{ form }}
            <tr>
              <th></th>
              <td><input type="submit" name="post" class="submit-post" value="Post"></td>
            </tr>
          </table>
        </form>
      </div>
    </div>
  </div>
{% endblock %}
