@login_required
def influence_list(request):
- # Only show this player's influences
- os = Influence.objects.filter(initiator__player=request.user)
- return render_to_response('influences/influence_list.html', {'object_list' : os}, RequestContext(request))
+ # Only show the influences related to this player's characters
+ characters = request.user.character_set.all()
+ return render_to_response('influences/influence_list.html', {'characters' : characters}, RequestContext(request))
def influence_comment_preview(request, context_processors, extra_context, **kwargs):
# Use a custom template
{% load i18n %}
+{# Note that this template looks quite like character_detail_block, it is #}
+{# still different enough to not try and factor out the common parts #}
+{# currently... #}
+
<h1>{% trans "Your influences" %}</h1>
-{% if object_list %}
- <ul>
- {% for influence in object_list %}
- <li><a href="{% url influences_influence_detail influence.id %}">{{influence.contact }} -- {{ influence.summary }}</a></li>
- {% endfor %}
- </ul>
+{% if characters %}
+ {% for character in characters %}
+ <h2>{{ character.name }}</h2>
+ {% if character.initiated_influences.all or character.influences_involved_in.all %}
+ {% if character.initiated_influences.all %}
+ <p>{% blocktrans with character.name as name %}Influences initiated by {{ name }}:{% endblocktrans %}</p>
+ <ul>
+ {% for influence in character.initiated_influences.all %}
+ <li><a href="{% url influences_influence_detail influence.id %}">{{influence.contact }} -- {{ influence.summary }}</a></li>
+ {% endfor %}
+ </ul>
+ {% endif %}
+ {% if character.influences_involved_in.all %}
+ <p>{% blocktrans with character.name as name %}Influences {{ name }} is involved in:{% endblocktrans %}</p>
+ <ul>
+ {% for influence in character.influences_involved_in.all %}
+ <li><a href="{% url influences_influence_detail influence.id %}">{{influence.contact }} -- {{ influence.summary }}</a></li>
+ {% endfor %}
+ </ul>
+ {% endif %}
+ {% else %}
+ <p>{% trans "No influences yet." %}</p>
+ {% endif %}
+ {% endfor %}
{% else %}
- <p>{% trans "No influences yet." %}</p>
+ <p>{% trans "No characters. Add a character first, so you can submit your influences." %}</p>
{% endif %}
<p><a href="{% url influences_add_influence %}">{% trans "Submit influence" %}</a></p>