Commit ddbcecf8f3821ccb775bae6fff36312e96922bc7
1 parent
045d87b6
Exists in
master
and in
22 other branches
ActionItem93: extracting file_manager and file_manager_button from template
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@928 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
2 changed files
with
12 additions
and
8 deletions
Show diff stats
app/helpers/application_helper.rb
@@ -370,8 +370,12 @@ module ApplicationHelper | @@ -370,8 +370,12 @@ module ApplicationHelper | ||
370 | select_tag "#{object}[#{method}]", options_for_select(options, @page.filter_type || Comatose.config.default_filter), { :id=> "#{object}_#{method}" }.merge(html_options) | 370 | select_tag "#{object}[#{method}]", options_for_select(options, @page.filter_type || Comatose.config.default_filter), { :id=> "#{object}_#{method}" }.merge(html_options) |
371 | end | 371 | end |
372 | 372 | ||
373 | - def control_panel_button(title, icon, url) | 373 | + def file_manager(&block) |
374 | + concat(content_tag('div', capture(&block), :class => 'file-manager') + "<br style='clear: left;'/>", block.binding) | ||
374 | end | 375 | end |
375 | 376 | ||
377 | + def file_manager_button(title, icon, url) | ||
378 | + content_tag('div', link_to(image_tag(icon, :alt => title, :title => title) + tag('br') + title, url), :class => 'file-manager-button') | ||
379 | + end | ||
376 | 380 | ||
377 | end | 381 | end |
app/views/profile_editor/index.rhtml
@@ -2,18 +2,18 @@ | @@ -2,18 +2,18 @@ | ||
2 | 2 | ||
3 | <%= display_profile_info(profile) %> | 3 | <%= display_profile_info(profile) %> |
4 | 4 | ||
5 | -<div class='file-manager'> | ||
6 | 5 | ||
7 | - <%= content_tag('div', link_to(image_tag('icons-app/edit-profile.png', :alt => _('Edit Profile'), :title => _('Edit Profile')) + tag('br') + _('Edit Profile'), :controller => 'profile_editor', :action => 'edit'), :class => 'file-manager-button') %> | 6 | +<% file_manager do %> |
8 | 7 | ||
9 | - <%= content_tag('div', link_to(image_tag('icons-app/design-editor.png', :alt => _('Edit Visual Design'), :title => _('Edit Visual Design')) + tag('br') + _('Edit Visual Design'), :controller => 'profile_editor', :action => 'design_editor'), :class => 'file-manager-button') %> | 8 | + <%= file_manager_button(_('Edit Profile'), 'icons-app/edit-profile.png', :controller => 'profile_editor', :action => 'edit') %> |
10 | 9 | ||
11 | - <%= content_tag('div', link_to(image_tag('icons-app/cms.png', :alt => _('Manage Content'), :title => _('Manage Content')) + tag('br') + _('Manage Content'), :controller => 'cms'), :class => 'file-manager-button') %> | 10 | + <%= file_manager_button(_('Edit Visual Design'), 'icons-app/design-editor.png', :controller => 'profile_editor', :action => 'design_editor') %> |
12 | 11 | ||
13 | - <%= content_tag('div', link_to(image_tag('icons-app/change-password.png', :alt => _('Change Password'), :title => _('Change Password')) + tag('br') + _('Change Password'), :controller => 'account', :action => 'change_password'), :class => 'file-manager-button') %> | 12 | + <%= file_manager_button(_('Manage Content'), 'icons-app/cms.png', :controller => 'cms') %> |
14 | 13 | ||
15 | -</div> | ||
16 | -<br style='clear: left'/> | 14 | + <%= file_manager_button(_('Change Password'), 'icons-app/change-password.png', :controller => 'account', :action => 'change_password') %> |
15 | + | ||
16 | +<% end %> | ||
17 | 17 | ||
18 | <!-- | 18 | <!-- |
19 | <p> <%= link_to _('Edit Visual Design'), :action => 'design_editor' %> </p> | 19 | <p> <%= link_to _('Edit Visual Design'), :action => 'design_editor' %> </p> |