[Mpuls-commits] r5947 - in base/trunk/mpulsweb: controllers i18n i18n/de/LC_MESSAGES

scm-commit at wald.intevation.org scm-commit at wald.intevation.org
Wed Apr 25 12:32:16 CEST 2012


Author: ludwig
Date: 2012-04-25 12:32:16 +0200 (Wed, 25 Apr 2012)
New Revision: 5947

Modified:
   base/trunk/mpulsweb/controllers/casedocument.py
   base/trunk/mpulsweb/controllers/document.py
   base/trunk/mpulsweb/i18n/de/LC_MESSAGES/mpulsweb.po
   base/trunk/mpulsweb/i18n/mpulsweb.pot
Log:
Issue 1101: Delete document or casedocument confirm dialog includes the 
name of the deleted document.


Modified: base/trunk/mpulsweb/controllers/casedocument.py
===================================================================
--- base/trunk/mpulsweb/controllers/casedocument.py	2012-04-25 09:36:23 UTC (rev 5946)
+++ base/trunk/mpulsweb/controllers/casedocument.py	2012-04-25 10:32:16 UTC (rev 5947)
@@ -120,9 +120,20 @@
             return render('/casemanagement/dialogs/'
                           'success_delete_attachment.mako')
         else:
+            docs = listDocuments(session['case'].id)
+            for doc in docs:
+                if int(doc.id) == id:
+                    name = doc.getName()
+                    description = doc.description
+                    break
+            if not name:
+                name = ""
+            if not description:
+                description = ""
+
             c.context = "../main.mako"
             c.confirm_for = _(u"Delete attachment?")
-            c.question = _(u"Do you want to irrevocably delete the attachment?")
+            c.question = _(u"Do you want to irrevocably delete the attachment '%s'?") % name
             c.url_yes = h.url(controller='casedocument', action='delete',
                                   id=id, confirmed=1)
             c.url_no = h.url(controller="casedocument", action="index",

Modified: base/trunk/mpulsweb/controllers/document.py
===================================================================
--- base/trunk/mpulsweb/controllers/document.py	2012-04-25 09:36:23 UTC (rev 5946)
+++ base/trunk/mpulsweb/controllers/document.py	2012-04-25 10:32:16 UTC (rev 5947)
@@ -142,9 +142,21 @@
             c.dialog_text =  _("Please click OK to continue.")
             return render('/documents/dialogs/delete_document_success.mako')
         else:
+            docs = listDocuments()
+
+            for doc in docs:
+                if int(doc.id) == id:
+                    name = doc.getName()
+                    description = doc.description
+                    break
+            if not name:
+                name = ""
+            if not description:
+                description = ""  
+
             c.context = "../main.mako"
             c.dialog_title = _(u"Delete document?")
-            c.dialog_text = _(u"Do you want to delete the document and irrevocably lose the data?")
+            c.dialog_text = _(u"Do you want to delete the document '%s' and irrevocably lose the data?") % name
             c.url_yes = h.url(controller='document',
                                   action='globalDelete', id=id, confirmed=1)
             c.url_no = h.url(controller='document',

Modified: base/trunk/mpulsweb/i18n/de/LC_MESSAGES/mpulsweb.po
===================================================================
--- base/trunk/mpulsweb/i18n/de/LC_MESSAGES/mpulsweb.po	2012-04-25 09:36:23 UTC (rev 5946)
+++ base/trunk/mpulsweb/i18n/de/LC_MESSAGES/mpulsweb.po	2012-04-25 10:32:16 UTC (rev 5947)
@@ -8,7 +8,7 @@
 "Project-Id-Version: mpulsweb 0.0.0\n"
 "Report-Msgid-Bugs-To: EMAIL at ADDRESS\n"
 "POT-Creation-Date: 2012-04-20 15:59+0200\n"
-"PO-Revision-Date: 2012-03-01 12:11+0100\n"
+"PO-Revision-Date: 2012-04-25 12:22+0200\n"
 "Last-Translator: Roland Geider <roland.geider at intevation.de>\n"
 "Language-Team: de <LL at li.org>\n"
 "Plural-Forms: nplurals=2; plural=(n != 1)\n"
@@ -999,16 +999,17 @@
 msgid "Attachment deleted!"
 msgstr "Anlage gelöscht!"
 
-#: mpulsweb/controllers/casedocument.py:124
+#: mpulsweb/controllers/casedocument.py:135
 #: mpulsweb/templates/casemanagement/dialogs/confirm_delete_attachment.mako:6
 msgid "Delete attachment?"
 msgstr "Anlage löschen?"
 
-#: mpulsweb/controllers/casedocument.py:125
-msgid "Do you want to irrevocably delete the attachment?"
+#: mpulsweb/controllers/casedocument.py:136
+#, python-format
+msgid "Do you want to irrevocably delete the attachment '%s'?"
 msgstr ""
-"Wollen Sie die Anlage wirklich löschen und die Daten unwiederbringlich "
-"verlieren?"
+"Wollen Sie die Anlage '%s' wirklich löschen und die Daten "
+"unwiederbringlich verlieren?"
 
 #: mpulsweb/controllers/document.py:98
 msgid "Document added!"
@@ -1023,11 +1024,12 @@
 msgid "Delete document?"
 msgstr "Dokument löschen?"
 
-#: mpulsweb/controllers/document.py:147
-msgid "Do you want to delete the document and irrevocably lose the data?"
+#: mpulsweb/controllers/document.py:159
+#, python-format
+msgid "Do you want to delete the document '%s' and irrevocably lose the data?"
 msgstr ""
-"Wollen Sie wirklich das Dokument löschen und die Daten unwiederbringlich "
-"verlieren?"
+"Wollen Sie wirklich das Dokument '%s' löschen und die Daten "
+"unwiederbringlich verlieren?"
 
 #: mpulsweb/controllers/evaluate.py:345
 msgid "Error: Evaluation failed"

Modified: base/trunk/mpulsweb/i18n/mpulsweb.pot
===================================================================
--- base/trunk/mpulsweb/i18n/mpulsweb.pot	2012-04-25 09:36:23 UTC (rev 5946)
+++ base/trunk/mpulsweb/i18n/mpulsweb.pot	2012-04-25 10:32:16 UTC (rev 5947)
@@ -832,13 +832,14 @@
 msgid "Attachment deleted!"
 msgstr ""
 
-#: mpulsweb/controllers/casedocument.py:124
+#: mpulsweb/controllers/casedocument.py:135
 #: mpulsweb/templates/casemanagement/dialogs/confirm_delete_attachment.mako:6
 msgid "Delete attachment?"
 msgstr ""
 
-#: mpulsweb/controllers/casedocument.py:125
-msgid "Do you want to irrevocably delete the attachment?"
+#: mpulsweb/controllers/casedocument.py:136
+#, python-format
+msgid "Do you want to irrevocably delete the attachment '%s'?"
 msgstr ""
 
 #: mpulsweb/controllers/document.py:98
@@ -854,8 +855,9 @@
 msgid "Delete document?"
 msgstr ""
 
-#: mpulsweb/controllers/document.py:147
-msgid "Do you want to delete the document and irrevocably lose the data?"
+#: mpulsweb/controllers/document.py:159
+#, python-format
+msgid "Do you want to delete the document '%s' and irrevocably lose the data?"
 msgstr ""
 
 #: mpulsweb/controllers/evaluate.py:345



More information about the Mpuls-commits mailing list