From 393b80ed66f10a7670d1022361b063fe0118e746 Mon Sep 17 00:00:00 2001 From: Benjamin Kellermann Date: Fri, 20 Nov 2009 13:34:14 +0100 Subject: added sample for showing all available polls --- config_sample.rb | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'config_sample.rb') diff --git a/config_sample.rb b/config_sample.rb index 358b443..371db2a 100644 --- a/config_sample.rb +++ b/config_sample.rb @@ -23,13 +23,31 @@ load "bzr.rb" # Change this if the url is not determined correctly SITEURL = "http://#{$cgi.server_name}#{$cgi.script_name.gsub(/[^\/]*$/,"")}" -# add this htmlcode to the startpage -NOTICE = <Available Polls + +NOTICE +Dir.glob("*/data.yaml").sort_by{|f| + File.new(f).mtime +}.reverse.collect{|f| f.gsub(/\/data\.yaml$/,'') }.each{|site| + notice += < + + + +NOTICE +} +notice += "
PollLast change
#{CGI.escapeHTML(site)}#{File.new(site + "/data.yaml").mtime.strftime('%d.%m, %H:%M')}
" +# Example 2: displays a static text +notice += <Examples If you want to play around with the Tool, you may want to take a look at these two Example Polls:
Event Schedule Poll
Normal Poll NOTICE +NOTICE = notice -- cgit v1.2.3