Add a Influences.type field (Influence / Notification).
authorMatthijs Kooijman <matthijs@stdin.nl>
Sat, 13 Feb 2010 12:02:44 +0000 (13:02 +0100)
committerMatthijs Kooijman <matthijs@stdin.nl>
Sat, 13 Feb 2010 12:02:44 +0000 (13:02 +0100)
influences/admin.py
influences/forms.py
influences/models.py
locale/nl/LC_MESSAGES/django.po
templates/influences/influence_detail.html
templates/influences/influence_list_block.html

index 4e3b966d1c12046e9e275d504c4e06d47db9fbab..ed4806b678abb8ec45f4c9e0a1215db026bf5650 100644 (file)
@@ -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')
index a060368380e41b1eb1fd3cfed39c965b7d2108c9..754a2192a85927944091734d7e9433c151ec22bc 100644 (file)
@@ -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:
index 6464e683deb20a1277c4cdf2537a4be5661640b8..10470b55aaff1a375bda1f837308e16560a7ec27 100644 (file)
@@ -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"))
index 1e4cf13dd3ad765af5e76feaa9fabba6f91b820a..4bdc2f8772c1e2da41e44780b3f8383c1fc76153 100644 (file)
@@ -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 <matthijs@stdin.nl>\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."
 
index 8bddb9cd16b4a7b6972542b0b26a2ca80770edc1..398b051cdd0b3722c9b2747acedc137ad8b1440b 100644 (file)
@@ -2,7 +2,7 @@
 {% load i18n %}
 
 {% block content %}
-<h1>{{ object.summary }}</h1>
+<h1>{{ object.get_type_display }}: {{ object.summary }}</h1>
 <table>
 <tr><td>{% trans "Contact" %}:</td><td>{{ object.contact }}</td></tr>
 <tr><td>{% trans "Character" %}:</td><td><a href="{% url influences_character_detail object.character.id %}">{{ object.character }}</a></td></tr>
index e59216f65f9d848a014e234e2de6352ffece8be8..2f9b445666bb6245f2c04842f617a66510071530 100644 (file)
@@ -4,7 +4,8 @@
 {% if object_list %}
        <ul>
        {% for influence in object_list %}
-        <li><a href="{% url influences_influence_detail influence.id %}">{{influence.contact }} -- {{ influence.summary }}</a></li>
+        <li><a href="{% url influences_influence_detail influence.id
+                       %}">{{influence.get_type_display}}: {{influence.contact }} -- {{ influence.summary }}</a></li>
        {% endfor %}
        </ul>
 {% else %}