Commit 4d68bf9576dc5bf7030351f3ca9d6b3a0322a591

Authored by AurelioAHeckert
1 parent 88e96a20

ActionItem318: a better control panel

git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1733 3f533792-8f58-4932-b0fe-aaf55b0a4547
app/helpers/application_helper.rb
@@ -451,10 +451,14 @@ module ApplicationHelper @@ -451,10 +451,14 @@ module ApplicationHelper
451 end 451 end
452 452
453 attr_reader :environment 453 attr_reader :environment
454 - def select_categories(object_name) 454 + def select_categories(object_name, title=nil, title_size=4)
  455 + if title.nil?
  456 + title = _('Categories')
  457 + end
  458 +
455 object = instance_variable_get("@#{object_name}") 459 object = instance_variable_get("@#{object_name}")
456 460
457 - result = content_tag 'h4', _('Categories') 461 + result = content_tag 'h'+title_size.to_s(), title
458 result << javascript_tag( 'function open_close_cat( link ) { 462 result << javascript_tag( 'function open_close_cat( link ) {
459 var div = link.parentNode.getElementsByTagName("div")[0]; 463 var div = link.parentNode.getElementsByTagName("div")[0];
460 var end = function(){ 464 var end = function(){
app/helpers/profile_helper.rb
@@ -5,14 +5,19 @@ module ProfileHelper @@ -5,14 +5,19 @@ module ProfileHelper
5 if info.nil? 5 if info.nil?
6 content_tag('div', _('This profile does not have any public information')) 6 content_tag('div', _('This profile does not have any public information'))
7 else 7 else
8 - table_rows = '' 8 + table_rows = content_tag( 'tr',
  9 + content_tag( 'th',
  10 + "\n" +
  11 + button( :edit, _('edit your informations'), :controller => 'profile_editor', :action => 'edit' ) +
  12 + "\n",
  13 + :colspan => 2, :class => 'header' )
  14 + ) + "\n"
9 info.summary.each do |item| 15 info.summary.each do |item|
10 name = item[0] 16 name = item[0]
11 value = item[1] 17 value = item[1]
12 if value.is_a?(Proc) 18 if value.is_a?(Proc)
13 value = self.instance_eval(value) 19 value = self.instance_eval(value)
14 end 20 end
15 -  
16 table_rows << content_tag('tr', content_tag('th', name) + content_tag('td', value)) 21 table_rows << content_tag('tr', content_tag('th', name) + content_tag('td', value))
17 table_rows << "\n" 22 table_rows << "\n"
18 end 23 end
app/views/admin_panel/index.rhtml
1 -/<h1><%= _('Administrator Panel') %></h1> 1 +<h1><%= _('Administrator Panel') %></h1>
2 2
3 <p><%= _('You, as an environment administrator, has the following options:')%></p> 3 <p><%= _('You, as an environment administrator, has the following options:')%></p>
4 4
app/views/layouts/application.rhtml
@@ -107,12 +107,12 @@ @@ -107,12 +107,12 @@
107 107
108 </div><!-- id="noosfero_bar" --> 108 </div><!-- id="noosfero_bar" -->
109 109
110 - <div id='frame'><!-- Frame que envolve toda pagina de um usuario -->  
111 - <div id='header'> 110 + <div id="frame"><!-- Frame que envolve toda pagina de um usuario -->
  111 + <div id="header">
112 <!-- Abaixo um cabeçalho especifico para a pagina de usuario. --> 112 <!-- Abaixo um cabeçalho especifico para a pagina de usuario. -->
113 - </div><!-- id='header' -->  
114 - <div id='content'>  
115 - <div id='header_content'> 113 + </div><!-- id="header" -->
  114 + <div id="content">
  115 + <div id="header_content">
116 </div> 116 </div>
117 117
118 <% if @controller.send(:boxes_editor?) %> 118 <% if @controller.send(:boxes_editor?) %>
app/views/profile_editor/edit_categories.rhtml
1 <% form_for :profile_object, @profile_object, :url => { :action => 'edit_categories'} do |f| %> 1 <% form_for :profile_object, @profile_object, :url => { :action => 'edit_categories'} do |f| %>
2 - <%= select_categories('profile_object') %> 2 + <%= select_categories('profile_object', _('Select your interest categories'), 1) %>
3 <% button_bar do %> 3 <% button_bar do %>
4 <%= submit_button('save', _('Save'), :cancel => {:action => 'edit_categories'}) %> 4 <%= submit_button('save', _('Save'), :cancel => {:action => 'edit_categories'}) %>
5 <%= button(:back, _('Back to control panel'), :controller => 'profile_editor') %> 5 <%= button(:back, _('Back to control panel'), :controller => 'profile_editor') %>
app/views/profile_editor/index.rhtml
@@ -4,20 +4,13 @@ @@ -4,20 +4,13 @@
4 4
5 <%= render :partial => 'pending_tasks' %> 5 <%= render :partial => 'pending_tasks' %>
6 6
7 -<%= link_to (@profile.image ? image_tag( @profile.image.public_filename) :  
8 - _('Upload your picture') ),  
9 - { :action => 'change_image' },  
10 - :class => (@profile.image ? 'change-user-picture' : 'set-user-picture' ),  
11 - :help => _('Click here to upload any image to be your picture') %>  
12 -  
13 -<p/>  
14 -  
15 <%= display_profile_info(profile) %> 7 <%= display_profile_info(profile) %>
16 8
17 -  
18 <% file_manager do %> 9 <% file_manager do %>
19 10
20 - <%= file_manager_button(_('Edit Profile'), 'icons-app/edit-profile.png', :controller => 'profile_editor', :action => 'edit') %> 11 + <%= file_manager_button(_('Change your picture'), profile_icon(@profile, :portrait), :controller => 'profile_editor', :action => 'change_image') %>
  12 +
  13 + <%# file_manager_button(_('Edit Profile'), 'icons-app/edit-profile.png', :controller => 'profile_editor', :action => 'edit') %>
21 14
22 <%= file_manager_button(_('Pending tasks'), 'icons-app/todo.png', :controller => 'tasks', :action => 'index') %> 15 <%= file_manager_button(_('Pending tasks'), 'icons-app/todo.png', :controller => 'tasks', :action => 'index') %>
23 16
@@ -25,7 +18,7 @@ @@ -25,7 +18,7 @@
25 18
26 <%= file_manager_button(_('Manage Content'), 'icons-app/cms.png', :controller => 'cms') %> 19 <%= file_manager_button(_('Manage Content'), 'icons-app/cms.png', :controller => 'cms') %>
27 20
28 - <%= file_manager_button(_('Edit Categories'), 'icons-app/categories.png', :controller => 'profile_editor', :action => 'edit_categories') %> 21 + <%= file_manager_button(_('My Interests'), 'icons-app/categories.png', :controller => 'profile_editor', :action => 'edit_categories') %>
29 22
30 <%= file_manager_button(_('Change Password'), 'icons-app/change-password.png', :controller => 'account', :action => 'change_password') if profile.person? %> 23 <%= file_manager_button(_('Change Password'), 'icons-app/change-password.png', :controller => 'account', :action => 'change_password') if profile.person? %>
31 24
@@ -33,7 +26,7 @@ @@ -33,7 +26,7 @@
33 26
34 <%= file_manager_button(_('Manage Members'), 'icons-app/members.png', :controller => 'profile_members') if profile.organization? %> 27 <%= file_manager_button(_('Manage Members'), 'icons-app/members.png', :controller => 'profile_members') if profile.organization? %>
35 28
36 - <%= file_manager_button(_('Consumed Products'), 'icons-app/consumed_product.png', :controller => 'consumed_products') %> 29 + <%= file_manager_button(_('Consumed Products'), 'icons-app/consumed_product.png', :controller => 'consumed_products') if profile.enterprise? %>
37 30
38 <%= file_manager_button(_('Manage Products'), 'icons-app/products.png', :controller => 'manage_products') if profile.enterprise? %> 31 <%= file_manager_button(_('Manage Products'), 'icons-app/products.png', :controller => 'manage_products') if profile.enterprise? %>
39 32
public/designs/themes/default/stylesheets/controller_profile_editor.css
  1 +@import url(controller_cms.css);
1 2
2 -#profile-editor-index .change-user-picture img { 3 +.profile_info {
3 border: 2px solid #3465A4; 4 border: 2px solid #3465A4;
4 - padding: 1px;  
5 } 5 }
6 6
7 -#profile-editor-index .set-user-picture {  
8 - text-decoration: none;  
9 - border: 2px solid #3465A4; 7 +.profile_info .button:hover {
  8 + color: #FFF !important;
  9 +}
  10 +
  11 +.profile_info th,
  12 +.profile_info td {
  13 + border: 1px solid #729FCF;
  14 +}
  15 +
  16 +.profile_info .header {
  17 + background: #729FCF;
  18 + border: 1px solid #3465A4;
  19 +}
  20 +.profile_info th {
10 background: #B8CFE7; 21 background: #B8CFE7;
11 - padding: 1px 5px;  
12 } 22 }
  23 +
public/stylesheets/controller_profile_editor.css
  1 +@import url(controller_cms.css);
  2 +
  3 +.profile_info {
  4 + width: 100%;
  5 +}
  6 +
1 .profile_info th { 7 .profile_info th {
  8 + width: 10%;
2 text-align: right; 9 text-align: right;
  10 + white-space: nowrap;
3 } 11 }
4 12
5 .profile_info td, 13 .profile_info td,
6 .profile_info th { 14 .profile_info th {
7 padding: 2px 10px; 15 padding: 2px 10px;
8 } 16 }
  17 +
  18 +.profile_info .header {
  19 + background: #BBB;
  20 +}
  21 +
  22 +.profile_info .button {
  23 + border: none !important;
  24 + background-color: transparent !important;
  25 +}