Commit ccaebce27b8a54ad3a74753ca47a21368159df7b
1 parent
66dfc009
Exists in
master
and in
29 other branches
ActionItem111: changed the view_page of comatose to have a link to the edit action
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@729 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
4 changed files
with
15 additions
and
6 deletions
Show diff stats
app/controllers/public/account_controller.rb
| ... | ... | @@ -36,7 +36,7 @@ class AccountController < PublicController |
| 36 | 36 | @user.person.environment = environment |
| 37 | 37 | @user.person.save! |
| 38 | 38 | self.current_user = @user |
| 39 | - redirect_back_or_default(:controller => 'account', :action => 'index') | |
| 39 | + redirect_back_or_default(homepage_path(:profile => current_user.login)) | |
| 40 | 40 | flash[:notice] = _("Thanks for signing up!") |
| 41 | 41 | end |
| 42 | 42 | rescue ActiveRecord::RecordInvalid | ... | ... |
app/helpers/application_helper.rb
| ... | ... | @@ -112,7 +112,6 @@ module ApplicationHelper |
| 112 | 112 | |
| 113 | 113 | # TODO: add the actual links |
| 114 | 114 | # TODO: test this helper |
| 115 | - # FIXME: uncomment "My enterprises" links | |
| 116 | 115 | def user_links |
| 117 | 116 | links = [ |
| 118 | 117 | ( link_to_homepage( _('My account') )), |
| ... | ... | @@ -124,7 +123,7 @@ module ApplicationHelper |
| 124 | 123 | end |
| 125 | 124 | |
| 126 | 125 | def about_document |
| 127 | - Article.find_all_by_title('About').select do |a| | |
| 126 | + Article.find_all_by_title(_('About')).select do |a| | |
| 128 | 127 | a.full_path.split(/\//).shift == 'noosfero' |
| 129 | 128 | end[0] |
| 130 | 129 | end |
| ... | ... | @@ -216,7 +215,9 @@ module ApplicationHelper |
| 216 | 215 | ] |
| 217 | 216 | end |
| 218 | 217 | |
| 218 | + #FIXME: about_links should be shown even if the user isn't logged in | |
| 219 | 219 | def user_options |
| 220 | + return [] unless logged_in? | |
| 220 | 221 | profile = Profile.find_by_identifier(params[:profile]) |
| 221 | 222 | case params[:controller] |
| 222 | 223 | when 'admin_panel' |
| ... | ... | @@ -245,7 +246,10 @@ module ApplicationHelper |
| 245 | 246 | end |
| 246 | 247 | |
| 247 | 248 | def accessibility_link |
| 248 | - link_to _('Accessibility') | |
| 249 | + doc = Article.find_all_by_title(_('Accessibility')).select do |a| | |
| 250 | + a.full_path.split(/\//).shift == 'noosfero' | |
| 251 | + end[0] | |
| 252 | + link_to_document doc, _('Accessibility') if doc | |
| 249 | 253 | end |
| 250 | 254 | |
| 251 | 255 | def footer | ... | ... |
app/views/content_viewer/view_page.rhtml
| ... | ... | @@ -2,11 +2,16 @@ |
| 2 | 2 | |
| 3 | 3 | <% if @page.parent && !@page.parent.full_path.blank? %> |
| 4 | 4 | <%= link_to_document(@page.parent, _('Up')) %> |
| 5 | - <hr/> | |
| 6 | 5 | <% end %> |
| 6 | +<% if logged_in? && current_user.person.has_permission?('post_content', profile) %> | |
| 7 | + <%= link_to _('Edit'), :controller => 'cms', :action => 'edit', :id => @page %> | |
| 8 | +<% end %> | |
| 9 | + | |
| 10 | +<hr/> | |
| 7 | 11 | |
| 8 | 12 | <%= @page.to_html %> |
| 9 | 13 | |
| 14 | +<!-- | |
| 10 | 15 | <% unless @page.children.empty? %> |
| 11 | 16 | <hr/> |
| 12 | 17 | <ul> |
| ... | ... | @@ -14,3 +19,4 @@ |
| 14 | 19 | <li><%= link_to_document(item) %></li> |
| 15 | 20 | <% end %> |
| 16 | 21 | <% end %> |
| 22 | +--> | ... | ... |
app/views/layouts/application.rhtml
| ... | ... | @@ -65,7 +65,6 @@ |
| 65 | 65 | <div id='accessibility_menu'> |
| 66 | 66 | <a href='#content' title='Ir para o conteúdo'>Ir para conteúdo</a> |
| 67 | 67 | <%= accessibility_link %> |
| 68 | - <a href='#'>Acessibilidade</a> | |
| 69 | 68 | </div><!-- accessibility_menu --> |
| 70 | 69 | <div id='path_category'> |
| 71 | 70 | <% if @category %> | ... | ... |