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