add revert page
This commit is contained in:
parent
9fed2175de
commit
a16b45cdba
10 changed files with 79 additions and 47 deletions
|
@ -43,10 +43,10 @@
|
|||
<i class="icon-caret-down"></i></a>
|
||||
<ul class="dropdown-menu">
|
||||
<li class="dropdown-header">Page Options</li>
|
||||
<li><a href="/create/">Create Page</a></li>
|
||||
<li><a href="/_create/">Create Page</a></li>
|
||||
{% if name %}
|
||||
<li><a href="/edit/{{ name }}">Edit Page</a></li>
|
||||
<li><a href="/history/{{ name }}">History</a></li>
|
||||
<li><a href="/_edit/{{ name }}">Edit Page</a></li>
|
||||
<li><a href="/_history/{{ name }}">History</a></li>
|
||||
{% endif %}
|
||||
<li class="divider"></li>
|
||||
<li class="dropdown-header">Site Options</li>
|
||||
|
|
|
@ -2,15 +2,19 @@
|
|||
{% block body %}
|
||||
|
||||
<h2>History for <strong>{{ name }}</strong></h2>
|
||||
<div class="pull-right">
|
||||
<a href="/_commit/{{ old }}/{{ name }}" class="btn btn-default btn-sm">View Old</a>
|
||||
<a href="/_commit/{{ new }}/{{ name }}" class="btn btn-info btn-sm">View New</a>
|
||||
</div>
|
||||
<p>
|
||||
<a class="btn btn-default btn-sm" href="/history/{{ name }}">Back to History</a>
|
||||
<a href="" class="btn btn-default btn-sm">Revert Changes</a>
|
||||
<a class="btn btn-default btn-sm" href="/_history/{{ name }}">Back to History</a>
|
||||
</p>
|
||||
|
||||
|
||||
{{ diff|safe }}
|
||||
<p></p>
|
||||
|
||||
<p>
|
||||
<a class="btn btn-default btn-sm" href="/history/{{ name }}">Back to History</a>
|
||||
<a class="btn btn-default btn-sm" href="/_history/{{ name }}">Back to History</a>
|
||||
</p>
|
||||
{% endblock %}
|
|
@ -21,7 +21,7 @@
|
|||
<input type="checkbox" name="versions[]" value="{{ h.sha }}" />
|
||||
</td>
|
||||
<td>{{ h.author }}</td>
|
||||
<td><a href="/commit/{{ h.sha }}/{{ name }}" class='label label-primary'>{{ h.sha|truncate(7, True, end="") }}</a> {{ h.message }} </td>
|
||||
<td><a href="/_commit/{{ h.sha }}/{{ name }}" class='label label-primary'>View</a> {{ h.message }} </td>
|
||||
<td>{{ h.time|datetime }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
@ -50,8 +50,9 @@ $(function(){
|
|||
$.each($cs, function(i, v){
|
||||
revs.push(v.value);
|
||||
});
|
||||
revs = revs.join("...");
|
||||
location.href = "/compare/{{ name }}/" + revs;
|
||||
revs.reverse();
|
||||
revs = revs.join("..");
|
||||
location.href = "/_compare/{{ name }}/" + revs;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -1,13 +1,21 @@
|
|||
{% extends 'layout.html' %}
|
||||
{% block page_menu %}
|
||||
<div class="controls pull-right">
|
||||
<a class="btn btn-default btn-sm" href="/edit/{{ name }}">Edit</a>
|
||||
<a class="btn btn-default btn-sm" href="/history/{{ name }}">History</a>
|
||||
<a class="btn btn-default btn-sm" href="/_edit/{{ name }}">Edit</a>
|
||||
<a class="btn btn-default btn-sm" href="/_history/{{ name }}">History</a>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
|
||||
{% if commit %}
|
||||
<div id="page-action-bar">
|
||||
<form method="POST" action="/_revert">
|
||||
<input type="hidden" value="{{ name }}" name="name" />
|
||||
<input type="hidden" value="{{ commit }}" name="commit" />
|
||||
<input type="submit" class="btn btn-danger btn-sm" title="Revert back to this revision" value="Revert" />
|
||||
</form>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div id="page-content" style="display:none">
|
||||
{{ page.data }}
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue