show appropriate error message when revert wont apply
This commit is contained in:
@@ -97,6 +97,7 @@ module Precious
|
||||
@versions = [sha1, sha2]
|
||||
diffs = wiki.repo.diff(@versions.first, @versions.last, @page.path)
|
||||
@diff = diffs.first
|
||||
@message = "The patch does not apply."
|
||||
mustache :compare
|
||||
end
|
||||
end
|
||||
|
||||
@@ -7,13 +7,20 @@
|
||||
<ul class="actions">
|
||||
<li class="minibutton"><a href="/history/{{escaped_name}}"
|
||||
class="action-page-history">Back to Page History</a></li>
|
||||
{{#show_revert}}
|
||||
<li class="minibutton">
|
||||
<input type="submit" id="gollum-editor-submit" value="Revert" title="Save current changes">
|
||||
</li>
|
||||
{{/show_revert}}
|
||||
</ul></div>
|
||||
</form>
|
||||
{{>searchbar}}
|
||||
</div>
|
||||
|
||||
{{#message}}
|
||||
<p>{{message}}</p>
|
||||
{{/message}}
|
||||
|
||||
<div id="compare-content">
|
||||
<div class="data highlight">
|
||||
<table cellpadding="0" cellspacing="0">
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<li class="minibutton"><a href="javascript:void(0);"
|
||||
class="action-compare-revision">Compare Revisions</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<form name="compare-versions" id="version-form" method="post"
|
||||
action="/compare/{{escaped_name}}">
|
||||
<fieldset>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
module Precious
|
||||
module Views
|
||||
class Compare < Layout
|
||||
attr_reader :page, :diff, :versions
|
||||
attr_reader :page, :diff, :versions, :message
|
||||
|
||||
def title
|
||||
"Comparison of #{@page.title}"
|
||||
@@ -30,6 +30,10 @@ module Precious
|
||||
lines
|
||||
end
|
||||
|
||||
def show_revert
|
||||
!@message
|
||||
end
|
||||
|
||||
# private
|
||||
|
||||
def line_class(line)
|
||||
|
||||
Reference in New Issue
Block a user