Improve character_detail_block template.
authorMatthijs Kooijman <matthijs@stdin.nl>
Fri, 16 Jan 2009 22:12:11 +0000 (23:12 +0100)
committerMatthijs Kooijman <matthijs@stdin.nl>
Fri, 16 Jan 2009 22:12:11 +0000 (23:12 +0100)
The character detail now only shows the influence headings when there is
something to show.

templates/influences/character_detail_block.html

index b0211d7bf479ded7f8f85bb5ae68e7c984a94d27..ae325f2486dfe42a151e78e305fdd0c645de8bb7 100644 (file)
@@ -6,18 +6,25 @@
 <em>{% trans "This character is approved by the SLs" %}</em>
 {% endifequal %}
 
-<h2>{% blocktrans with object.name as name %}Influences initiated by {{ name }}{% endblocktrans %}</h2>
-<ul>
-{% for influence in object.initiated_influences.all %}
-       <li><a href="{% url influences_influence_detail influence.pk %}">{{ influence }}</a></li>
-{% endfor %}
-</ul>
-
-<h2>{% blocktrans with object.name as name %}Influences {{ name }} is involved in{% endblocktrans %}</h2>
-<ul>
-{% for influence in object.influences_involved_in.all %}
-       <li><a href="{% url influences_influence_detail influence.pk %}">{{ influence }}</a></li>
-{% endfor %}
-</ul>
+{% if object.initiated_influences.all or object.influences_involved_in.all %}
+    {% if object.initiated_influences.all %}
+        <h2>{% blocktrans with object.name as name %}Influences initiated by {{ name }}{% endblocktrans %}</h2>
+        <ul>
+        {% for influence in object.initiated_influences.all %}
+            <li><a href="{% url influences_influence_detail influence.pk %}">{{ influence }}</a></li>
+        {% endfor %}
+        </ul>
+    {% endif %}
+    {% if object.influences_involved_in.all %}
+        <h2>{% blocktrans with object.name as name %}Influences {{ name }} is involved in{% endblocktrans %}</h2>
+        <ul>
+        {% for influence in object.influences_involved_in.all %}
+            <li><a href="{% url influences_influence_detail influence.pk %}">{{ influence }}</a></li>
+        {% endfor %}
+        </ul>
+    {% endif %}
+{% else %}
+    <p>{% trans "No influences yet." %}</p>
+{% endif %}
 
 <a href="{% url influences_add_influence_for_character object.id %}">{% trans "Submit influence" %}</a>