Commit 459640601c4be57f1035dfbabd9cc826fad08b88
Exists in
staging
and in
42 other branches
Merge branch 'fix_block_links' into 'master'
Fix block links Fixing the URL from the article block and fixing the path of the New event button of the agenda. When Noosfero is used in a subdirectory, it crashes without this modification. See merge request !395
Showing
2 changed files
with
3 additions
and
3 deletions
Show diff stats
app/helpers/application_helper.rb
| @@ -945,9 +945,9 @@ module ApplicationHelper | @@ -945,9 +945,9 @@ module ApplicationHelper | ||
| 945 | # from Article model for an ArticleBlock. | 945 | # from Article model for an ArticleBlock. |
| 946 | def reference_to_article(text, article, anchor=nil) | 946 | def reference_to_article(text, article, anchor=nil) |
| 947 | if article.profile.domains.empty? | 947 | if article.profile.domains.empty? |
| 948 | - href = "/#{article.url[:profile]}/" | 948 | + href = "#{Noosfero.root}/#{article.url[:profile]}/" |
| 949 | else | 949 | else |
| 950 | - href = "http://#{article.profile.domains.first.name}/" | 950 | + href = "http://#{article.profile.domains.first.name}#{Noosfero.root}/" |
| 951 | end | 951 | end |
| 952 | href += article.url[:page].join('/') | 952 | href += article.url[:page].join('/') |
| 953 | href += '#' + anchor if anchor | 953 | href += '#' + anchor if anchor |
app/views/events/events.html.erb
| @@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
| 3 | <div id='agenda-toolbar'> | 3 | <div id='agenda-toolbar'> |
| 4 | <%= button :back, _('Back to %s') % profile.name, profile.url %> | 4 | <%= button :back, _('Back to %s') % profile.name, profile.url %> |
| 5 | <% if user && user.has_permission?('post_content', profile) %> | 5 | <% if user && user.has_permission?('post_content', profile) %> |
| 6 | - <%= button :new, _('New event'), myprofile_url(:controller => 'cms', :action => 'new', :type => 'Event') %> | 6 | + <%= button :new, _('New event'), myprofile_path(:controller => 'cms', :action => 'new', :type => 'Event') %> |
| 7 | <% end %> | 7 | <% end %> |
| 8 | </div> | 8 | </div> |
| 9 | 9 |