From: dklawren Date: Wed, 17 Oct 2018 05:05:44 +0000 (-0400) Subject: Bug 1499477 - Feature request: link from user profile to editusers. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f01a03c79166221bc2a8378f8e5deda834f70f1b;p=thirdparty%2Fbugzilla.git Bug 1499477 - Feature request: link from user profile to editusers. * Bug 1499477 - Feature request: link from user profile to editusers. * Merged name and email to single field * Hide redundant Profile link when viewing user profile page --- diff --git a/extensions/BMO/web/js/edituser_menu.js b/extensions/BMO/web/js/edituser_menu.js index 6fb617eb8..30d0a5884 100644 --- a/extensions/BMO/web/js/edituser_menu.js +++ b/extensions/BMO/web/js/edituser_menu.js @@ -5,15 +5,8 @@ * This Source Code Form is "Incompatible With Secondary Licenses", as * defined by the Mozilla Public License, v. 2.0. */ -function show_usermenu(id, email, show_edit) { +function show_usermenu(id, email, show_edit, hide_profile) { var items = [ - { - name: "Profile", - callback: function () { - var href = `${BUGZILLA.config.basepath}user_profile?user_id=${id}`; - window.open(href, "_blank"); - } - }, { name: "Activity", callback: function () { @@ -30,6 +23,15 @@ function show_usermenu(id, email, show_edit) { } } ]; + if (!hide_profile) { + items.push({ + name: "Profile", + callback: function () { + var href = `${BUGZILLA.config.basepath}user_profile?user_id=${id}`; + window.open(href, "_blank"); + } + }); + } if (show_edit) { items.push({ name: "Edit", @@ -49,6 +51,6 @@ function show_usermenu(id, email, show_edit) { $(function() { $('.show_usermenu').on("click", function (event) { var $this = $(this); - return show_usermenu($this.data('user-id'), $this.data('user-email'), $this.data('show-edit')); + return show_usermenu($this.data('user-id'), $this.data('user-email'), $this.data('show-edit'), $this.data('hide-profile')); }); }); diff --git a/extensions/BugModal/template/en/default/bug_modal/user.html.tmpl b/extensions/BugModal/template/en/default/bug_modal/user.html.tmpl index 96705e138..ba24ac4ab 100644 --- a/extensions/BugModal/template/en/default/bug_modal/user.html.tmpl +++ b/extensions/BugModal/template/en/default/bug_modal/user.html.tmpl @@ -47,6 +47,7 @@ END; data-user-email="[% u.email FILTER html %]" data-user-id="[% u.id FILTER html %]" data-show-edit="[% user.in_group('editusers') || user.in_group('disableusers') || user.bless_groups.size > 0 ? 1 : 0 %]" + data-hide-profile="[% hide_profile ? 1: 0 %]" title="[% u.identity FILTER html %]" [% ELSE %] href="[% basepath FILTER none %]user_profile?user_id=[% u.id FILTER none %]" 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 bd6793cb7..eb73d89b3 100644 --- a/extensions/UserProfile/template/en/default/pages/user_profile.html.tmpl +++ b/extensions/UserProfile/template/en/default/pages/user_profile.html.tmpl @@ -57,26 +57,12 @@   [% END %] - Name + User - [% target.name || target.address.user FILTER html %] + [% INCLUDE bug_modal/user.html.tmpl u = target hide_profile = 1 %] -[% IF user.id %] - - Email - - [% target.login FILTER html %] - [% " (disabled)" UNLESS target.is_enabled %] - - - -   - - -[% END %] - [%# user.creation_ts is added by the TagNewUsers extension %] [% IF target.can('creation_ts') %]