]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1499477 - Feature request: link from user profile to editusers.
authordklawren <dklawren@users.noreply.github.com>
Wed, 17 Oct 2018 05:05:44 +0000 (01:05 -0400)
committerKohei Yoshino <kohei.yoshino@gmail.com>
Wed, 17 Oct 2018 05:05:44 +0000 (01:05 -0400)
* 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

extensions/BMO/web/js/edituser_menu.js
extensions/BugModal/template/en/default/bug_modal/user.html.tmpl
extensions/UserProfile/template/en/default/pages/user_profile.html.tmpl

index 6fb617eb8a092dcf0de48fb08a1b7b6144f0750e..30d0a5884bbcb6696dc7e1e150ff49d301e02ebd 100644 (file)
@@ -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'));
   });
 });
index 96705e1389b0c9ff3294c09aa5dcea1502f1237b..ba24ac4abc33eaa8772ffdaceb7af102df64b9c4 100644 (file)
@@ -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 %]"
index bd6793cb7c0d65185090263be53aebf205b108da..eb73d89b3cdb60c3cf9c638265de90cdb0ecea72 100644 (file)
       &nbsp;
     [% END %]
   </td>
-  <th>Name</th>
+  <th>User</th>
   <td colspan="2">
-    [% target.name || target.address.user FILTER html %]
+    [% INCLUDE bug_modal/user.html.tmpl u = target hide_profile = 1 %]
   </td>
 </tr>
 
-[% IF user.id %]
-  <tr>
-    <th>Email</th>
-    <td colspan="2">
-      <a href="mailto:[% target.login FILTER uri %]">[% target.login FILTER html %]</a>
-      [% " (disabled)" UNLESS target.is_enabled %]
-    </td>
-  </tr>
-  <tr>
-    <td>&nbsp;
-    </td>
-  </tr>
-[% END %]
-
 [%# user.creation_ts is added by the TagNewUsers extension %]
 [% IF target.can('creation_ts') %]
   <tr>