Merge branch 'production'
authorMatthijs Kooijman <matthijs@stdin.nl>
Tue, 10 Feb 2009 18:01:24 +0000 (19:01 +0100)
committerMatthijs Kooijman <matthijs@stdin.nl>
Tue, 10 Feb 2009 18:01:24 +0000 (19:01 +0100)
* production:
  Don't load the uri template tag library.
  Add the influence url to notification emails.
  Make the is_public field unchecked by default.

1  2 
influences/forms.py
templates/influences/email/influence_changed.html
templates/influences/email/influence_comment_added.html

diff --combined influences/forms.py
index e1a6db381f29159742c9aef477491bab3b0e3b63,a060368380e41b1eb1fd3cfed39c965b7d2108c9..db825cc018362760833c0c2e74a44a11c582e8e4
@@@ -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')
  
index ac59c93f60db0062846511b0b7a4dd21b56dbae4,197aef508cb41e148c8c001e5a806d9d01b94083..982bf1ed0cac6f9d04293658ea5c2ffd7a67d91e
@@@ -1,6 -1,5 +1,6 @@@
  {% load gapless %}{% gapless %}
  {% load i18n %}
 +{% load list %}
  {% autoescape off %}
  From: Xerxes (Evolution Events)<xerxes@evolution-events.nl>
  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 %}
index 656f16346caf48434cf98f1da908f96ccf7b3a6c,8a2d4a4ac8d53f4db0475c19304eb3b8c849222d..d52cce2f1908b4095fc3389c071029dfa788622c
@@@ -5,18 -5,24 +5,24 @@@ From: Xerxes (Evolution Events)<xerxes@
  X-Mailer: Xerxes
  Subject: {% blocktrans %}Comment added to influence "{{ influence }}".{% endblocktrans %}
  \\
 -{% 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 %}
 -{{commenter}} has just commented the following on your influence:
 +{{commenter}} has just commented the following on an influence you are involved in:
  {% endblocktrans %}
  \\
  {{comment.comment}}
  {% endfilter %}
+ \\
+ \\
+ {# This is ugly and hardcoded, but we don't have access to the request #}
+ {# when notifying currently, so this should do for now. #}
+ {% trans "View the influence and comments here:" %}
+ http://xerxes.evolution-events.nl{{ influence.get_absolute_url }}
  {% endautoescape %}
  {% endgapless %}