Commit ccaebce27b8a54ad3a74753ca47a21368159df7b

Authored by MoisesMachado
1 parent 66dfc009

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
app/controllers/public/account_controller.rb
@@ -36,7 +36,7 @@ class AccountController < PublicController @@ -36,7 +36,7 @@ class AccountController < PublicController
36 @user.person.environment = environment 36 @user.person.environment = environment
37 @user.person.save! 37 @user.person.save!
38 self.current_user = @user 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 flash[:notice] = _("Thanks for signing up!") 40 flash[:notice] = _("Thanks for signing up!")
41 end 41 end
42 rescue ActiveRecord::RecordInvalid 42 rescue ActiveRecord::RecordInvalid
app/helpers/application_helper.rb
@@ -112,7 +112,6 @@ module ApplicationHelper @@ -112,7 +112,6 @@ module ApplicationHelper
112 112
113 # TODO: add the actual links 113 # TODO: add the actual links
114 # TODO: test this helper 114 # TODO: test this helper
115 - # FIXME: uncomment "My enterprises" links  
116 def user_links 115 def user_links
117 links = [ 116 links = [
118 ( link_to_homepage( _('My account') )), 117 ( link_to_homepage( _('My account') )),
@@ -124,7 +123,7 @@ module ApplicationHelper @@ -124,7 +123,7 @@ module ApplicationHelper
124 end 123 end
125 124
126 def about_document 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 a.full_path.split(/\//).shift == 'noosfero' 127 a.full_path.split(/\//).shift == 'noosfero'
129 end[0] 128 end[0]
130 end 129 end
@@ -216,7 +215,9 @@ module ApplicationHelper @@ -216,7 +215,9 @@ module ApplicationHelper
216 ] 215 ]
217 end 216 end
218 217
  218 + #FIXME: about_links should be shown even if the user isn't logged in
219 def user_options 219 def user_options
  220 + return [] unless logged_in?
220 profile = Profile.find_by_identifier(params[:profile]) 221 profile = Profile.find_by_identifier(params[:profile])
221 case params[:controller] 222 case params[:controller]
222 when 'admin_panel' 223 when 'admin_panel'
@@ -245,7 +246,10 @@ module ApplicationHelper @@ -245,7 +246,10 @@ module ApplicationHelper
245 end 246 end
246 247
247 def accessibility_link 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 end 253 end
250 254
251 def footer 255 def footer
app/views/content_viewer/view_page.rhtml
@@ -2,11 +2,16 @@ @@ -2,11 +2,16 @@
2 2
3 <% if @page.parent && !@page.parent.full_path.blank? %> 3 <% if @page.parent && !@page.parent.full_path.blank? %>
4 <%= link_to_document(@page.parent, _('Up')) %> 4 <%= link_to_document(@page.parent, _('Up')) %>
5 - <hr/>  
6 <% end %> 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 <%= @page.to_html %> 12 <%= @page.to_html %>
9 13
  14 +<!--
10 <% unless @page.children.empty? %> 15 <% unless @page.children.empty? %>
11 <hr/> 16 <hr/>
12 <ul> 17 <ul>
@@ -14,3 +19,4 @@ @@ -14,3 +19,4 @@
14 <li><%= link_to_document(item) %></li> 19 <li><%= link_to_document(item) %></li>
15 <% end %> 20 <% end %>
16 <% end %> 21 <% end %>
  22 +-->
app/views/layouts/application.rhtml
@@ -65,7 +65,6 @@ @@ -65,7 +65,6 @@
65 <div id='accessibility_menu'> 65 <div id='accessibility_menu'>
66 <a href='#content' title='Ir para o conteúdo'>Ir para conteúdo</a> 66 <a href='#content' title='Ir para o conteúdo'>Ir para conteúdo</a>
67 <%= accessibility_link %> 67 <%= accessibility_link %>
68 - <a href='#'>Acessibilidade</a>  
69 </div><!-- accessibility_menu --> 68 </div><!-- accessibility_menu -->
70 <div id='path_category'> 69 <div id='path_category'>
71 <% if @category %> 70 <% if @category %>