From dc7fe78206756cecc85a3d3271e455c4d1e0cc76 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Sat, 13 Feb 2010 13:02:44 +0100 Subject: [PATCH] Add a Influences.type field (Influence / Notification). --- influences/admin.py | 4 +- influences/forms.py | 2 +- influences/models.py | 5 +++ locale/nl/LC_MESSAGES/django.po | 44 +++++++++++-------- templates/influences/influence_detail.html | 2 +- .../influences/influence_list_block.html | 3 +- 6 files changed, 37 insertions(+), 23 deletions(-) diff --git a/influences/admin.py b/influences/admin.py index 4e3b966..ed4806b 100644 --- a/influences/admin.py +++ b/influences/admin.py @@ -18,9 +18,9 @@ class CharacterAdmin(admin.ModelAdmin): admin.site.register(Character, CharacterAdmin) class InfluenceAdmin(admin.ModelAdmin): - list_filter=('status', 'longterm', 'todo', 'character') + list_filter=('type', 'status', 'longterm', 'todo', 'character') search_fields=('character', 'summary', 'description', 'contact') - list_display=('character', 'contact', 'summary', 'longterm', 'status') + list_display=('character', 'contact', 'summary', 'longterm', 'status', 'type') class Media: js = ('base/js/yahoo-dom-event.js', 'base/js/logger-debug.js') diff --git a/influences/forms.py b/influences/forms.py index a060368..754a219 100644 --- a/influences/forms.py +++ b/influences/forms.py @@ -68,7 +68,7 @@ def _get_influence_comment_form(allow_markup, allow_public, allow_private): class InfluenceForm(ContextModelForm): class Meta: model = Influence - fields = ('character', 'contact', 'summary', 'description') + fields = ('type', 'character', 'contact', 'summary', 'description') class CharacterForm(ContextModelForm): class Meta: diff --git a/influences/models.py b/influences/models.py index 6464e68..10470b5 100644 --- a/influences/models.py +++ b/influences/models.py @@ -35,9 +35,14 @@ class Influence(models.Model): ('P', _('Processing')), ('D', _('Done')), ) + TYPE_CHOICES = ( + ('I', _('Influence')), + ('N', _('Notifcation')), + ) created = models.DateField(auto_now_add=1, verbose_name = _("Creation time")) modified = models.DateField(auto_now=1, verbose_name = _("Modification time")) + type = models.CharField(max_length=1, choices=TYPE_CHOICES, default='I', verbose_name = _("Type")) character = models.ForeignKey(Character, verbose_name = _("Character")) contact = models.CharField(max_length=255, verbose_name = _("Contact Name")) summary = models.CharField(max_length=255, verbose_name = _("Summary")) diff --git a/locale/nl/LC_MESSAGES/django.po b/locale/nl/LC_MESSAGES/django.po index 1e4cf13..4bdc2f8 100644 --- a/locale/nl/LC_MESSAGES/django.po +++ b/locale/nl/LC_MESSAGES/django.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: 1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-01-13 12:23+0100\n" +"POT-Creation-Date: 2010-02-13 13:01+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Matthijs Kooijman \n" "Language-Team: N/A\n" @@ -83,11 +83,11 @@ msgstr "Nieuw" msgid "Approved" msgstr "Goedgekeurd" -#: influences/models.py:15 influences/models.py:38 +#: influences/models.py:15 influences/models.py:42 msgid "Creation time" msgstr "Aangemaakt op" -#: influences/models.py:16 influences/models.py:39 +#: influences/models.py:16 influences/models.py:43 msgid "Modification time" msgstr "Gewijzigd op" @@ -95,7 +95,7 @@ msgstr "Gewijzigd op" msgid "Name" msgstr "Naam" -#: influences/models.py:18 influences/models.py:46 +#: influences/models.py:18 influences/models.py:51 #: templates/influences/email/character_changed.html:30 #: templates/influences/email/influence_changed.html:30 msgid "Status" @@ -105,7 +105,7 @@ msgstr "Status" msgid "Player" msgstr "Speler" -#: influences/models.py:28 influences/models.py:41 +#: influences/models.py:28 influences/models.py:46 #: templates/influences/influence_detail.html:8 #: templates/influences/email/influence_changed.html:27 msgid "Character" @@ -127,39 +127,47 @@ msgstr "In behandeling" msgid "Done" msgstr "Afgehandeld" -#: influences/models.py:42 +#: influences/models.py:39 influences/models.py:94 +msgid "Influence" +msgstr "Invloed" + +#: influences/models.py:40 +msgid "Notifcation" +msgstr "Kennisgeving" + +#: influences/models.py:45 +msgid "Type" +msgstr "Type" + +#: influences/models.py:47 msgid "Contact Name" msgstr "Naam contactpersoon" -#: influences/models.py:43 +#: influences/models.py:48 #: templates/influences/email/influence_changed.html:29 msgid "Summary" msgstr "Samenvatting" -#: influences/models.py:44 +#: influences/models.py:49 #: templates/influences/email/influence_changed.html:34 msgid "Description" msgstr "Omschrijving" -#: influences/models.py:45 +#: influences/models.py:50 msgid "Todo" msgstr "Todo" -#: influences/models.py:47 templates/influences/influence_detail.html:10 +#: influences/models.py:52 templates/influences/influence_detail.html:10 #: templates/influences/email/influence_changed.html:32 msgid "Long term" msgstr "Lange termijn" -#: influences/models.py:49 templates/influences/influence_detail.html:15 +#: influences/models.py:54 templates/influences/influence_detail.html:15 #: templates/influences/email/influence_changed.html:39 msgid "Result" msgstr "Resultaat" -#: influences/models.py:89 -msgid "Influence" -msgstr "Invloed" - -#: influences/models.py:90 +#: influences/models.py:95 msgid "Influences" msgstr "Invloeden" @@ -270,7 +278,7 @@ msgstr "Toevoegen" #: templates/influences/add_influence.html:6 #: templates/influences/character_detail_block.html:15 -#: templates/influences/influence_list_block.html:14 +#: templates/influences/influence_list_block.html:15 msgid "Submit influence" msgstr "Invloed indienen" @@ -439,7 +447,7 @@ msgstr "Contact" msgid "Your influences" msgstr "Jouw invloeden" -#: templates/influences/influence_list_block.html:11 +#: templates/influences/influence_list_block.html:12 msgid "No influences yet." msgstr "Nog geen invloeden." diff --git a/templates/influences/influence_detail.html b/templates/influences/influence_detail.html index 8bddb9c..398b051 100644 --- a/templates/influences/influence_detail.html +++ b/templates/influences/influence_detail.html @@ -2,7 +2,7 @@ {% load i18n %} {% block content %} -

{{ object.summary }}

+

{{ object.get_type_display }}: {{ object.summary }}

diff --git a/templates/influences/influence_list_block.html b/templates/influences/influence_list_block.html index e59216f..2f9b445 100644 --- a/templates/influences/influence_list_block.html +++ b/templates/influences/influence_list_block.html @@ -4,7 +4,8 @@ {% if object_list %} {% else %} -- 2.30.2
{% trans "Contact" %}:{{ object.contact }}
{% trans "Character" %}:{{ object.character }}