Description:
before upgrading to rails 5.2
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r749:6336d013fbfd - - 2 files changed: 3 inserted, 2 deleted
@@ -1,86 +1,86 | |||||
|
1 | %h1 Bulk Manage User |
|
1 | %h1 Bulk Manage User |
|
2 |
|
2 | ||
|
3 | - = form_tag bulk_manage_user_admin_path |
|
3 | + = form_tag bulk_manage_user_admin_index_path |
|
4 | .row |
|
4 | .row |
|
5 | .col-md-6 |
|
5 | .col-md-6 |
|
6 | .panel.panel-primary |
|
6 | .panel.panel-primary |
|
7 | .panel-title.panel-heading |
|
7 | .panel-title.panel-heading |
|
8 | Filter User |
|
8 | Filter User |
|
9 | .panel-body |
|
9 | .panel-body |
|
10 | Filtering users whose login match the following MySQL regex |
|
10 | Filtering users whose login match the following MySQL regex |
|
11 | .form-group |
|
11 | .form-group |
|
12 | = label_tag "regex", 'Regex Pattern' |
|
12 | = label_tag "regex", 'Regex Pattern' |
|
13 | = text_field_tag "regex", params[:regex], class: 'form-control' |
|
13 | = text_field_tag "regex", params[:regex], class: 'form-control' |
|
14 | %p |
|
14 | %p |
|
15 | Example |
|
15 | Example |
|
16 | %ul |
|
16 | %ul |
|
17 | %li |
|
17 | %li |
|
18 | %code root |
|
18 | %code root |
|
19 | matches every user whose login contains "root" |
|
19 | matches every user whose login contains "root" |
|
20 | %li |
|
20 | %li |
|
21 | %code ^56 |
|
21 | %code ^56 |
|
22 | matches every user whose login starts with "56" |
|
22 | matches every user whose login starts with "56" |
|
23 | %li |
|
23 | %li |
|
24 | %code 21$ |
|
24 | %code 21$ |
|
25 | matches every user whose login ends with "21" |
|
25 | matches every user whose login ends with "21" |
|
26 | .col-md-6 |
|
26 | .col-md-6 |
|
27 | .panel.panel-primary |
|
27 | .panel.panel-primary |
|
28 | .panel-title.panel-heading |
|
28 | .panel-title.panel-heading |
|
29 | Action |
|
29 | Action |
|
30 | .panel-body |
|
30 | .panel-body |
|
31 | .row.form-group |
|
31 | .row.form-group |
|
32 | .col-md-6 |
|
32 | .col-md-6 |
|
33 | %label.checkbox-inline |
|
33 | %label.checkbox-inline |
|
34 | = check_box_tag "enabled", true, params[:enabled] |
|
34 | = check_box_tag "enabled", true, params[:enabled] |
|
35 | Change "Enabled" to |
|
35 | Change "Enabled" to |
|
36 | .col-md-3 |
|
36 | .col-md-3 |
|
37 | %label.radio-inline |
|
37 | %label.radio-inline |
|
38 | = radio_button_tag "enable", 1, params[:enable] == '1', id: 'enable-yes' |
|
38 | = radio_button_tag "enable", 1, params[:enable] == '1', id: 'enable-yes' |
|
39 | Yes |
|
39 | Yes |
|
40 | .col-md-3 |
|
40 | .col-md-3 |
|
41 | %label.radio-inline |
|
41 | %label.radio-inline |
|
42 | = radio_button_tag "enable", 0, params[:enable] == '0', id: 'enable-no' |
|
42 | = radio_button_tag "enable", 0, params[:enable] == '0', id: 'enable-no' |
|
43 | No |
|
43 | No |
|
44 | .row.form-group |
|
44 | .row.form-group |
|
45 | .col-md-6 |
|
45 | .col-md-6 |
|
46 | %label.checkbox-inline |
|
46 | %label.checkbox-inline |
|
47 | = check_box_tag "gen_password", true, params[:gen_password] |
|
47 | = check_box_tag "gen_password", true, params[:gen_password] |
|
48 | Generate new random password |
|
48 | Generate new random password |
|
49 | .row.form-group |
|
49 | .row.form-group |
|
50 | .col-md-4 |
|
50 | .col-md-4 |
|
51 | %label.checkbox-inline |
|
51 | %label.checkbox-inline |
|
52 | = check_box_tag "add_group", true, params[:add_group] |
|
52 | = check_box_tag "add_group", true, params[:add_group] |
|
53 | Add users to group |
|
53 | Add users to group |
|
54 | %label.col-md-3.control-label.text-right Group name |
|
54 | %label.col-md-3.control-label.text-right Group name |
|
55 | .col-md-5 |
|
55 | .col-md-5 |
|
56 | = select_tag "group_name", options_from_collection_for_select( Group.all, 'id','name',params[:group_name]), id: 'group_name',class: 'form-control select2' |
|
56 | = select_tag "group_name", options_from_collection_for_select( Group.all, 'id','name',params[:group_name]), id: 'group_name',class: 'form-control select2' |
|
57 |
|
57 | ||
|
58 |
|
58 | ||
|
59 | .row |
|
59 | .row |
|
60 | .col-md-12 |
|
60 | .col-md-12 |
|
61 | = submit_tag "Preview Result", class: 'btn btn-default' |
|
61 | = submit_tag "Preview Result", class: 'btn btn-default' |
|
62 | - if @users |
|
62 | - if @users |
|
63 | .row |
|
63 | .row |
|
64 | .col-md-4 |
|
64 | .col-md-4 |
|
65 | - if @action |
|
65 | - if @action |
|
66 | %h2 Confirmation |
|
66 | %h2 Confirmation |
|
67 | - if @action[:set_enable] |
|
67 | - if @action[:set_enable] |
|
68 | .alert.alert-info The following users will be set #{(@action[:enabled] ? 'enable' : 'disable')}. |
|
68 | .alert.alert-info The following users will be set #{(@action[:enabled] ? 'enable' : 'disable')}. |
|
69 | - if @action[:gen_password] |
|
69 | - if @action[:gen_password] |
|
70 | .alert.alert-info The password of the following users will be randomly generated. |
|
70 | .alert.alert-info The password of the following users will be randomly generated. |
|
71 | .row |
|
71 | .row |
|
72 | .col-md-4 |
|
72 | .col-md-4 |
|
73 | = submit_tag "Perform", class: 'btn btn-primary' |
|
73 | = submit_tag "Perform", class: 'btn btn-primary' |
|
74 | .row |
|
74 | .row |
|
75 | .col-md-12 |
|
75 | .col-md-12 |
|
76 | The pattern matches #{@users.count} following users. |
|
76 | The pattern matches #{@users.count} following users. |
|
77 | %br |
|
77 | %br |
|
78 | - @users.each do |user| |
|
78 | - @users.each do |user| |
|
79 | = user.login |
|
79 | = user.login |
|
80 | = ' ' |
|
80 | = ' ' |
|
81 | = user.full_name |
|
81 | = user.full_name |
|
82 | = ' ' |
|
82 | = ' ' |
|
83 | = "(#{user.remark})" if user.remark |
|
83 | = "(#{user.remark})" if user.remark |
|
84 | %br |
|
84 | %br |
|
85 |
|
85 | ||
|
86 |
|
86 |
@@ -1,166 +1,167 | |||||
|
1 | CafeGrader::Application.routes.draw do |
|
1 | CafeGrader::Application.routes.draw do |
|
2 | resources :tags |
|
2 | resources :tags |
|
3 | get "sources/direct_edit" |
|
3 | get "sources/direct_edit" |
|
4 |
|
4 | ||
|
5 | root :to => 'main#login' |
|
5 | root :to => 'main#login' |
|
6 |
|
6 | ||
|
7 | #logins |
|
7 | #logins |
|
8 | match 'login/login', to: 'login#login', via: [:get,:post] |
|
8 | match 'login/login', to: 'login#login', via: [:get,:post] |
|
9 |
|
9 | ||
|
10 |
|
10 | ||
|
11 | resources :contests |
|
11 | resources :contests |
|
12 |
|
12 | ||
|
13 | resources :sites |
|
13 | resources :sites |
|
14 |
|
14 | ||
|
15 | resources :test |
|
15 | resources :test |
|
16 |
|
16 | ||
|
17 | resources :messages do |
|
17 | resources :messages do |
|
18 | collection do |
|
18 | collection do |
|
19 | get 'console' |
|
19 | get 'console' |
|
20 | end |
|
20 | end |
|
21 | end |
|
21 | end |
|
22 |
|
22 | ||
|
23 | resources :announcements do |
|
23 | resources :announcements do |
|
24 | member do |
|
24 | member do |
|
25 | get 'toggle','toggle_front' |
|
25 | get 'toggle','toggle_front' |
|
26 | end |
|
26 | end |
|
27 | end |
|
27 | end |
|
28 |
|
28 | ||
|
29 | resources :problems do |
|
29 | resources :problems do |
|
30 | member do |
|
30 | member do |
|
31 | get 'toggle' |
|
31 | get 'toggle' |
|
32 | get 'toggle_test' |
|
32 | get 'toggle_test' |
|
33 | get 'toggle_view_testcase' |
|
33 | get 'toggle_view_testcase' |
|
34 | get 'stat' |
|
34 | get 'stat' |
|
35 | end |
|
35 | end |
|
36 | collection do |
|
36 | collection do |
|
37 | get 'turn_all_off' |
|
37 | get 'turn_all_off' |
|
38 | get 'turn_all_on' |
|
38 | get 'turn_all_on' |
|
39 | get 'import' |
|
39 | get 'import' |
|
40 | get 'manage' |
|
40 | get 'manage' |
|
41 | end |
|
41 | end |
|
42 | end |
|
42 | end |
|
43 |
|
43 | ||
|
44 | resources :groups do |
|
44 | resources :groups do |
|
45 | member do |
|
45 | member do |
|
46 | post 'add_user', to: 'groups#add_user', as: 'add_user' |
|
46 | post 'add_user', to: 'groups#add_user', as: 'add_user' |
|
47 | delete 'remove_user/:user_id', to: 'groups#remove_user', as: 'remove_user' |
|
47 | delete 'remove_user/:user_id', to: 'groups#remove_user', as: 'remove_user' |
|
48 | delete 'remove_all_user', to: 'groups#remove_all_user', as: 'remove_all_user' |
|
48 | delete 'remove_all_user', to: 'groups#remove_all_user', as: 'remove_all_user' |
|
49 | post 'add_problem', to: 'groups#add_problem', as: 'add_problem' |
|
49 | post 'add_problem', to: 'groups#add_problem', as: 'add_problem' |
|
50 | delete 'remove_problem/:problem_id', to: 'groups#remove_problem', as: 'remove_problem' |
|
50 | delete 'remove_problem/:problem_id', to: 'groups#remove_problem', as: 'remove_problem' |
|
51 | delete 'remove_all_problem', to: 'groups#remove_all_problem', as: 'remove_all_problem' |
|
51 | delete 'remove_all_problem', to: 'groups#remove_all_problem', as: 'remove_all_problem' |
|
52 | end |
|
52 | end |
|
53 | collection do |
|
53 | collection do |
|
54 |
|
54 | ||
|
55 | end |
|
55 | end |
|
56 | end |
|
56 | end |
|
57 |
|
57 | ||
|
58 | resources :testcases, only: [] do |
|
58 | resources :testcases, only: [] do |
|
59 | member do |
|
59 | member do |
|
60 | get 'download_input' |
|
60 | get 'download_input' |
|
61 | get 'download_sol' |
|
61 | get 'download_sol' |
|
62 | end |
|
62 | end |
|
63 | collection do |
|
63 | collection do |
|
64 | get 'show_problem/:problem_id(/:test_num)' => 'testcases#show_problem', as: 'show_problem' |
|
64 | get 'show_problem/:problem_id(/:test_num)' => 'testcases#show_problem', as: 'show_problem' |
|
65 | end |
|
65 | end |
|
66 | end |
|
66 | end |
|
67 |
|
67 | ||
|
68 | resources :grader_configuration, controller: 'configurations' |
|
68 | resources :grader_configuration, controller: 'configurations' |
|
69 |
|
69 | ||
|
70 | resources :users do |
|
70 | resources :users do |
|
71 | member do |
|
71 | member do |
|
72 | get 'toggle_activate', 'toggle_enable' |
|
72 | get 'toggle_activate', 'toggle_enable' |
|
73 | get 'stat' |
|
73 | get 'stat' |
|
74 | end |
|
74 | end |
|
75 | end |
|
75 | end |
|
76 |
|
76 | ||
|
77 | resources :submissions do |
|
77 | resources :submissions do |
|
78 | member do |
|
78 | member do |
|
79 | get 'download' |
|
79 | get 'download' |
|
80 | get 'compiler_msg' |
|
80 | get 'compiler_msg' |
|
81 | get 'rejudge' |
|
81 | get 'rejudge' |
|
82 | end |
|
82 | end |
|
83 | collection do |
|
83 | collection do |
|
84 | get 'prob/:problem_id', to: 'submissions#index', as: 'problem' |
|
84 | get 'prob/:problem_id', to: 'submissions#index', as: 'problem' |
|
85 | get 'direct_edit_problem/:problem_id(/:user_id)', to: 'submissions#direct_edit_problem', as: 'direct_edit_problem' |
|
85 | get 'direct_edit_problem/:problem_id(/:user_id)', to: 'submissions#direct_edit_problem', as: 'direct_edit_problem' |
|
86 | get 'get_latest_submission_status/:uid/:pid', to: 'submissions#get_latest_submission_status', as: 'get_latest_submission_status' |
|
86 | get 'get_latest_submission_status/:uid/:pid', to: 'submissions#get_latest_submission_status', as: 'get_latest_submission_status' |
|
87 | end |
|
87 | end |
|
88 | end |
|
88 | end |
|
89 |
|
89 | ||
|
90 |
|
90 | ||
|
91 | #user admin |
|
91 | #user admin |
|
92 | resources :user_admin do |
|
92 | resources :user_admin do |
|
93 | collection do |
|
93 | collection do |
|
94 |
- |
|
94 | + match 'bulk_manage', via: [:get, :post] |
|
95 | get 'user_stat' |
|
95 | get 'user_stat' |
|
96 | get 'import' |
|
96 | get 'import' |
|
97 | get 'new_list' |
|
97 | get 'new_list' |
|
98 | get 'admin' |
|
98 | get 'admin' |
|
99 | get 'random_all_passwords' |
|
99 | get 'random_all_passwords' |
|
100 | get 'active' |
|
100 | get 'active' |
|
101 | get 'mass_mailing' |
|
101 | get 'mass_mailing' |
|
|
102 | + match 'create_from_list', via: [:get, :post] | ||
|
102 | end |
|
103 | end |
|
103 | member do |
|
104 | member do |
|
104 | get 'clear_last_ip' |
|
105 | get 'clear_last_ip' |
|
105 | end |
|
106 | end |
|
106 | end |
|
107 | end |
|
107 |
|
108 | ||
|
108 | resources :contest_management, only: [:index] do |
|
109 | resources :contest_management, only: [:index] do |
|
109 | collection do |
|
110 | collection do |
|
110 | get 'user_stat' |
|
111 | get 'user_stat' |
|
111 | get 'clear_stat' |
|
112 | get 'clear_stat' |
|
112 | get 'clear_all_stat' |
|
113 | get 'clear_all_stat' |
|
113 | end |
|
114 | end |
|
114 | end |
|
115 | end |
|
115 |
|
116 | ||
|
116 | #get 'user_admin', to: 'user_admin#index' |
|
117 | #get 'user_admin', to: 'user_admin#index' |
|
117 | #get 'user_admin/bulk_manage', to: 'user_admin#bulk_manage', as: 'bulk_manage_user_admin' |
|
118 | #get 'user_admin/bulk_manage', to: 'user_admin#bulk_manage', as: 'bulk_manage_user_admin' |
|
118 | #post 'user_admin', to: 'user_admin#create' |
|
119 | #post 'user_admin', to: 'user_admin#create' |
|
119 | #delete 'user_admin/:id', to: 'user_admin#destroy', as: 'user_admin_destroy' |
|
120 | #delete 'user_admin/:id', to: 'user_admin#destroy', as: 'user_admin_destroy' |
|
120 |
|
121 | ||
|
121 | #singular resource |
|
122 | #singular resource |
|
122 | #---- BEWARE ---- singular resource maps to plural controller by default, we can override by provide controller name directly |
|
123 | #---- BEWARE ---- singular resource maps to plural controller by default, we can override by provide controller name directly |
|
123 | #report |
|
124 | #report |
|
124 | resource :report, only: [], controller: 'report' do |
|
125 | resource :report, only: [], controller: 'report' do |
|
125 | get 'login' |
|
126 | get 'login' |
|
126 | get 'multiple_login' |
|
127 | get 'multiple_login' |
|
127 | get 'problem_hof/:id', action: 'problem_hof' |
|
128 | get 'problem_hof/:id', action: 'problem_hof' |
|
128 | get 'current_score' |
|
129 | get 'current_score' |
|
129 | get 'max_score' |
|
130 | get 'max_score' |
|
130 | post 'show_max_score' |
|
131 | post 'show_max_score' |
|
131 | end |
|
132 | end |
|
132 | #get 'report/current_score', to: 'report#current_score', as: 'report_current_score' |
|
133 | #get 'report/current_score', to: 'report#current_score', as: 'report_current_score' |
|
133 | #get 'report/problem_hof(/:id)', to: 'report#problem_hof', as: 'report_problem_hof' |
|
134 | #get 'report/problem_hof(/:id)', to: 'report#problem_hof', as: 'report_problem_hof' |
|
134 | #get "report/login" |
|
135 | #get "report/login" |
|
135 | #get 'report/max_score', to: 'report#max_score', as: 'report_max_score' |
|
136 | #get 'report/max_score', to: 'report#max_score', as: 'report_max_score' |
|
136 | #post 'report/show_max_score', to: 'report#show_max_score', as: 'report_show_max_score' |
|
137 | #post 'report/show_max_score', to: 'report#show_max_score', as: 'report_show_max_score' |
|
137 |
|
138 | ||
|
138 | resource :main, only: [], controller: 'main' do |
|
139 | resource :main, only: [], controller: 'main' do |
|
139 | get 'list' |
|
140 | get 'list' |
|
140 | get 'submission(/:id)', action: 'submission', as: 'main_submission' |
|
141 | get 'submission(/:id)', action: 'submission', as: 'main_submission' |
|
141 | post 'submit' |
|
142 | post 'submit' |
|
142 | get 'announcements' |
|
143 | get 'announcements' |
|
143 | get 'help' |
|
144 | get 'help' |
|
144 | end |
|
145 | end |
|
145 | #main |
|
146 | #main |
|
146 | #get "main/list" |
|
147 | #get "main/list" |
|
147 | #get 'main/submission(/:id)', to: 'main#submission', as: 'main_submission' |
|
148 | #get 'main/submission(/:id)', to: 'main#submission', as: 'main_submission' |
|
148 | #post 'main/submit', to: 'main#submit' |
|
149 | #post 'main/submit', to: 'main#submit' |
|
149 | #get 'main/announcements', to: 'main#announcements' |
|
150 | #get 'main/announcements', to: 'main#announcements' |
|
150 |
|
151 | ||
|
151 |
|
152 | ||
|
152 | # |
|
153 | # |
|
153 | get 'tasks/view/:file.:ext' => 'tasks#view' |
|
154 | get 'tasks/view/:file.:ext' => 'tasks#view' |
|
154 | get 'tasks/download/:id/:file.:ext' => 'tasks#download' |
|
155 | get 'tasks/download/:id/:file.:ext' => 'tasks#download' |
|
155 | get 'heartbeat/:id/edit' => 'heartbeat#edit' |
|
156 | get 'heartbeat/:id/edit' => 'heartbeat#edit' |
|
156 |
|
157 | ||
|
157 | #grader |
|
158 | #grader |
|
158 | get 'graders/list', to: 'graders#list', as: 'grader_list' |
|
159 | get 'graders/list', to: 'graders#list', as: 'grader_list' |
|
159 |
|
160 | ||
|
160 |
|
161 | ||
|
161 | # See how all your routes lay out with "rake routes" |
|
162 | # See how all your routes lay out with "rake routes" |
|
162 |
|
163 | ||
|
163 | # This is a legacy wild controller route that's not recommended for RESTful applications. |
|
164 | # This is a legacy wild controller route that's not recommended for RESTful applications. |
|
164 | # Note: This route will make all actions in every controller accessible via GET requests. |
|
165 | # Note: This route will make all actions in every controller accessible via GET requests. |
|
165 | # match ':controller(/:action(/:id))(.:format)', via: [:get, :post] |
|
166 | # match ':controller(/:action(/:id))(.:format)', via: [:get, :post] |
|
166 | end |
|
167 | end |
You need to be logged in to leave comments.
Login now