aboutsummaryrefslogtreecommitdiff
path: root/poll.rb
diff options
context:
space:
mode:
authorBenjamin Kellermann <Benjamin.Kellermann@gmx.de>2009-11-23 15:05:58 +0100
committerBenjamin Kellermann <Benjamin.Kellermann@gmx.de>2009-11-23 15:05:58 +0100
commitfc936f76f65db94469959883c8ef2926ff0e779b (patch)
tree7b3d64fc103abc02efdb6d000194062854409d34 /poll.rb
parent6bcb17d78da2ed2df16c4d994c866dcf57ebe3f4 (diff)
new feature selecting parts of history
Diffstat (limited to 'poll.rb')
-rw-r--r--poll.rb34
1 files changed, 33 insertions, 1 deletions
diff --git a/poll.rb b/poll.rb
index e69c8c7..66e2d5f 100644
--- a/poll.rb
+++ b/poll.rb
@@ -228,8 +228,40 @@ ADDCOMMENT
ret
end
- def history_to_html(maxrev, middlerevision)
+ def history_selectform(revision, selected)
+ ret = <<FORM
+<form method='get' action=''>
+ <div>
+ <select name='history'>
+FORM
+ ["comments","participants","columns"].each{|opt|
+ ret += "<option value='#{opt}' #{selected == opt ? "selected='selected'" : ""} >#{opt}</option>"
+ }
+ ret += "<input type='hidden' name='revision' value='#{revision}' />" if revision
+ ret += <<FORM
+ </select>
+ <input type='submit' />
+ </div>
+</form>
+FORM
+ ret
+ end
+
+ def history_to_html(maxrev, middlerevision,only)
log = VCS.history
+ if only
+ case only
+ when "comments"
+ match = /^Comment .*$/
+ when "participants"
+ match = /^Participant .*$/
+ when "columns"
+ match = /^Column .*$/
+ else
+ raise "invalid value #{only}"
+ end
+ log = log.comment_matches(match)
+ end
log[((middlerevision-5)..(middlerevision+5))].to_html(maxrev, middlerevision)
end