From 817df70a8d37040a6374561acf9832d935200acb Mon Sep 17 00:00:00 2001 From: Aurélio A. Heckert Date: Fri, 27 Sep 2013 14:56:04 -0300 Subject: [PATCH] Correct `#user .logged-in` ids and icons --- app/helpers/application_helper.rb | 8 ++++---- app/models/user.rb | 1 + public/designs/themes/base/style.css | 10 +++++++++- public/javascripts/application.js | 6 +++++- public/stylesheets/application.css | 5 ++++- 5 files changed, 23 insertions(+), 7 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index d193b73..7a3bdfc 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -930,7 +930,7 @@ module ApplicationHelper (@category ? " - #{@category.full_name}" : '') end - # DEPRECATED. Do not use this· + # DEPRECATED. Do not use this. def import_controller_stylesheets(options = {}) stylesheet_import( "controller_"+ @controller.controller_name(), options ) end @@ -1129,11 +1129,11 @@ module ApplicationHelper pending_tasks_count = link_to(count.to_s, @environment.top_url + '/myprofile/{login}/tasks', :id => 'pending-tasks-count', :title => _("Manage your pending tasks")) end - (_("Welcome, %s") % link_to('{login}', @environment.top_url + '/{login}', :id => "homepage-link", :title => _('Go to your homepage'))) + + (_("Welcome, %s") % link_to('{login}', @environment.top_url + '/{login}', :id => "homepage-link", :title => _('Go to your homepage'))) + render_environment_features(:usermenu) + - link_to('' + _('Administration') + '', @environment.top_url + '/admin', :id => "controlpanel", :title => _("Configure the environment"), :class => 'admin-link', :style => 'display: none') + + link_to('' + _('Administration') + '', @environment.top_url + '/admin', :title => _("Configure the environment"), :class => 'admin-link', :style => 'display: none') + manage_enterprises.to_s + - link_to('' + _('Control panel') + '', @environment.top_url + '/myprofile/{login}', :id => "controlpanel", :title => _("Configure your personal account and content")) + + link_to('' + _('Control panel') + '', @environment.top_url + '/myprofile/{login}', :class => 'ctrl-panel', :title => _("Configure your personal account and content")) + pending_tasks_count + link_to('' + _('Logout') + '', { :controller => 'account', :action => 'logout'} , :id => "logout", :title => _("Leave the system")) end diff --git a/app/models/user.rb b/app/models/user.rb index fd5d7aa..746709c 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -288,6 +288,7 @@ class User < ActiveRecord::Base end { 'login' => self.login, + 'avatar' => person.profile_custom_icon, 'is_admin' => self.person.is_admin?, 'since_month' => self.person.created_at.month, 'since_year' => self.person.created_at.year, diff --git a/public/designs/themes/base/style.css b/public/designs/themes/base/style.css index fd6c39b..dd8c238 100644 --- a/public/designs/themes/base/style.css +++ b/public/designs/themes/base/style.css @@ -89,7 +89,7 @@ body, th, td, input { color: #555753; } -#controlpanel, #logout, #openchat, #manage-enterprises { +#user .logged-in > * { margin-left: 25px; } @@ -105,6 +105,14 @@ body, th, td, input { top: 3px; } +#user #homepage-link i { + width: 18px; + height: 18px; + left: -20px; + top: -2px; + background-position: 50% 50%; +} + #user form { position: relative; display: inline; diff --git a/public/javascripts/application.js b/public/javascripts/application.js index 115e62c..2b131a1 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -539,7 +539,11 @@ jQuery(function($) { } $(this).attr('href', new_href); }); - var html = $(this).html().replace(/{login}/g, data.login).replace('{month}', data.since_month).replace('{year}', data.since_year); + var html = $(this).html() + .replace(/{login}/g, data.login) + .replace('{avatar}', data.avatar) + .replace('{month}', data.since_month) + .replace('{year}', data.since_year); $(this).html(html).fadeIn(); if (data.is_admin) { $('#user .admin-link').show(); diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index a009fe5..a26ffd9 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -868,7 +868,10 @@ code input { } #manage-enterprises .simplemenu-item a { background-repeat: no-repeat; - padding-left: 20px; + background-position: 5px 50%; + padding: 1px 0px 0px 26px; + line-height: 15px; + display: block; } #manage-enterprises .simplemenu-item a span { display: none; -- libgit2 0.21.2