Source

brainstill / bsproj / templates / brainstill / idea_detail.html

{% extends "layout0.html" %}
{% load i18n brainstill comments %}

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

{% block content %}
  <h1>
    <span class="idea-number">#{{ idea.pk }} </span>
    <span class="idea-title">{{ idea }}</span>
    {% ranks_and_votes idea %}
  </h1>

  <p class="info">
    {% blocktrans with idea.project.get_absolute_url as project_url and idea.project as project %}
      Project: <a href="{{ project_url }}">{{ project }}</a>
    {% endblocktrans %}
    |
    {% blocktrans with idea.author as author and idea.date_created|date:"SHORT_DATETIME_FORMAT" as created %}Idea proposed at <span class="created-date">{{ created }}</span> by <span class="author">{{ author }}</span>.{% endblocktrans %}
  </p>
  <p class="description">{{ idea.description|linebreaksbr }}</p>

  <a name="comments"></a>

  {% get_comment_list for idea as comment_list %}
  {% for comment in comment_list %}
    {% if forloop.first %}<ul class="comments">{% endif %}
    <li id="c{{ forloop.counter }}">
      <address>
        <a href="#c{{ forloop.counter }}" class="anchor">#{{ forloop.counter }}</a>
        {% ifequal comment.user idea.author %}
          {% blocktrans with comment.user as author and comment.submit_date|date:"SHORT_DATETIME_FORMAT" as date_posted %}<span class="author">{{ author }} (idea author)</span> @ <span class="date-posted">{{ date_posted }}</span>{% endblocktrans %}
        {% else %}
          {% blocktrans with comment.user as author and comment.submit_date|date:"SHORT_DATETIME_FORMAT" as date_posted %}<span class="author">{{ author }}</span> @ <span class="date-posted">{{ date_posted }}</span>{% endblocktrans %}
        {% endifequal %}
      </address>
      <p class="comment">{{ comment.comment|linebreaksbr }}</p>
    </li>
    {% if forloop.last %}</ul>{% endif %}
  {% endfor %}

  {% if user.is_authenticated %}
    {% with idea.get_absolute_url as next %}
      {% render_comment_form for idea %}
    {% endwith %}
  {% else %}
    <p class="comments-not-authenticated">
      {% url auth_login as auth_login_url %}
      {% blocktrans %}<a href="{{ auth_login_url }}">Log in</a> to post comments.{% endblocktrans %}
    </p>
  {% endif %}
{% endblock %}