diff options
author | Benjamin Kellermann <Benjamin.Kellermann@gmx.de> | 2009-11-23 15:05:58 +0100 |
---|---|---|
committer | Benjamin Kellermann <Benjamin.Kellermann@gmx.de> | 2009-11-23 15:05:58 +0100 |
commit | fc936f76f65db94469959883c8ef2926ff0e779b (patch) | |
tree | 7b3d64fc103abc02efdb6d000194062854409d34 /poll.rb | |
parent | 6bcb17d78da2ed2df16c4d994c866dcf57ebe3f4 (diff) |
new feature selecting parts of history
Diffstat (limited to 'poll.rb')
-rw-r--r-- | poll.rb | 34 |
1 files changed, 33 insertions, 1 deletions
@@ -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 |