Source

brainstill / bsproj / templates / brainstill / project_detail.html

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

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

{% block content %}
  <h1>{{ project }}</h1>
  <p class="info">
    <a href="{% url brainstill_idea_new project_slug=project.slug %}">
      {% trans "Propose new idea" %}</a>
    |
    {% blocktrans with project.author as author and project.date_created|date:"SHORT_DATETIME_FORMAT" as created %}
      Project created at <span class="created-date">{{ created }}</span>
      by <span class="author">{{ author }}</span>.
    {% endblocktrans %}
  </p>
  {% if project.description %}
    <p class="description">{{ project.description|linebreaksbr }}</p>
  {% endif %}

  {% for idea in project.idea_set.all %}
    {% if forloop.first %}<ul id="idea-list">{% endif %}
    <li class="idea">
      <a name="{{ idea.pk }}"></a>
      <h2>
        <span class="idea-number"><a href="{{ idea.project.get_absolute_url }}#{{ idea.pk }}" class="anchor">#{{ idea.pk }}</a></span>
        <span class="idea-title"><a href="{{ idea.get_absolute_url }}">{{ idea }}</a></span>
        {% ranks_and_votes idea %}
      </h2>
      <p class="info">
        {% blocktrans with idea.author as author and idea.date_created|date:"SHORT_DATETIME_FORMAT" as created %}
          Proposed at <span class="created-date">{{ created }}</span>
          by <span class="author">{{ author }}</span>.
        {% endblocktrans %}
      </p>
      <p class="description">{{ idea.description|linebreaksbr }}</p>
      {% get_comment_count for idea as comment_count %}
      <p class="comments-info"><a href="{{ idea.get_absolute_url }}#comments">{% spaceless %}
        {% ifequal comment_count 0 %}
          {% trans "Post first comment &rarr;" %}
        {% else %}
          {% blocktrans count comment_count as count %}Read {{ count }} comment &rarr;{% plural %}Read {{ count }} comments &rarr;{% endblocktrans %}
        {% endifequal %}
      {% endspaceless %}</a></p>
    </li>
    {% if forloop.last %}</ul>{% endif %}
  {% empty %}
    <p class="empty">
      {% trans "No ideas yet." %}
    </p>
  {% endfor %}
{% endblock %}