################################ # Author: Benjamin Kellermann # # Licence: CC-by-sa 3.0 # # see Licence # ################################ require "poll" require "datepoll" $htmlout += < dudle HEAD if $cgi.include?("create_poll") SITE=$cgi["create_poll"] unless File.exist?(SITE) Dir.mkdir(SITE) Dir.chdir(SITE) vcs_init File.symlink("../index.cgi","index.cgi") File.symlink("../atom.cgi","atom.cgi") File.open("data.yaml","w").close vcs_add("data.yaml") hidden = ($cgi["hidden"] == "true") case $cgi["poll_type"] when "Poll" Poll.new SITE, hidden when "DatePoll" DatePoll.new SITE, hidden end Dir.chdir("..") if hidden $htmlout += < Info Poll #{SITE} created successfull!
Please remember the url (#{SITEURL}#{SITE}) while it will not be visible here. HIDDENINFO end else $htmlout += "
ErrorThis poll already exists!
" end end $htmlout += "
Available Polls" $htmlout += "" 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 += "" $htmlout += "" $htmlout += "" $htmlout += "" end } $htmlout += "
PollLast change
#{site}#{File.new(site + "/data.yaml").mtime.strftime('%d.%m, %H:%M')}
" $htmlout += "
" $htmlout += <change charset #{UTFASCII} CHARSET $htmlout += <Create new Poll
CREATE $htmlout += <--verbose Get the sourcecode.
Checkout using bazaar:
bzr branch http://dudle.inf.tu-dresden.de/src/ dudle
give feedback CHARSET $htmlout += ""