fixes #971
This commit is contained in:
@@ -57,6 +57,7 @@ class WikiPagesController < ApplicationController
|
||||
@wiki_page = WikiPage.find(params[:id])
|
||||
@version = WikiPageVersion.find(params[:version_id])
|
||||
@wiki_page.revert_to!(@version)
|
||||
flash[:notice] = "Page was reverted"
|
||||
respond_with(@wiki_page)
|
||||
end
|
||||
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
<tr>
|
||||
<th width="2%"></th>
|
||||
<th width="2%"></th>
|
||||
<th width="60%">Title</th>
|
||||
<th width="55%">Title</th>
|
||||
<th width="5%"></th>
|
||||
<th width="10%">IP Address</th>
|
||||
<th width="26%">Last edited</th>
|
||||
</tr>
|
||||
@@ -29,14 +30,15 @@
|
||||
<%= radio_button_tag "otherpage", wiki_page_version.id %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td><%= link_to wiki_page_version.title, wiki_page_path(wiki_page_version.wiki_page_id) %></td>
|
||||
<td><%= link_to wiki_page_version.title, wiki_page_version_path(wiki_page_version) %></td>
|
||||
<td><%= link_to "wiki", wiki_page_path(wiki_page_version.wiki_page_id) %></td>
|
||||
<td>
|
||||
<% if CurrentUser.is_admin? %>
|
||||
<%= wiki_page_version.updater_ip_addr %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td>
|
||||
<%= link_to wiki_page_version.updated_at.strftime("%Y-%m-%d %I:%M"), wiki_page_version_path(wiki_page_version) %>
|
||||
<%= compact_time(wiki_page_version.updated_at) %>
|
||||
<% if wiki_page_version.updater %>
|
||||
by
|
||||
<%= link_to wiki_page_version.updater_name, user_path(wiki_page_version.updater) %>
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
<div id="wiki-page-body" class="dtext prose">
|
||||
<%= format_text(@wiki_page_version.body) %>
|
||||
</div>
|
||||
|
||||
<p><%= link_to "Revert to this version", revert_wiki_page_path(@wiki_page_version.wiki_page_id, :version_id => @wiki_page_version.id), :method => :put %></p>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user