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