From b7e5654a565ee3d76f290cf14fbd4ac5632814d5 Mon Sep 17 00:00:00 2001 From: Benjamin Kellermann Date: Wed, 3 Jun 2009 09:23:40 +0200 Subject: cleaner interface --- participate.rb | 93 ++++++++++++++++------------------------------------------ 1 file changed, 25 insertions(+), 68 deletions(-) (limited to 'participate.rb') diff --git a/participate.rb b/participate.rb index 35bf0a6..b4a7f66 100644 --- a/participate.rb +++ b/participate.rb @@ -28,12 +28,34 @@ $htmlout += < - -

#{table.name}

+ config HEAD + +# HISTORY +MAXREV=VCS.revno +REVISION=MAXREV unless defined?(REVISION) +log = VCS.history +log.collect!{|s| s.scan(/\nrevno:.*\ncommitter.*\n.*\ntimestamp: (.*)\nmessage:\n (.*)/).flatten} +log.shift +log.collect!{|t,c| [DateTime.parse(t),c]} +$htmlout +=" history:" + +((REVISION-2)..(REVISION+2)).each do |i| + if i >0 && i<=MAXREV + $htmlout += " " + $htmlout += "" if REVISION != i + $htmlout += "#{i}" + $htmlout += "" if REVISION != i + end +end +$htmlout += "
" + + +# TABLE +$htmlout += "

#{table.name}

" if $cgi.include?("add_participant") agreed = {} $cgi.params.each{|k,v| @@ -60,70 +82,5 @@ POLLTABLE $htmlout += table.comment_to_html -# ADD COMMENT -$htmlout += < -
- Comment -
-
- - -
- -
- -
-
-
- -ADDCOMMENT - -# HISTORY -MAXREV=VCS.revno -REVISION=MAXREV unless defined?(REVISION) -log = VCS.history -log.collect!{|s| s.scan(/\nrevno:.*\ncommitter.*\n.*\ntimestamp: (.*)\nmessage:\n (.*)/).flatten} -log.shift -log.collect!{|t,c| [DateTime.parse(t),c]} -$htmlout += < -
browse history - - - - - - -HISTORY - -((REVISION-2)..(REVISION+2)).each do |i| - if i >0 && i<=MAXREV - if REVISION == i - $htmlout += "" - $htmlout += "" - $htmlout += "" - $htmlout += "" - end -end -$htmlout += "
revtimedescription of change
#{i}" - else - $htmlout += "
" - $htmlout += "#{i}" - end - $htmlout += "#{log[i-1][0].strftime('%d.%m, %H:%M')}#{log[i-1][1]}
" -$htmlout += "
" -$htmlout += "" - - -$htmlout +=< -
- Configure the Poll - config -
- -CONFIG - $htmlout += "" -- cgit v1.2.3