Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

template indentation and handling "or" booleans

Specifically, ensuring that "or" only appears when both a feed can be
added to *and* it has more items.
  • Loading branch information...
commit b760ed62e0bc0e6e7e424826b477b3b7296ad91b 1 parent 7100145
@justinabrahms justinabrahms authored
Showing with 12 additions and 9 deletions.
  1. +12 −9 django_website/templates/aggregator/index.html
View
21 django_website/templates/aggregator/index.html
@@ -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 %}
Please sign in to comment.
Something went wrong with that request. Please try again.