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