Description:
fix bug with duplicate logins are given also increase dropdown size on group view
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r809:e8c8ed4696af - - 3 files changed: 7 inserted, 3 deleted

@@ -7,13 +7,13
7 7
8 8 #has_and_belongs_to_many :problems
9 9 #has_and_belongs_to_many :users
10 10
11 11 def add_users_skip_existing(users_list)
12 12 new_list = []
13 - users_list.each do |u|
13 + users_list.uniq.each do |u|
14 14 new_list << u unless users.include? u
15 15 end
16 16 users << new_list
17 17 end
18 18
19 19 end
@@ -79,12 +79,16
79 79 hashed_password == User.encrypt(password,self.salt)
80 80 else
81 81 false
82 82 end
83 83 end
84 84
85 + def login_with_name
86 + "[#{login}] #{full_name}"
87 + end
88 +
85 89 def admin?
86 90 has_role?('admin')
87 91 end
88 92
89 93 def has_role?(role)
90 94 self.roles.where(name: role).count > 0
@@ -24,13 +24,13
24 24 page. You can also use
25 25 = link_to 'Bulk Manage User', bulk_manage_user_admin_index_path
26 26 page.
27 27 =form_tag add_user_group_path(@group), class: 'form-inline' do
28 28 .form-group
29 29 =label_tag :user_id, "User"
30 - =select_tag :user_id, options_from_collection_for_select(User.all,'id','full_name'), class: 'select2', style: 'width: 10em';
30 + =select_tag :user_id, options_from_collection_for_select(User.all,'id','login_with_name'), class: 'select2', style: 'width: 25em';
31 31 =submit_tag "Add",class: 'btn btn-primary'
32 32
33 33
34 34 %table.table.table-hover
35 35 %thead
36 36 %tr
@@ -56,13 +56,13
56 56 If you want to add several problem to a group, it may be easier to bulk manage them in the
57 57 = link_to 'Bulk Manage Problems', manage_problems_path
58 58 page
59 59 =form_tag add_problem_group_path(@group), class: 'form-inline' do
60 60 .form-group
61 61 =label_tag :problem_id, "Problem"
62 - =select_tag :problem_id, options_from_collection_for_select(Problem.all,'id','full_name'), class: 'select2', style: 'width: 10em';
62 + =select_tag :problem_id, options_from_collection_for_select(Problem.all,'id','long_name'), class: 'select2', style: 'width: 25em';
63 63 =submit_tag "Add",class: 'btn btn-primary'
64 64
65 65
66 66 %table.table.table-hover
67 67 %thead
68 68 %tr
You need to be logged in to leave comments. Login now