add revert button, omg its fugly

This commit is contained in:
rick
2010-12-09 18:06:11 -08:00
parent 19ef3710c3
commit d0475a45ed
5 changed files with 15 additions and 48 deletions
+1 -16
View File
@@ -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 {
@@ -330,21 +330,6 @@ a:hover, a:visited {
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 {
margin: 0 0.6em 0 0; margin: 0 0.6em 0 0;
@@ -51,28 +51,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() {
$("#version-form").submit(); $("#version-form").submit();
@@ -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>
<form name="gollum-revert" action="/revert/{{escaped_name}}/{{before}}/{{after}}" method="post">
<div id="gollum-editor">
<ul class="actions"> <ul class="actions">
<li class="minibutton"><a href="/history/{{escaped_name}}" <li class="minibutton"><a href="/history/{{escaped_name}}"
class="action-page-history">Back to Page History</a></li> class="action-page-history">Back to Page History</a></li>
</ul> <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}}