From 66ded2d67eefb07e7c66213c20ff92eb62613d4e Mon Sep 17 00:00:00 2001 From: Benjamin Kellermann Date: Sat, 21 Nov 2009 11:18:59 +0100 Subject: code restructuring --- history.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'history.rb') diff --git a/history.rb b/history.rb index 34daa63..6edacdc 100755 --- a/history.rb +++ b/history.rb @@ -33,10 +33,14 @@ require "poll" load "config.rb" Dir.chdir(olddir) +maxrev = VCS.revno if $cgi.include?("revision") - REVISION=$cgi["revision"].to_i - table = YAML::load(VCS.cat(REVISION, "data.yaml")) + revno=$cgi["revision"].to_i + versiontitle = "Poll of Version #{revno}" + table = YAML::load(VCS.cat(revno, "data.yaml")) else + revno = maxrev + versiontitle = "Current Poll" table = YAML::load_file("data.yaml") end @@ -55,15 +59,11 @@ TABLE -if defined?(REVISION) - $html << "

Poll of Version #{REVISION}

" -else - $html << "

Current Poll

" -end +$html << "

#{versiontitle}

" $html << table.to_html("",false) $html << "

History

" -$html << "
#{table.history_to_html}
" +$html << "
#{table.history_to_html(maxrev, revno)}
" $html << "" -- cgit v1.2.3