From e5d385374cb02e7d6b1b2013144135264ec5d29a Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Fri, 1 Nov 2013 15:39:59 +0800 Subject: Bug 911812: make the user profile more discoverable --- extensions/UserProfile/Extension.pm | 9 ++- .../en/default/pages/user_profile.html.tmpl | 69 ++++++++++------------ extensions/UserProfile/web/styles/user_profile.css | 44 ++++++++++++++ 3 files changed, 82 insertions(+), 40 deletions(-) create mode 100644 extensions/UserProfile/web/styles/user_profile.css (limited to 'extensions/UserProfile') diff --git a/extensions/UserProfile/Extension.pm b/extensions/UserProfile/Extension.pm index 99f235896..9e8eadb97 100644 --- a/extensions/UserProfile/Extension.pm +++ b/extensions/UserProfile/Extension.pm @@ -281,16 +281,18 @@ sub page_before_template { my $target; my $input = Bugzilla->input_params; my $limit = Bugzilla->params->{'maxusermatches'} + 1; - if (!$input->{login}) { + my $login = $input->{login}; + if (!$login) { $target = Bugzilla->login(LOGIN_REQUIRED); + $login = $target->login; } else { - my $users = Bugzilla::User::match($input->{login}, $limit, 1); + my $users = Bugzilla::User::match($login, $limit, 1); if (scalar(@$users) == 1) { # always allow singular matches without confirmation $target = $users->[0]; } else { Bugzilla::User::match_field({ 'login' => {'type' => 'single'} }); - $target = Bugzilla::User->check($input->{login}); + $target = Bugzilla::User->check($login); } } @@ -353,6 +355,7 @@ sub page_before_template { $vars->{stats} = $stats; $vars->{statuses} = $statuses; $vars->{products} = $products; + $vars->{login} = $login; $vars->{target} = $target; } diff --git a/extensions/UserProfile/template/en/default/pages/user_profile.html.tmpl b/extensions/UserProfile/template/en/default/pages/user_profile.html.tmpl index 005d53443..71442b822 100644 --- a/extensions/UserProfile/template/en/default/pages/user_profile.html.tmpl +++ b/extensions/UserProfile/template/en/default/pages/user_profile.html.tmpl @@ -8,39 +8,9 @@ [% PROCESS global/variables.none.tmpl %] -[% inline_styles = BLOCK %] - #login_autocomplete { - float: left; - } - - #user_profile_table th { - text-align: right; - padding-right: 1em; - vertical-align: middle; - white-space: nowrap; - } - - #user_profile_table .numeric { - text-align: right; - } - - #user_profile_table .product_span { - white-space: nowrap; - } - - #what { - margin-top: 2em; - } - - #updated { - font-style: italic; - font-size: x-small; - } -[% END %] - [% PROCESS global/header.html.tmpl title = "User Profile: " _ target.identity - style = inline_styles + style_urls = [ "extensions/UserProfile/web/styles/user_profile.css" ] yui = [ 'autocomplete' ] javascript_urls = [ "js/field.js" ] %] @@ -48,13 +18,14 @@ - + + + + + + + + + + + + - - [%# user.creation_ts is added by the TagNewUsers extension %] @@ -150,7 +138,7 @@ - - + + + + + + +
Email Search
[% INCLUDE global/userselect.html.tmpl id => "login" name => "login" - value => target.email + value => login size => 40 emptyok => 0 %] @@ -64,14 +35,31 @@

+ [% IF user.gravatar %] +
+ [% IF target.id == user.id %] + Change my image + [% END %] + [% ELSE %] +   + [% END %] +
Name [% target.name FILTER html %]
Email[% target.login FILTER html %]
   
Statuses changed + Statuses changed RESOLVED ([% statuses.item('RESOLVED') || 0 FILTER html %]), FIXED ([% statuses.item('RESOLVED/FIXED') || 0 FILTER html %]), @@ -160,7 +148,7 @@
Activity by product + Activity by product [% FOREACH p = products %] @@ -176,6 +164,13 @@
    
diff --git a/extensions/UserProfile/web/styles/user_profile.css b/extensions/UserProfile/web/styles/user_profile.css new file mode 100644 index 000000000..c261c24b6 --- /dev/null +++ b/extensions/UserProfile/web/styles/user_profile.css @@ -0,0 +1,44 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This Source Code Form is "Incompatible With Secondary Licenses", as + * defined by the Mozilla Public License, v. 2.0. */ + +#login_autocomplete { + float: left; +} + +#user_profile_table th { + text-align: right; + padding-right: 1em; + vertical-align: middle; + white-space: nowrap; +} + +#user_profile_table .numeric { + text-align: right; +} + +#user_profile_table .product_span { + white-space: nowrap; +} + +#updated { + font-style: italic; + font-size: x-small; +} + +#gravatar-container { + text-align: center; + font-size: x-small; + vertical-align: top; + padding-right: 15px; +} + +#gravatar { + -moz-box-shadow: 2px 2px 5px #888; + -webkit-box-shadow: 2px 2px 5px #888; + box-shadow: 2px 2px 5px #888; + margin-bottom: 5px; +} -- cgit v1.2.3-24-g4f1b