From: Matthijs Kooijman Date: Tue, 10 Feb 2009 18:01:24 +0000 (+0100) Subject: Merge branch 'production' X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2Fprojects%2Fxerxes.git;a=commitdiff_plain;h=dad2574dc3f0cc1d114a85ac44ef440b5baeeaa8;hp=-c Merge branch 'production' * production: Don't load the uri template tag library. Add the influence url to notification emails. Make the is_public field unchecked by default. --- dad2574dc3f0cc1d114a85ac44ef440b5baeeaa8 diff --combined influences/forms.py index e1a6db3,a060368..db825cc --- a/influences/forms.py +++ b/influences/forms.py @@@ -1,9 -1,7 +1,9 @@@ - from django.forms.fields import CharField + from django.forms.fields import CharField, BooleanField from django.forms.widgets import Textarea +from django.forms.models import ModelMultipleChoiceField from threadedcomments.forms import ThreadedCommentForm from xerxes.tools.forms import ContextModelForm +from xerxes.tools.widgets import DropDownMultiple from models import Influence, Character # @@@ -25,6 -23,7 +25,7 @@@ class InfluenceCommentForm(ThreadedComm class AdminInfluenceCommentForm(ThreadedCommentForm): comment = CharField(widget=Textarea(attrs={'cols' : 80})) + is_public = BooleanField(required=False, initial=False) def __init__(self, *args, **kwargs): super(AdminInfluenceCommentForm, self).__init__(*args, **kwargs) @@@ -67,17 -66,12 +68,17 @@@ def _get_influence_comment_form(allow_m raise Exception("Unsupported configuration") class InfluenceForm(ContextModelForm): + # Manually define this field so we can select the DropDownMultiple + # widget. However, we leave the queryset empty, which characters can + # be selected depends on the logged in user and should be set by + # setting the choices property in the view. + other_characters = ModelMultipleChoiceField(queryset=Character.objects.none(), widget=DropDownMultiple) class Meta: model = Influence - fields = ('character', 'contact', 'summary', 'description') + fields = ('initiator', 'summary', 'other_characters', 'other_contacts', 'description') class CharacterForm(ContextModelForm): class Meta: model = Character - fields = ('name') + fields = ('name', 'type') diff --combined templates/influences/email/influence_changed.html index ac59c93,197aef5..982bf1e --- a/templates/influences/email/influence_changed.html +++ b/templates/influences/email/influence_changed.html @@@ -1,6 -1,5 +1,6 @@@ {% load gapless %}{% gapless %} {% load i18n %} +{% load list %} {% autoescape off %} From: Xerxes (Evolution Events) X-Mailer: Xerxes @@@ -10,25 -9,23 +10,25 @@@ Subject: {% blocktrans %}Influence "{{ Subject: {% blocktrans %}Influence "{{ influence }}" was changed.{% endblocktrans %} {% endif%} \\ -{% if recipients.0.first_name %} -{% blocktrans with recipients.0.first_name as name %}Hello {{ name }}{% endblocktrans %}, +{% if first_name %} +{% blocktrans %}Hello {{ first_name }}{% endblocktrans %}, {% else %} {% trans "L.S." %}, {% endif %} \\ {% filter wordwrap:72 %} {% blocktrans with influence.created|date:"j F Y" as creation_date %} -You have submitted an influence on {{ creation_date }}. +You are involved in this influence, submitted on {{ creation_date }}. {% endblocktrans %} {% if not created %} {% blocktrans %}The influence has been modified. The current status is{%endblocktrans %}:{% else %}{% blocktrans %}You submitted{% endblocktrans%}: {% endif %} {% endfilter %} \\ -{% filter ljust:20%}{% trans "Character" %}:{%endfilter%}{{ influence.character }} -{% filter ljust:20%}{% trans "Contact" %}:{%endfilter%}{{ influence.contact }} +{% filter ljust:20%}{% trans "Iniator" %}:{%endfilter%}{{ influence.initiator }} +{% if influence.involved %} +{% filter ljust:20%}{% trans "Involved" %}:{%endfilter%}{{ influence.involved|natural_list }} +{% endif %} {% filter ljust:20%}{% trans "Summary" %}:{%endfilter%}{{ influence.summary }} {% filter ljust:20%}{% trans "Status" %}:{%endfilter%}{{ influence.get_status_display }} {% if influence.longterm %} @@@ -44,5 -41,9 +44,9 @@@ {{ influence.result }} {% endfilter %} {% endif %} + \\ + \\ + {% trans "View the influence and comments here:" %} + http://xerxes.evolution-events.nl{{ influence.get_absolute_url }} {% endautoescape %} {% endgapless %} diff --combined templates/influences/email/influence_comment_added.html index 656f163,8a2d4a4..d52cce2 --- a/templates/influences/email/influence_comment_added.html +++ b/templates/influences/email/influence_comment_added.html @@@ -5,18 -5,24 +5,24 @@@ From: Xerxes (Evolution Events)