Commit 5cd25bf876ed3276d0a2e7b3ddc2c10c99db5f6c
1 parent
658ecf81
Exists in
master
and in
28 other branches
Reverting now is working
Removed setting as versioned column revert button is following the pattern styling link-this-page (ActionItem2822)
Showing
4 changed files
with
17 additions
and
6 deletions
Show diff stats
app/controllers/my_profile/cms_controller.rb
... | ... | @@ -68,6 +68,9 @@ class CmsController < MyProfileController |
68 | 68 | def edit |
69 | 69 | @success_back_to = params[:success_back_to] |
70 | 70 | @article = profile.articles.find(params[:id]) |
71 | + version = params[:version] | |
72 | + @article.revert_to(version) if version | |
73 | + | |
71 | 74 | @parent_id = params[:parent_id] |
72 | 75 | @type = params[:type] || @article.class.to_s |
73 | 76 | translations if @article.translatable? | ... | ... |
app/models/article.rb
app/views/content_viewer/versioned_article.rhtml
1 | 1 | <div id="article" class="<%= @page.css_class_name %>"> |
2 | 2 | |
3 | - <% if @page.allow_edit?(user) && !remove_content_button(:edit) %> | |
4 | - <div id="article-revert-version"> | |
5 | - <% content = content_tag('span', _('Revert to this version')) %> | |
6 | - <% url = profile.admin_url.merge({ :controller => 'cms', :action => 'edit', :id => @page.id, :article => @versioned_article.attributes }) %> | |
7 | - <%= expirable_button @page, :edit, content, url %> | |
3 | + <div id="article-actions"> | |
4 | + <% if @page.allow_edit?(user) && !remove_content_button(:edit) %> | |
5 | + <div id="article-revert-version"> | |
6 | + <% content = content_tag('span', _('Revert to this version')) %> | |
7 | + <% url = profile.admin_url.merge({ :controller => 'cms', :action => 'edit', :id => @page.id, :version => @version }) %> | |
8 | + <%= expirable_button @page, :edit, content, url %> | |
9 | + </div> | |
8 | 10 | <% end %> |
9 | - | |
10 | 11 | </div> |
11 | 12 | |
12 | 13 | <div id="article-header"> | ... | ... |
public/stylesheets/application.css