aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Kellermann <Benjamin.Kellermann@gmx.de>2010-12-03 15:17:59 +0100
committerBenjamin Kellermann <Benjamin.Kellermann@gmx.de>2010-12-03 15:17:59 +0100
commitdccd3af9d67ae1f3ef13f46c03e61678d57169db (patch)
tree3598b55b663b511ba97e5ee55c8010928142d1d5
parent7b629538e7e3d806307e83e3d5c7cdd2c770b42c (diff)
use redirect to overcome the problem of reload after vote
-rw-r--r--locale/cs/dudle.po11
-rw-r--r--locale/de/dudle.po12
-rw-r--r--locale/sv/dudle.po11
-rwxr-xr-xparticipate.rb32
4 files changed, 42 insertions, 24 deletions
diff --git a/locale/cs/dudle.po b/locale/cs/dudle.po
index 81528ae..aaa43f4 100644
--- a/locale/cs/dudle.po
+++ b/locale/cs/dudle.po
@@ -19,7 +19,7 @@
msgid ""
msgstr ""
"Project-Id-Version: \n"
-"POT-Creation-Date: 2010-10-25 21:51+0200\n"
+"POT-Creation-Date: 2010-12-03 15:13+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: Benjamin Kellermann <Benjamin.Kellermann@tu-dresden.de>\n"
"Language-Team: \n"
@@ -549,9 +549,9 @@ msgstr "K hlasovacímu rozhraní"
msgid "Link to dudle poll about %{polltitle}"
msgstr "Odkaz k dudle hlasování o %{polltitle}"
-#: participate.rb:48
-msgid "Reload"
-msgstr "Obnovit"
+#: participate.rb:59
+msgid "The changes were saved, you should be redirected to %{link}."
+msgstr ""
#: poll.rb:86
#, fuzzy
@@ -721,5 +721,8 @@ msgstr "Přidat"
msgid "e.&thinsp;g., 09:30, morning, afternoon"
msgstr "např. 09:30, ráno, odpoledne"
+#~ msgid "Reload"
+#~ msgstr "Obnovit"
+
#~ msgid "Delete User"
#~ msgstr "Vymaž Uživatele"
diff --git a/locale/de/dudle.po b/locale/de/dudle.po
index 2acef90..d139c4b 100644
--- a/locale/de/dudle.po
+++ b/locale/de/dudle.po
@@ -19,8 +19,8 @@
msgid ""
msgstr ""
"Project-Id-Version: \n"
-"POT-Creation-Date: 2010-10-25 21:51+0200\n"
-"PO-Revision-Date: 2010-10-25 21:51+0100\n"
+"POT-Creation-Date: 2010-12-03 15:13+0100\n"
+"PO-Revision-Date: 2010-12-03 15:14+0100\n"
"Last-Translator: Benjamin Kellermann <Benjamin.Kellermann@tu-dresden.de>\n"
"Language-Team: \n"
"Language: \n"
@@ -551,9 +551,9 @@ msgstr "Zur Abstimmung"
msgid "Link to dudle poll about %{polltitle}"
msgstr "Dudle Umfrage über %{polltitle}"
-#: participate.rb:48
-msgid "Reload"
-msgstr "Neu laden"
+#: participate.rb:59
+msgid "The changes were saved, you should be redirected to %{link}."
+msgstr "Die Änderungen wurden gespeichert. Sie sollten zu %{link} weitergeleitet werden."
#: poll.rb:86
msgid "Edit user %{user}..."
@@ -714,6 +714,8 @@ msgstr "Hinzufügen"
msgid "e.&thinsp;g., 09:30, morning, afternoon"
msgstr "z.B., 9:30, morgens, abends"
+#~ msgid "Reload"
+#~ msgstr "Neu laden"
#~ msgid "Delete %{user}?"
#~ msgstr "Lösche Teilnehmer %{user}?"
#~ msgid "Edit Column"
diff --git a/locale/sv/dudle.po b/locale/sv/dudle.po
index e35a8a0..1deb460 100644
--- a/locale/sv/dudle.po
+++ b/locale/sv/dudle.po
@@ -19,7 +19,7 @@
msgid ""
msgstr ""
"Project-Id-Version: \n"
-"POT-Creation-Date: 2010-10-25 21:51+0200\n"
+"POT-Creation-Date: 2010-12-03 15:13+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: Benjamin Kellermann <Benjamin.Kellermann@tu-dresden.de>\n"
"Language-Team: \n"
@@ -549,9 +549,9 @@ msgstr "Till gränssnittet för röstning"
msgid "Link to dudle poll about %{polltitle}"
msgstr "Länk till dudle omröstning om %{polltitle}"
-#: participate.rb:48
-msgid "Reload"
-msgstr "Ladda om"
+#: participate.rb:59
+msgid "The changes were saved, you should be redirected to %{link}."
+msgstr ""
#: poll.rb:86
#, fuzzy
@@ -720,6 +720,9 @@ msgstr "Lägg till"
msgid "e.&thinsp;g., 09:30, morning, afternoon"
msgstr "t ex 09:30, morgon, eftermiddag"
+#~ msgid "Reload"
+#~ msgstr "Ladda om"
+
#, fuzzy
#~ msgid "Delete %{user}?"
#~ msgstr "Redigera användare %{user}"
diff --git a/participate.rb b/participate.rb
index ff7da89..5153f0d 100755
--- a/participate.rb
+++ b/participate.rb
@@ -24,9 +24,11 @@ if __FILE__ == $0
load "../dudle.rb"
$d = Dudle.new
+edit = false
unless $cgi.include?("cancel")
if $cgi.include?("delete_participant_confirm")
$d.table.delete($cgi["delete_participant_confirm"])
+ edit = true
elsif $cgi.include?("add_participant")
agreed = {}
$cgi.params.each{|k,v|
@@ -36,23 +38,29 @@ unless $cgi.include?("cancel")
}
$d.table.add_participant($cgi["olduser"],$cgi["add_participant"],agreed)
+ edit = true
end
end
-$d.table.add_comment($cgi["commentname"],$cgi["comment"]) if $cgi["comment"] != ""
-$d.table.delete_comment($cgi["delete_comment"]) if $cgi.include?("delete_comment")
+if $cgi["comment"] != ""
+ $d.table.add_comment($cgi["commentname"],$cgi["comment"])
+ edit = true
+end
+if $cgi.include?("delete_comment")
+ $d.table.delete_comment($cgi["delete_comment"])
+ edit = true
+end
-$d.html.add_atom("atom.cgi") if File.exists?("../atom.rb")
+if edit
+ $d.html.header["status"] = "REDIRECT"
+ $d.html.header["Cache-Control"] = "no-cache"
+ $d.html.header["Location"] = SITEURL
+ $d << _("The changes were saved, you should be redirected to %{link}.") % {:link => "<a href=\"#{SITEURL}\">#{SITEURL}</a>"}
-reloadstr = _("Reload")
-$d << <<END
-<form method='get' action='.'>
-<div>
-<input value='#{reloadstr}' type='submit'/>
-</div>
-</form>
-END
+else
+
+$d.html.add_atom("atom.cgi") if File.exists?("../atom.rb")
# TABLE
$d << <<HTML
@@ -65,5 +73,7 @@ $d << <<HTML
#{$d.table.comment_to_html}
HTML
+end
+
$d.out
end