Commit be72d6f135cfdd894ecaaa3d8b551b8502ce0aae
Exists in
master
and in
29 other branches
Merge commit 'refs/merge-requests/367' of git://gitorious.org/noosfero/noosfero …
…into merge-requests/367 Conflicts: app/views/content_viewer/view_page.rhtml
Showing
6 changed files
with
27 additions
and
31 deletions
Show diff stats
app/controllers/public/content_viewer_controller.rb
... | ... | @@ -37,11 +37,6 @@ class ContentViewerController < ApplicationController |
37 | 37 | end |
38 | 38 | end |
39 | 39 | |
40 | - if request.xhr? && params[:toolbar] | |
41 | - render :partial => 'article_toolbar' | |
42 | - return | |
43 | - end | |
44 | - | |
45 | 40 | redirect_to_translation if @page.profile.redirect_l10n |
46 | 41 | |
47 | 42 | if request.post? | ... | ... |
app/views/blocks/profile_image.rhtml
... | ... | @@ -14,11 +14,13 @@ |
14 | 14 | <p><%= h block.owner.short_name %></p> |
15 | 15 | <% end %> |
16 | 16 | |
17 | -<div style="text-align: center; font-size: 75%; clear: both" id="profile-admin-url-<%= block.id %>"></div> | |
18 | - | |
19 | -<div class="profile-info-options" id="profile-info-options-<%= block.id %>"></div> | |
17 | +<% if !user.nil? and user.has_permission?('edit_profile', profile) %> | |
18 | + <div class='admin-link'> | |
19 | + <%= link_to _('Control panel'), :controller => 'profile_editor' %> | |
20 | + </div> | |
21 | +<% end %> | |
20 | 22 | |
23 | +<div class="profile-info-options"> | |
24 | + <%= render :file => view_for_profile_actions(block.owner.class) %> | |
25 | +</div> | |
21 | 26 | </div><!-- end class="vcard" --> |
22 | -<script type="text/javascript"> | |
23 | - <%= remote_function :url => { :controller => 'profile', :profile => profile.identifier, :action => 'profile_info', :block_id => block.id } %> | |
24 | -</script> | ... | ... |
app/views/blocks/profile_info.rhtml
... | ... | @@ -14,13 +14,15 @@ |
14 | 14 | </div> |
15 | 15 | </div> |
16 | 16 | |
17 | -<ul class="profile-info-data" id="profile-info-data-<%= block.id %>"> | |
17 | +<ul class="profile-info-data"> | |
18 | 18 | <li><%= link_to __('Homepage'), block.owner.url, :class => 'url' %></li> |
19 | 19 | <li><%= link_to _('View profile'), block.owner.public_profile_url %></li> |
20 | 20 | <% if block.owner.enterprise? && block.owner.environment.enabled?('products_for_enterprises') %> |
21 | 21 | <li><%= link_to(_('Products/Services'), :controller => 'catalog', :profile => block.owner.identifier) %></li> |
22 | 22 | <% end %> |
23 | - <li id="profile-admin-url-<%= block.id %>"></li> | |
23 | + <% if !user.nil? and user.has_permission?('edit_profile', profile) %> | |
24 | + <li><%= link_to _('Control panel'), :controller => 'profile_editor' %></li> | |
25 | + <% end %> | |
24 | 26 | <% if profile.person? %> |
25 | 27 | <li><%= _('Since %{year}/%{month}') % { :year => block.owner.created_at.year, :month => block.owner.created_at.month } %></li> |
26 | 28 | <% end %> |
... | ... | @@ -37,9 +39,8 @@ |
37 | 39 | </div> |
38 | 40 | <% end %> |
39 | 41 | |
40 | -<div class="profile-info-options" id="profile-info-options-<%= block.id %>"></div> | |
42 | +<div class="profile-info-options"> | |
43 | + <%= render :file => view_for_profile_actions(@block.owner.class) %> | |
44 | +</div> | |
41 | 45 | |
42 | 46 | </div><!-- end class="vcard" --> |
43 | -<script type="text/javascript"> | |
44 | - <%= remote_function :url => { :controller => 'profile', :profile => profile.identifier, :action => 'profile_info', :block_id => block.id } %> | |
45 | -</script> | ... | ... |
app/views/content_viewer/view_page.rhtml
... | ... | @@ -15,16 +15,14 @@ |
15 | 15 | </script> |
16 | 16 | |
17 | 17 | <% if @page.parent && !@page.parent.path.blank? %> |
18 | -<div id="article-parent"> | |
19 | - <%= button(:back, _('Go back to %s') % @page.parent.short_title, @page.parent.url) %> | |
20 | -</div> | |
18 | + <div id="article-parent"> | |
19 | + <%= button(:back, _('Go back to %s') % @page.parent.short_title, @page.parent.url) %> | |
20 | + </div> | |
21 | 21 | <% end %> |
22 | 22 | |
23 | -<div id="article-toolbar"></div> | |
24 | - | |
25 | -<script type="text/javascript"> | |
26 | - <%= remote_function :update => "article-toolbar", :url => @page.url.merge({ :toolbar => true, :only_path => true }) %> | |
27 | -</script> | |
23 | +<div id="article-toolbar"> | |
24 | + <%= render :partial => 'article_toolbar' %> | |
25 | +</div> | |
28 | 26 | |
29 | 27 | <% if @page.display_hits? || @page.license.present? %> |
30 | 28 | <div id='article-sub-header'> | ... | ... |
app/views/profile/profile_info.rjs
... | ... | @@ -1,6 +0,0 @@ |
1 | -if !user.nil? and user.has_permission?('edit_profile', profile) | |
2 | - page.replace_html "profile-admin-url-#{@block.id}", link_to(_('Control panel'), @block.owner.admin_url) | |
3 | -else | |
4 | - page.hide "profile-admin-url-#{@block.id}" | |
5 | -end | |
6 | -page.replace_html "profile-info-options-#{@block.id}", :file => view_for_profile_actions(@block.owner.class) |
public/designs/themes/base/style.css
... | ... | @@ -605,6 +605,12 @@ div#notice { |
605 | 605 | color: #555; |
606 | 606 | } |
607 | 607 | |
608 | +.profile-image-block .admin-link { | |
609 | + text-align: center; | |
610 | + font-size: 75%; | |
611 | + clear: both; | |
612 | +} | |
613 | + | |
608 | 614 | |
609 | 615 | /*************************** My Network ******************************/ |
610 | 616 | ... | ... |