- 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
#
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)
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')
{% load gapless %}{% gapless %}
{% load i18n %}
+{% load list %}
{% autoescape off %}
From: Xerxes (Evolution Events)<xerxes@evolution-events.nl>
X-Mailer: Xerxes
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 %}
{{ influence.result }}
{% endfilter %}
{% endif %}
+ \\
+ \\
+ {% trans "View the influence and comments here:" %}
+ http://xerxes.evolution-events.nl{{ influence.get_absolute_url }}
{% endautoescape %}
{% endgapless %}
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 %}