[PATCH 18 of 19] pullrequest: re-add username when adding reviewers
Thomas De Schampheleire
patrickdepinguin at gmail.com
Tue Jun 30 16:43:28 EDT 2015
# HG changeset patch
# User Thomas De Schampheleire <thomas.de.schampheleire at gmail.com>
# Date 1435087755 -7200
# Tue Jun 23 21:29:15 2015 +0200
# Node ID 1b989931c539d2ef2160eb9d2b5734d9c711d5ca
# Parent 678e992671c1591c2a0afd4e181aa36909401654
pullrequest: re-add username when adding reviewers
Commit 90e982b6bca8 removed the username when adding reviewers, to align the
way new and existing reviewers are displayed. However, when a user does not
have a name set, the list of reviewers becomes useless unless the username
is displayed too.
diff --git a/kallithea/public/js/base.js b/kallithea/public/js/base.js
--- a/kallithea/public/js/base.js
+++ b/kallithea/public/js/base.js
@@ -1371,7 +1371,10 @@ var MentionsAutoComplete = function (inp
}
var addReviewMember = function(id,fname,lname,nname,gravatar_link,gravatar_size){
- var displayname = "{0} {1}".format(fname, lname);
+ var displayname = nname;
+ if ((fname != "") && (lname != "")) {
+ displayname = "{0} {1} ({2})".format(fname, lname, nname);
+ }
var gravatarelm = gravatar(gravatar_link, gravatar_size, "");
// WARNING: the HTML below is duplicate with
// kallithea/templates/pullrequests/pullrequest_show.html
diff --git a/kallithea/templates/pullrequests/pullrequest_show.html b/kallithea/templates/pullrequests/pullrequest_show.html
--- a/kallithea/templates/pullrequests/pullrequest_show.html
+++ b/kallithea/templates/pullrequests/pullrequest_show.html
@@ -223,7 +223,7 @@
<div class="reviewer_gravatar gravatar">
${h.gravatar(member.email, size=14)}
</div>
- <div style="float:left;">${member.full_name} (${_('Owner') if c.pull_request.user_id == member.user_id else _('Reviewer')})</div>
+ <div style="float:left;">${member.full_name_and_username} (${_('Owner') if c.pull_request.user_id == member.user_id else _('Reviewer')})</div>
<input type="hidden" value="${member.user_id}" name="review_members" />
%if editable:
<div class="reviewer_member_remove action_button" onclick="removeReviewMember(${member.user_id})" title="${_('Remove reviewer')}">
More information about the kallithea-general
mailing list