Source

cciw-website2 / templates / cciw / forums / topic.html

Full commit
{% extends "cciw/forums/thread.html" %}
{% load standardpage %}
{% load forums %}

{% block thread_top %}
  {{ introtext }}
  {% if news_item %}
  <br/>
  <div class="newsItem">
    <div class="newsItemDetails">Posted: {{ news_item.created_at|date:"d M Y, H:i" }}, 
    by {{ news_item.created_by.get_link }}</div>
    <div class="newsItemFull">
    {% if news_item.full_item %}
      {{ news_item.full_item|safe|standard_subs }}
    {% else %}
      {{ news_item.summary|bb2html }}
    {% endif %}
    </div>
  </div>
  {% endif %}
  {% if poll %}
    {% if show_poll_results %}
    <div class="pollresults">
      <h2>{{ poll.title }}</h2>
      {{ poll.intro_text|bb2html }}
      <p>Results:</p>
      <table>
      {% for polloption in poll.poll_options.all %}
        <tr>
          <td>{{ polloption.text|bb2html }}</td>
          <td>{{ polloption.total }} votes &nbsp;&nbsp;</td>
          <td>{{ polloption.percentage }}</td>
          <td><div class="pollBarChartTotal"><div style="width: {{ polloption.bar_width }}px; " class="pollBarChart"></div></div></td>
        </tr>
      {% endfor %}
      </table>
      {{ poll.outro_text|bb2html }}
    </div>
    <br/>
    {% endif %}
    {% if voting_errors %}
      <div class="userError">
      Vote could not be registered:
      <ul>
      {% for error in voting_errors %}
        <li>{{ error }}</li>
      {% endfor %}
      </ul>
      </div>
    {% endif %}
    {% if voting_message %}<p><i>{{ voting_message }}</i></p>{% endif %}
    
    {% if show_vote_box %}
      {% poll_vote_box request topic poll 2 %}
    {% else %}
      {% if allow_voting_box %}
        <form action="" method="get"><div>
        Show the voting form: 
        <input type="submit" name="showvotebox" value="Show" />
        </div></form>
      {% endif %}
    {% endif %}

    {% if poll.can_anyone_vote %}
    <p><small><i>Voting starts: {{ poll.voting_starts|date:"d M Y, H:i" }}<br/>
     Voting ends: {{ poll.voting_ends|date:"d M Y, H:i" }}<br/>
    Rules: {{ poll.verbose_rules }}</i></small></p>
    {% else %}
    <p><i>Voting closed.</i></p>
    {% endif %}
    {% if current_member %}
      {% if current_member.can_add_poll %}
        {% if current_member == poll.created_by %}
        <br/>&raquo; <a href="../edit_poll/{{ poll.id }}/">Edit poll</a>
        {% endif %}
      {% endif %}
    {% endif %}
  {% endif %}
{% endblock %}