Show full user name when selecting reviewer

6 views
Skip to first unread message

Chen Yufei

unread,
Dec 25, 2009, 2:51:44 AM12/25/09
to reviewboard
When selecting reviewers, the auto complete drop down list is helpful.
However, I and my colleagues think think that showing the user's full
name will be more helpful.

This is not difficult to do, here's my quick and dirty implementation,
patch to release-1.0.5.1

diff --git a/reviewboard/htdocs/media/rb/js/reviews.js b/reviewboard/
htdocs/media/rb/js/reviews.js
index f02b6e4..033e7a7 100644
--- a/reviewboard/htdocs/media/rb/js/reviews.js
+++ b/reviewboard/htdocs/media/rb/js/reviews.js
@@ -285,6 +285,16 @@ $.fn.reviewsAutoComplete = function(fieldName,
nameKey) {
$(this)
.autocomplete({
formatItem: function(data) {
+ // Maybe this is not the best place to modify
+ if (fieldName == "users") {
+ return data["username"] + " (" + data
["fullname"] + ")";
+ }
+ return data[nameKey];
+ },
+ formatResult: function(data) {
+ if (fieldName == "users") {
+ return data["username"];
+ }
return data[nameKey];
},
matchCase: false,

Christian Hammond

unread,
Dec 25, 2009, 10:13:49 AM12/25/09
to revie...@googlegroups.com
This feature is already in the Review Board 1.1 alpha releases.

Christian

--
Christian Hammond - chi...@chipx86.com
Review Board - http://www.reviewboard.org
VMware, Inc. - http://www.vmware.com



--
Want to help the Review Board project? Donate today at http://www.reviewboard.org/donate/
Happy user? Let us know at http://www.reviewboard.org/users/
-~----------~----~----~----~------~----~------~--~---
To unsubscribe from this group, send email to reviewboard...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/reviewboard?hl=en

Chen Yufei

unread,
Dec 26, 2009, 2:30:52 AM12/26/09
to reviewboard
That's great!

Thanks.

On Dec 25, 3:13 pm, Christian Hammond <chip...@chipx86.com> wrote:
> This feature is already in the Review Board 1.1 alpha releases.
>
> Christian
>
> --

> Christian Hammond - chip...@chipx86.com
> Review Board -http://www.reviewboard.org
> VMware, Inc. -http://www.vmware.com

> > Happy user? Let us know athttp://www.reviewboard.org/users/


> > -~----------~----~----~----~------~----~------~--~---
> > To unsubscribe from this group, send email to

> > reviewboard...@googlegroups.com<reviewboard%2Bunsu...@googlegroups.com>

Reply all
Reply to author
Forward
0 new messages