From 73cb84647e97679cbd69a3ea87d49f72b950c3df Mon Sep 17 00:00:00 2001 From: Benjamin Kellermann Date: Mon, 23 Nov 2009 18:33:27 +0100 Subject: undo works! --- edit_columns.rb | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) (limited to 'edit_columns.rb') diff --git a/edit_columns.rb b/edit_columns.rb index c449928..944c29f 100755 --- a/edit_columns.rb +++ b/edit_columns.rb @@ -84,29 +84,34 @@ TABLE # ADD/REMOVE COLUMN $html << table.edit_column_htmlform($cgi["editcolumn"],revno) +$html << "
" h = VCS.history.flatten -#undo = h.size -1 - -#h.collect{|e| -# -#} - - - -# This Revision: #{revno}
-# Hidden undo Revision: #{undorevision -1}
-# Last Action: #{h[0]["commit message"]} - -$html << <" if $cgi.include?("add_remove_column_month") +if h.max + coltitle,action = h.max.comment.scan(/^Column (.*) (added|deleted|edited)$/).flatten + case action + when "added" + title = "Delete column #{coltitle}" + when "deleted" + title = "Add column #{coltitle}" + when "edited" + title = "Column #{coltitle} edit" + end + $html << <
- - + + + #{hidden}
-#{h[216..234].to_html(220)} ADD_EDIT +end + +$html << h.to_html(1) +$html << "
" #undo + $html << "" -- cgit v1.2.3