From d0475a45eda7bf36863336aa0aa64be960bad368 Mon Sep 17 00:00:00 2001 From: rick Date: Thu, 9 Dec 2010 18:06:11 -0800 Subject: [PATCH] add revert button, omg its fugly --- lib/gollum/frontend/public/css/gollum.css | 17 +------------- .../frontend/public/javascript/gollum.js | 22 ------------------- .../frontend/templates/compare.mustache | 15 +++++++++---- .../frontend/templates/history.mustache | 3 --- lib/gollum/frontend/views/compare.rb | 6 ++--- 5 files changed, 15 insertions(+), 48 deletions(-) diff --git a/lib/gollum/frontend/public/css/gollum.css b/lib/gollum/frontend/public/css/gollum.css index fc33f23b..378123c5 100755 --- a/lib/gollum/frontend/public/css/gollum.css +++ b/lib/gollum/frontend/public/css/gollum.css @@ -291,7 +291,7 @@ a:hover, a:visited { } #wiki-history table tr td.commit-name { - border-right: none; + border-left: 0; } #wiki-history table tr td.commit-name span.time-elapsed { @@ -329,21 +329,6 @@ a:hover, a:visited { font-family: 'Monaco', 'Andale Mono', Consolas, 'Courier New', monospace; padding: 0 0.2em; } - - #wiki-history table tr td.revert-action { - border-left: 0; - min-width: 10em; - text-align: right; - } - - #wiki-history table tr td.revert-action a { - font-weight: bold; - } - - #wiki-history table tr td.revert-action a span { - font-size: 0.9em; - font-family: 'Monaco', 'Andale Mono', Consolas, 'Courier New', monospace; - } .history #wiki-history ul.actions li, .history #footer ul.actions li { diff --git a/lib/gollum/frontend/public/javascript/gollum.js b/lib/gollum/frontend/public/javascript/gollum.js index 3571c3a7..b94c0914 100755 --- a/lib/gollum/frontend/public/javascript/gollum.js +++ b/lib/gollum/frontend/public/javascript/gollum.js @@ -50,28 +50,6 @@ $(document).ready(function() { if ($('#wiki-wrapper').hasClass('history')) { $('#wiki-history td.checkbox input').click(highlightChecked); - - $('#wiki-history td.revert-action a').mouseenter(highlightOn); - $('#wiki-history td.revert-action a').mouseleave(highlightOff); - - if ($('td.revert-action a').length) { - $('td.revert-action a').click(function(e) { - e.preventDefault(); - - var commitSha = $(this).attr('rel'); - var truncatedSha = commitSha.toString().substr(0, 7); - // revert action - $.GollumDialog.init({ - title: 'Reset to ' + truncatedSha + '?', - body: 'Are you sure you wish to reset to commit ' + - truncatedSha + '' + - ' ? This will overwrite any previous changes.', - OK: function() { - // TODO add async endpoint to revert here - } - }); - }); - } if ($('.history a.action-compare-revision').length) { $('.history a.action-compare-revision').click(function() { diff --git a/lib/gollum/frontend/templates/compare.mustache b/lib/gollum/frontend/templates/compare.mustache index 0325d018..50d051f0 100755 --- a/lib/gollum/frontend/templates/compare.mustache +++ b/lib/gollum/frontend/templates/compare.mustache @@ -1,10 +1,17 @@
diff --git a/lib/gollum/frontend/templates/history.mustache b/lib/gollum/frontend/templates/history.mustache index 0b563a12..a2c50312 100755 --- a/lib/gollum/frontend/templates/history.mustache +++ b/lib/gollum/frontend/templates/history.mustache @@ -39,9 +39,6 @@ {{message}} [{{id7}}] - - Reset to {{id7}} - {{/versions}} diff --git a/lib/gollum/frontend/views/compare.rb b/lib/gollum/frontend/views/compare.rb index fb02a7b1..bbee92e6 100644 --- a/lib/gollum/frontend/views/compare.rb +++ b/lib/gollum/frontend/views/compare.rb @@ -22,10 +22,10 @@ module Precious def lines lines = [] @diff.diff.split("\n")[2..-1].each_with_index do |line, line_index| - lines << { :line => line, + lines << { :line => line, :class => line_class(line), - :ldln => left_diff_line_number(0, line), - :rdln => right_diff_line_number(0, line) } + :ldln => left_diff_line_number(0, line), + :rdln => right_diff_line_number(0, line) } end if @diff lines end