add revert button, omg its fugly
This commit is contained in:
@@ -291,7 +291,7 @@ a:hover, a:visited {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#wiki-history table tr td.commit-name {
|
#wiki-history table tr td.commit-name {
|
||||||
border-right: none;
|
border-left: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#wiki-history table tr td.commit-name span.time-elapsed {
|
#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;
|
font-family: 'Monaco', 'Andale Mono', Consolas, 'Courier New', monospace;
|
||||||
padding: 0 0.2em;
|
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 #wiki-history ul.actions li,
|
||||||
.history #footer ul.actions li {
|
.history #footer ul.actions li {
|
||||||
|
|||||||
@@ -50,28 +50,6 @@ $(document).ready(function() {
|
|||||||
|
|
||||||
if ($('#wiki-wrapper').hasClass('history')) {
|
if ($('#wiki-wrapper').hasClass('history')) {
|
||||||
$('#wiki-history td.checkbox input').click(highlightChecked);
|
$('#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 <code>' +
|
|
||||||
truncatedSha + '</code>' +
|
|
||||||
' ? This will overwrite any previous changes.',
|
|
||||||
OK: function() {
|
|
||||||
// TODO add async endpoint to revert here
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($('.history a.action-compare-revision').length) {
|
if ($('.history a.action-compare-revision').length) {
|
||||||
$('.history a.action-compare-revision').click(function() {
|
$('.history a.action-compare-revision').click(function() {
|
||||||
|
|||||||
@@ -1,10 +1,17 @@
|
|||||||
<div id="wiki-wrapper" class="compare">
|
<div id="wiki-wrapper" class="compare">
|
||||||
<div id="head">
|
<div id="head">
|
||||||
<h1>History for <strong>{{path}}</strong></h1>
|
<h1>History for <strong>{{path}}</strong></h1>
|
||||||
<ul class="actions">
|
|
||||||
<li class="minibutton"><a href="/history/{{escaped_name}}"
|
<form name="gollum-revert" action="/revert/{{escaped_name}}/{{before}}/{{after}}" method="post">
|
||||||
class="action-page-history">Back to Page History</a></li>
|
<div id="gollum-editor">
|
||||||
</ul>
|
<ul class="actions">
|
||||||
|
<li class="minibutton"><a href="/history/{{escaped_name}}"
|
||||||
|
class="action-page-history">Back to Page History</a></li>
|
||||||
|
<li class="minibutton">
|
||||||
|
<input type="submit" id="gollum-editor-submit" value="Revert" title="Save current changes">
|
||||||
|
</li>
|
||||||
|
</ul></div>
|
||||||
|
</form>
|
||||||
{{>searchbar}}
|
{{>searchbar}}
|
||||||
</div>
|
</div>
|
||||||
<div id="compare-content">
|
<div id="compare-content">
|
||||||
|
|||||||
@@ -39,9 +39,6 @@
|
|||||||
{{message}}
|
{{message}}
|
||||||
[<a href="/{{escaped_name}}/{{id}}" title="View commit">{{id7}}</a>]
|
[<a href="/{{escaped_name}}/{{id}}" title="View commit">{{id7}}</a>]
|
||||||
</td>
|
</td>
|
||||||
<td class="revert-action">
|
|
||||||
<a href="#" title="Reset to this change" rel="{{id}}">Reset to <span>{{id7}}</span></a>
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
{{/versions}}
|
{{/versions}}
|
||||||
|
|
||||||
|
|||||||
@@ -22,10 +22,10 @@ module Precious
|
|||||||
def lines
|
def lines
|
||||||
lines = []
|
lines = []
|
||||||
@diff.diff.split("\n")[2..-1].each_with_index do |line, line_index|
|
@diff.diff.split("\n")[2..-1].each_with_index do |line, line_index|
|
||||||
lines << { :line => line,
|
lines << { :line => line,
|
||||||
:class => line_class(line),
|
:class => line_class(line),
|
||||||
:ldln => left_diff_line_number(0, line),
|
:ldln => left_diff_line_number(0, line),
|
||||||
:rdln => right_diff_line_number(0, line) }
|
:rdln => right_diff_line_number(0, line) }
|
||||||
end if @diff
|
end if @diff
|
||||||
lines
|
lines
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user