summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2008-07-22 19:58:34 -0400
committerJoey Hess <joey@kodama.kitenet.net>2008-07-22 19:58:34 -0400
commitd76c10cba24c2bea026facb2a9e5e3215d7f3994 (patch)
tree3a35deb647834ae1e00487b4cfef95a7e8921b50
parent2b9615194e0adefa0f61810405db1e9204ccc72b (diff)
Split out error messages from editpage.tmpl into several separate templates.
-rw-r--r--IkiWiki/CGI.pm13
-rw-r--r--debian/changelog2
-rw-r--r--po/ikiwiki.pot107
-rw-r--r--templates/editconflict.tmpl7
-rw-r--r--templates/editcreationconflict.tmpl9
-rw-r--r--templates/editfailedsave.tmpl10
-rw-r--r--templates/editpage.tmpl42
-rw-r--r--templates/editpagegone.tmpl7
8 files changed, 134 insertions, 63 deletions
diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm
index d805506aa..287b1f5aa 100644
--- a/IkiWiki/CGI.pm
+++ b/IkiWiki/CGI.pm
@@ -365,6 +365,7 @@ sub cgi_editpage ($$) { #{{{
htmllink($page, $page, "ikiwiki/formatting",
noimageinline => 1,
linktext => "FormattingHelp"));
+ $form->tmpl_param("message", "");
if ($form->submitted eq "Cancel") {
if ($form->field("do") eq "create" && defined $from) {
@@ -416,7 +417,6 @@ sub cgi_editpage ($$) { #{{{
elsif ($form->submitted eq "Save Page") {
$form->tmpl_param("page_preview", "");
}
- $form->tmpl_param("page_conflict", "");
if ($form->submitted ne "Save Page" || ! $form->validate) {
if ($form->field("do") eq "create") {
@@ -532,7 +532,7 @@ sub cgi_editpage ($$) { #{{{
if ($form->field("do") ne "create" && ! $exists &&
! defined srcfile($file, 1)) {
- $form->tmpl_param("page_gone", 1);
+ $form->tmpl_param("message", template("editpagegone.tmpl")->output);
$form->field(name => "do", value => "create", force => 1);
$form->tmpl_param("page_select", 0);
$form->field(name => "page", type => 'hidden');
@@ -542,7 +542,7 @@ sub cgi_editpage ($$) { #{{{
return;
}
elsif ($form->field("do") eq "create" && $exists) {
- $form->tmpl_param("creation_conflict", 1);
+ $form->tmpl_param("message", template("editcreationconflict.tmpl")->output);
$form->field(name => "do", value => "edit", force => 1);
$form->tmpl_param("page_select", 0);
$form->field(name => "page", type => 'hidden');
@@ -575,8 +575,9 @@ sub cgi_editpage ($$) { #{{{
if ($@) {
$form->field(name => "rcsinfo", value => rcs_prepedit($file),
force => 1);
- $form->tmpl_param("failed_save", 1);
- $form->tmpl_param("error_message", $@);
+ my $mtemplate=template("editfailedsave.tmpl");
+ $mtemplate->param(error_message => $@);
+ $form->tmpl_param("message", $mtemplate->output);
$form->field("editcontent", value => $content, force => 1);
$form->tmpl_param("page_select", 0);
$form->field(name => "page", type => 'hidden');
@@ -620,7 +621,7 @@ sub cgi_editpage ($$) { #{{{
if (defined $conflict) {
$form->field(name => "rcsinfo", value => rcs_prepedit($file),
force => 1);
- $form->tmpl_param("page_conflict", 1);
+ $form->tmpl_param("message", template("editconflict.tmpl")->output);
$form->field("editcontent", value => $conflict, force => 1);
$form->field("do", "edit", force => 1);
$form->tmpl_param("page_select", 0);
diff --git a/debian/changelog b/debian/changelog
index 57bf4a356..57a36eeec 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -19,6 +19,8 @@ ikiwiki (2.55) UNRELEASED; urgency=low
some situations.
* Don't allow uploading an attachment with the same name as an existing
page, to avoid confusion.
+ * Split out error messages from editpage.tmpl into several separate
+ templates.
-- Joey Hess <joeyh@debian.org> Mon, 21 Jul 2008 11:35:46 -0400
diff --git a/po/ikiwiki.pot b/po/ikiwiki.pot
index c00242df7..621bfdd4d 100644
--- a/po/ikiwiki.pot
+++ b/po/ikiwiki.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2008-07-21 10:11-0400\n"
+"POT-Creation-Date: 2008-07-22 19:44-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -62,16 +62,16 @@ msgid "creating %s"
msgstr ""
#: ../IkiWiki/CGI.pm:512 ../IkiWiki/CGI.pm:540 ../IkiWiki/CGI.pm:550
-#: ../IkiWiki/CGI.pm:584 ../IkiWiki/CGI.pm:629
+#: ../IkiWiki/CGI.pm:586 ../IkiWiki/CGI.pm:631
#, perl-format
msgid "editing %s"
msgstr ""
-#: ../IkiWiki/CGI.pm:729
+#: ../IkiWiki/CGI.pm:731
msgid "You are banned."
msgstr ""
-#: ../IkiWiki/CGI.pm:758 ../IkiWiki/CGI.pm:759 ../IkiWiki.pm:783
+#: ../IkiWiki/CGI.pm:760 ../IkiWiki/CGI.pm:761 ../IkiWiki.pm:783
msgid "Error"
msgstr ""
@@ -173,15 +173,20 @@ msgstr ""
msgid "Failed to delete file from S3: "
msgstr ""
-#: ../IkiWiki/Plugin/attachment.pm:110
-msgid "bad attachment filename"
+#: ../IkiWiki/Plugin/attachment.pm:22
+#, perl-format
+msgid "there is already a page named %s"
+msgstr ""
+
+#: ../IkiWiki/Plugin/attachment.pm:41
+msgid "prohibited by allowed_attachments"
msgstr ""
-#: ../IkiWiki/Plugin/attachment.pm:133
-msgid "attachment rejected"
+#: ../IkiWiki/Plugin/attachment.pm:144
+msgid "bad attachment filename"
msgstr ""
-#: ../IkiWiki/Plugin/attachment.pm:169
+#: ../IkiWiki/Plugin/attachment.pm:186
msgid "attachment upload"
msgstr ""
@@ -232,27 +237,27 @@ msgstr ""
msgid "prog not a valid graphviz program"
msgstr ""
-#: ../IkiWiki/Plugin/img.pm:49
+#: ../IkiWiki/Plugin/img.pm:53
msgid "Image::Magick is not installed"
msgstr ""
-#: ../IkiWiki/Plugin/img.pm:56
+#: ../IkiWiki/Plugin/img.pm:60
#, perl-format
msgid "bad size \"%s\""
msgstr ""
-#: ../IkiWiki/Plugin/img.pm:66 ../IkiWiki/Plugin/img.pm:70
-#: ../IkiWiki/Plugin/img.pm:87
+#: ../IkiWiki/Plugin/img.pm:70 ../IkiWiki/Plugin/img.pm:74
+#: ../IkiWiki/Plugin/img.pm:91
#, perl-format
msgid "failed to read %s: %s"
msgstr ""
-#: ../IkiWiki/Plugin/img.pm:73
+#: ../IkiWiki/Plugin/img.pm:77
#, perl-format
msgid "failed to resize: %s"
msgstr ""
-#: ../IkiWiki/Plugin/img.pm:104
+#: ../IkiWiki/Plugin/img.pm:108
#, perl-format
msgid "failed to determine size of image %s"
msgstr ""
@@ -496,6 +501,76 @@ msgstr ""
msgid "(Diff truncated)"
msgstr ""
+#: ../IkiWiki/Plugin/remove.pm:23 ../IkiWiki/Plugin/rename.pm:26
+#, perl-format
+msgid "%s does not exist"
+msgstr ""
+
+#: ../IkiWiki/Plugin/remove.pm:30
+#, perl-format
+msgid "%s is not in the srcdir, so it cannot be deleted"
+msgstr ""
+
+#: ../IkiWiki/Plugin/remove.pm:33 ../IkiWiki/Plugin/rename.pm:35
+#, perl-format
+msgid "%s is not a file"
+msgstr ""
+
+#: ../IkiWiki/Plugin/remove.pm:100
+#, perl-format
+msgid "confirm removal of %s"
+msgstr ""
+
+#: ../IkiWiki/Plugin/remove.pm:136
+msgid "Please select the attachments to remove."
+msgstr ""
+
+#: ../IkiWiki/Plugin/remove.pm:176
+msgid "removed"
+msgstr ""
+
+#: ../IkiWiki/Plugin/rename.pm:32
+#, perl-format
+msgid "%s is not in the srcdir, so it cannot be renamed"
+msgstr ""
+
+#: ../IkiWiki/Plugin/rename.pm:47
+msgid "no change to the file name was specified"
+msgstr ""
+
+#: ../IkiWiki/Plugin/rename.pm:53
+#, perl-format
+msgid "illegal name"
+msgstr ""
+
+#: ../IkiWiki/Plugin/rename.pm:58
+#, perl-format
+msgid "%s already exists"
+msgstr ""
+
+#: ../IkiWiki/Plugin/rename.pm:64
+#, perl-format
+msgid "%s already exists on disk"
+msgstr ""
+
+#: ../IkiWiki/Plugin/rename.pm:98
+#, perl-format
+msgid "rename %s"
+msgstr ""
+
+#: ../IkiWiki/Plugin/rename.pm:181
+msgid "Only one attachment can be renamed at a time."
+msgstr ""
+
+#: ../IkiWiki/Plugin/rename.pm:184
+msgid "Please select the attachment to rename."
+msgstr ""
+
+#: ../IkiWiki/Plugin/rename.pm:229
+#, perl-format
+msgid "rename %s to %s"
+msgstr ""
+
#: ../IkiWiki/Plugin/search.pm:20
#, perl-format
msgid "Must specify %s when using the search plugin"
@@ -608,7 +683,7 @@ msgstr ""
msgid "failed to generate image from code"
msgstr ""
-#: ../IkiWiki/Rcs/Stub.pm:69
+#: ../IkiWiki/Rcs/Stub.pm:96
msgid "getctime not implemented"
msgstr ""
diff --git a/templates/editconflict.tmpl b/templates/editconflict.tmpl
new file mode 100644
index 000000000..125203395
--- /dev/null
+++ b/templates/editconflict.tmpl
@@ -0,0 +1,7 @@
+<p class="error">
+<b>Your changes conflict with other changes made to the page.</b>
+</p>
+<p>
+Conflict markers have been inserted into the page content. Reconcile the
+conflict and commit again to save your changes.
+</p>
diff --git a/templates/editcreationconflict.tmpl b/templates/editcreationconflict.tmpl
new file mode 100644
index 000000000..c99102f0d
--- /dev/null
+++ b/templates/editcreationconflict.tmpl
@@ -0,0 +1,9 @@
+<p class="error">
+<b>While you were creating this page, someone else independently created a page
+with the same name.</b>
+</p>
+<p>
+The edit box below contains the page's current content, followed by the
+content you entered previously, to allow you to merge the two
+together before saving.
+</p>
diff --git a/templates/editfailedsave.tmpl b/templates/editfailedsave.tmpl
new file mode 100644
index 000000000..5184f7d4d
--- /dev/null
+++ b/templates/editfailedsave.tmpl
@@ -0,0 +1,10 @@
+<p class="error">
+<b>Failed to save your changes.</b>
+</p>
+<p>
+Your changes were not able to be saved to disk. The system gave the error:
+<blockquote>
+<TMPL_VAR ERROR_MESSAGE>
+</blockquote>
+Your changes are preserved below, and you can try again to save them.
+</p>
diff --git a/templates/editpage.tmpl b/templates/editpage.tmpl
index 1c30d1d85..4b54db2d1 100644
--- a/templates/editpage.tmpl
+++ b/templates/editpage.tmpl
@@ -1,46 +1,6 @@
<br />
<TMPL_VAR JAVASCRIPT>
-<TMPL_IF NAME="PAGE_CONFLICT">
-<p>
-<b>Your changes conflict with other changes made to the page.</b>
-</p>
-<p>
-Conflict markers have been inserted into the page content. Reconcile the
-conflict and commit again to save your changes.
-</p>
-</TMPL_IF>
-<TMPL_IF NAME="FAILED_SAVE">
-<p>
-<b>Failed to save your changes.</b>
-</p>
-<p>
-Your changes were not able to be saved to disk. The system gave the error:
-<blockquote>
-<TMPL_VAR ERROR_MESSAGE>
-</blockquote>
-Your changes are preserved below, and you can try again to save them.
-</p>
-</TMPL_IF>
-<TMPL_IF NAME="PAGE_GONE">
-<p>
-<b>The page you were editing has disappeared.</b>
-</p>
-<p>
-Perhaps someone else has deleted it or moved it. If you want to recreate
-this page with your text, click "Save Page" again.
-</p>
-</TMPL_IF>
-<TMPL_IF NAME="CREATION_CONFLICT">
-<p>
-<b>While you were creating this page, someone else independently created a page
-with the same name.</b>
-</p>
-<p>
-The edit box below contains the page's current content, followed by the
-content you entered previously, to allow you to merge the two
-together before saving.
-</p>
-</TMPL_IF>
+<TMPL_VAR MESSAGE>
<TMPL_VAR FORM-START>
<TMPL_VAR FIELD-DO>
<TMPL_VAR FIELD-SID>
diff --git a/templates/editpagegone.tmpl b/templates/editpagegone.tmpl
new file mode 100644
index 000000000..2eed03af4
--- /dev/null
+++ b/templates/editpagegone.tmpl
@@ -0,0 +1,7 @@
+<p class="error">
+<b>The page you were editing has disappeared.</b>
+</p>
+<p>
+Perhaps someone else has deleted it or moved it. If you want to recreate
+this page with your text, click "Save Page" again.
+</p>