Commit 72a59859d0927e37de1648dc5eea5597b167b41e
Exists in
master
and in
27 other branches
Merge branch 'AI3223-fix_article_versions' into 'master'
Ai3223 fix article versions http://noosfero.org/Development/ActionItem3223 See merge request !265
Showing
3 changed files
with
3 additions
and
3 deletions
Show diff stats
app/controllers/public/content_viewer_controller.rb
... | ... | @@ -74,7 +74,7 @@ class ContentViewerController < ApplicationController |
74 | 74 | end |
75 | 75 | |
76 | 76 | def versions_diff |
77 | - path = params[:page].join('/') | |
77 | + path = params[:page] | |
78 | 78 | @page = profile.articles.find_by_path(path) |
79 | 79 | @v1, @v2 = @page.versions.find_by_version(params[:v1]), @page.versions.find_by_version(params[:v2]) |
80 | 80 | end | ... | ... |
app/views/content_viewer/article_versions.html.erb
... | ... | @@ -6,7 +6,7 @@ |
6 | 6 | |
7 | 7 | <p><%= _('This is the list of all versions of this content. Select a version to see it and then revert to it.') %>.</p> |
8 | 8 | |
9 | -<%= form_tag({:controller => 'content_viewer', :action => 'versions_diff', :profile => profile.identifier, :page => @page.path.split('/')}, :method => 'get') do %> | |
9 | +<%= form_tag({:controller => 'content_viewer', :action => 'versions_diff', :profile => profile.identifier, :page => @page.path}, :method => 'get') do %> | |
10 | 10 | <ul id="article-versions"> |
11 | 11 | <% @versions.each do |v| %> |
12 | 12 | <li> | ... | ... |
config/routes.rb
... | ... | @@ -131,7 +131,7 @@ Noosfero::Application.routes.draw do |
131 | 131 | match ':profile/*page/versions', :controller => 'content_viewer', :action => 'article_versions', :profile => /#{Noosfero.identifier_format}/, :constraints => EnvironmentDomainConstraint.new |
132 | 132 | match '*page/versions', :controller => 'content_viewer', :action => 'article_versions' |
133 | 133 | |
134 | - match ':profile/*page/versions_diff', :controller => 'content_viewer', :action => 'versions_diff', :profile => /#{Noosfero.identifier_format}/, :conditions => { :if => lambda { |env| !Domain.hosting_profile_at(env[:host]) } } | |
134 | + match ':profile/*page/versions_diff', :controller => 'content_viewer', :action => 'versions_diff', :profile => /#{Noosfero.identifier_format}/, :constraints => EnvironmentDomainConstraint.new | |
135 | 135 | match '*page/versions_diff', :controller => 'content_viewer', :action => 'versions_diff' |
136 | 136 | |
137 | 137 | # match requests for profiles that don't have a custom domain | ... | ... |