Skip to content

Commit

Permalink
template indentation and handling "or" booleans
Browse files Browse the repository at this point in the history
Specifically, ensuring that "or" only appears when both a feed can be
added to *and* it has more items.
  • Loading branch information
justinabrahms committed Sep 8, 2010
1 parent 7100145 commit b760ed6
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions django_website/templates/aggregator/index.html
Expand Up @@ -12,16 +12,19 @@ <h2 class="deck">This page, updated every hour, aggregates what's going on in th
<div id="{{ feedtype.slug }}" class="module {% cycle "first" "last" %}">
<h3 class="header">{{ feedtype.name }}</h3>
{% for item in feedtype.items|slice:":5" %}
<h5><a href="{{ item.link }}">{{ item.title }}</a></h5>
<p class="date">{{ item.date_modified|date:"N jS, Y \a\t P" }} by <a href="{{ item.feed.public_url }}">{{ item.feed.title }}</a></p>
<h5><a href="{{ item.link }}">{{ item.title }}</a></h5>
<p class="date">{{ item.date_modified|date:"N jS, Y \a\t P" }} by <a href="{{ item.feed.public_url }}">{{ item.feed.title }}</a></p>
{% endfor %}
<p style="padding-left: 10px;"><a href="{% url community-feed-list feedtype.slug %}">View more</a>{% if feedtype.can_self_add %} or <a href="{% url community-add-feed feedtype.slug %}">Add your feed</a>{% endif %}</p>
<p>
{% if feedtype.items|length %}
<a href="{% url community-feed-list feedtype.slug %}">View more</a>
{% endif %}
{% if feedtype.items and feedtype.can_self_add %}
or
{% endif %}
{% if feedtype.can_self_add %}
<a href="{% url community-add-feed feedtype.slug %}">Add your feed</a>
{% endif %}</p>
</div>
{% endfor %}

<hr style="height: 35px; display: block; clear: both; visibility: hidden;" />
<div id="content-secondary">
{% if has_next %}<a href="?page={{ next }}">Earlier posts</a>{% endif %}</p>
</div>

{% endblock %}

0 comments on commit b760ed6

Please sign in to comment.