From 4d68bf9576dc5bf7030351f3ca9d6b3a0322a591 Mon Sep 17 00:00:00 2001 From: AurelioAHeckert Date: Tue, 29 Apr 2008 03:27:19 +0000 Subject: [PATCH] ActionItem318: a better control panel --- app/helpers/application_helper.rb | 8 ++++++-- app/helpers/profile_helper.rb | 9 +++++++-- app/views/admin_panel/index.rhtml | 2 +- app/views/layouts/application.rhtml | 10 +++++----- app/views/profile_editor/edit_categories.rhtml | 2 +- app/views/profile_editor/index.rhtml | 17 +++++------------ public/designs/themes/default/stylesheets/controller_profile_editor.css | 23 +++++++++++++++++------ public/stylesheets/controller_profile_editor.css | 17 +++++++++++++++++ 8 files changed, 59 insertions(+), 29 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index d802927..ae1c334 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -451,10 +451,14 @@ module ApplicationHelper end attr_reader :environment - def select_categories(object_name) + def select_categories(object_name, title=nil, title_size=4) + if title.nil? + title = _('Categories') + end + object = instance_variable_get("@#{object_name}") - result = content_tag 'h4', _('Categories') + result = content_tag 'h'+title_size.to_s(), title result << javascript_tag( 'function open_close_cat( link ) { var div = link.parentNode.getElementsByTagName("div")[0]; var end = function(){ diff --git a/app/helpers/profile_helper.rb b/app/helpers/profile_helper.rb index 65aba03..938c228 100644 --- a/app/helpers/profile_helper.rb +++ b/app/helpers/profile_helper.rb @@ -5,14 +5,19 @@ module ProfileHelper if info.nil? content_tag('div', _('This profile does not have any public information')) else - table_rows = '' + table_rows = content_tag( 'tr', + content_tag( 'th', + "\n" + + button( :edit, _('edit your informations'), :controller => 'profile_editor', :action => 'edit' ) + + "\n", + :colspan => 2, :class => 'header' ) + ) + "\n" info.summary.each do |item| name = item[0] value = item[1] if value.is_a?(Proc) value = self.instance_eval(value) end - table_rows << content_tag('tr', content_tag('th', name) + content_tag('td', value)) table_rows << "\n" end diff --git a/app/views/admin_panel/index.rhtml b/app/views/admin_panel/index.rhtml index b07afe4..f5ccc30 100644 --- a/app/views/admin_panel/index.rhtml +++ b/app/views/admin_panel/index.rhtml @@ -1,4 +1,4 @@ -/

<%= _('Administrator Panel') %>

+

<%= _('Administrator Panel') %>

<%= _('You, as an environment administrator, has the following options:')%>

diff --git a/app/views/layouts/application.rhtml b/app/views/layouts/application.rhtml index d8d1b90..757edd9 100644 --- a/app/views/layouts/application.rhtml +++ b/app/views/layouts/application.rhtml @@ -107,12 +107,12 @@ -
-