From 7a3833503764c3411cccb8b053740565bda7b442 Mon Sep 17 00:00:00 2001 From: George Vinogradov Date: Wed, 4 Jul 2012 19:27:20 +0400 Subject: [PATCH 1/2] [issue #527] Fixed group members list --- app/views/groups/members/index.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/groups/members/index.html.haml b/app/views/groups/members/index.html.haml index 0fb2ab5f0..622a9a13e 100644 --- a/app/views/groups/members/index.html.haml +++ b/app/views/groups/members/index.html.haml @@ -15,7 +15,7 @@ %span#niceCheckbox1.niceCheck-main= check_box_tag "user_remove[#{user.id}][]" %td .img= image_tag avatar_url(user) - .forimg= link_to user.name, user_path(user) + .forimg= link_to "#{user.uname} (#{user.name})", user_path(user) - Relation::ROLES.each_with_index do |role, i| %td .radio= radio_button_tag "user[#{user.id}]", role, ((parent.actors.exists? :actor_id => user.id, :actor_type => 'User', :role => role) ? :checked : nil), :class => 'niceRadio' From a2d35d25385e21cf897acf1b44e32d7f98e19c8e Mon Sep 17 00:00:00 2001 From: George Vinogradov Date: Wed, 4 Jul 2012 19:53:18 +0400 Subject: [PATCH 2/2] [issue #527] Use User#fullname instead of string. --- app/models/user.rb | 2 +- app/views/groups/members/index.html.haml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index 7bbd42965..ede3710e6 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -73,7 +73,7 @@ class User < ActiveRecord::Base end def fullname - return "#{uname} (#{name})" + return name.present? && name.length > 0 ? "#{uname} (#{name})" : uname end def user_appeal diff --git a/app/views/groups/members/index.html.haml b/app/views/groups/members/index.html.haml index 622a9a13e..9f80db048 100644 --- a/app/views/groups/members/index.html.haml +++ b/app/views/groups/members/index.html.haml @@ -15,7 +15,7 @@ %span#niceCheckbox1.niceCheck-main= check_box_tag "user_remove[#{user.id}][]" %td .img= image_tag avatar_url(user) - .forimg= link_to "#{user.uname} (#{user.name})", user_path(user) + .forimg= link_to user.fullname, user_path(user) - Relation::ROLES.each_with_index do |role, i| %td .radio= radio_button_tag "user[#{user.id}]", role, ((parent.actors.exists? :actor_id => user.id, :actor_type => 'User', :role => role) ? :checked : nil), :class => 'niceRadio'