aboutsummaryrefslogtreecommitdiff
path: root/index.cgi
diff options
context:
space:
mode:
authorBenjamin Kellermann <Benjamin.Kellermann@gmx.de>2009-10-24 20:08:49 +0200
committerBenjamin Kellermann <Benjamin.Kellermann@gmx.de>2009-10-24 20:08:49 +0200
commitc129cac09529ee809158e4f05c7d03df1c6ebafb (patch)
treeb8a27439008c1bc3c4e6f0b5d26f1cd174b64ef7 /index.cgi
parent2ede797c5c499b3a81944338ac6211daa374986e (diff)
remove hidden polls -> all polls are hidden
Diffstat (limited to 'index.cgi')
-rwxr-xr-xindex.cgi26
1 files changed, 8 insertions, 18 deletions
diff --git a/index.cgi b/index.cgi
index 427d374..be4f0a6 100755
--- a/index.cgi
+++ b/index.cgi
@@ -72,28 +72,17 @@ if $cgi.include?("create_poll")
TimePoll.new SITE
end
Dir.chdir("..")
+ createnotice = <<SUCCESS
+<div class='success'>
+ The poll was created successfully. The link to your new poll is:<br />
+ <a href='#{SITEURL}#{SITE}'>#{SITEURL}#{SITE}</a>
+</div>
+SUCCESS
else
- $htmlout += "<fieldset><legend>Error</legend>This poll already exists!</fieldset>"
+ createnotice = "<div class='error'>Error: This poll already exists!</div>"
end
end
-$htmlout += "<fieldset><legend>Available Polls</legend>"
-$htmlout += "<table><tr><th>Poll</th><th>Last change</th></tr>"
-Dir.glob("*/data.yaml").sort_by{|f|
- File.new(f).mtime
-}.reverse.collect{|f|
- f.gsub(/\/data\.yaml$/,'')
-}.each{|site|
- unless YAML::load_file("#{site}/data.yaml").hidden
- $htmlout += "<tr>"
- $htmlout += "<td class='polls'><a href='./#{CGI.escapeHTML(site).gsub("'","%27")}/'>#{CGI.escapeHTML(site)}</a></td>"
- $htmlout += "<td class='mtime'>#{File.new(site + "/data.yaml").mtime.strftime('%d.%m, %H:%M')}</td>"
- $htmlout += "</tr>"
- end
-}
-$htmlout += "</table>"
-$htmlout += "</fieldset>"
-
$htmlout += <<CREATE
<fieldset><legend>Create new Poll</legend>
<form method='post' action='.'>
@@ -110,6 +99,7 @@ $htmlout += <<CREATE
</tr>
</table>
</form>
+#{createnotice}
</fieldset>
CREATE