Description:
- bootstrap: user admin quick add
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r571:f8d309d2e37e - - 2 files changed: 30 inserted, 29 deleted
@@ -55,7 +55,7 | |||||
|
55 | @user.activated = true |
|
55 | @user.activated = true |
|
56 | if @user.save |
|
56 | if @user.save |
|
57 | flash[:notice] = 'User was successfully created.' |
|
57 | flash[:notice] = 'User was successfully created.' |
|
58 |
- redirect_to :action => ' |
|
58 | + redirect_to :action => 'index' |
|
59 | else |
|
59 | else |
|
60 | render :action => 'new' |
|
60 | render :action => 'new' |
|
61 | end |
|
61 | end |
@@ -65,7 +65,7 | |||||
|
65 | @user = User.find(params[:id]) |
|
65 | @user = User.find(params[:id]) |
|
66 | @user.last_ip = nil |
|
66 | @user.last_ip = nil |
|
67 | @user.save |
|
67 | @user.save |
|
68 |
- redirect_to action: ' |
|
68 | + redirect_to action: 'index', page: params[:page] |
|
69 | end |
|
69 | end |
|
70 |
|
70 | ||
|
71 | def create_from_list |
|
71 | def create_from_list |
@@ -113,7 +113,7 | |||||
|
113 | flash[:notice] = 'User(s) ' + note.join(', ') + |
|
113 | flash[:notice] = 'User(s) ' + note.join(', ') + |
|
114 | ' were successfully created. ' + |
|
114 | ' were successfully created. ' + |
|
115 | '( (+) - created with random passwords.)' |
|
115 | '( (+) - created with random passwords.)' |
|
116 |
- redirect_to :action => ' |
|
116 | + redirect_to :action => 'index' |
|
117 | end |
|
117 | end |
|
118 |
|
118 | ||
|
119 | def edit |
|
119 | def edit |
@@ -132,7 +132,7 | |||||
|
132 |
|
132 | ||
|
133 | def destroy |
|
133 | def destroy |
|
134 | User.find(params[:id]).destroy |
|
134 | User.find(params[:id]).destroy |
|
135 |
- redirect_to :action => ' |
|
135 | + redirect_to :action => 'index' |
|
136 | end |
|
136 | end |
|
137 |
|
137 | ||
|
138 | def user_stat |
|
138 | def user_stat |
@@ -199,7 +199,7 | |||||
|
199 | def import |
|
199 | def import |
|
200 | if params[:file]=='' |
|
200 | if params[:file]=='' |
|
201 | flash[:notice] = 'Error importing no file' |
|
201 | flash[:notice] = 'Error importing no file' |
|
202 |
- redirect_to :action => ' |
|
202 | + redirect_to :action => 'index' and return |
|
203 | end |
|
203 | end |
|
204 | import_from_file(params[:file]) |
|
204 | import_from_file(params[:file]) |
|
205 | end |
|
205 | end |
@@ -252,7 +252,7 | |||||
|
252 | if user and contest |
|
252 | if user and contest |
|
253 | user.contests << contest |
|
253 | user.contests << contest |
|
254 | end |
|
254 | end |
|
255 |
- redirect_to :action => ' |
|
255 | + redirect_to :action => 'index' |
|
256 | end |
|
256 | end |
|
257 |
|
257 | ||
|
258 | def remove_from_contest |
|
258 | def remove_from_contest |
@@ -261,7 +261,7 | |||||
|
261 | if user and contest |
|
261 | if user and contest |
|
262 | user.contests.delete(contest) |
|
262 | user.contests.delete(contest) |
|
263 | end |
|
263 | end |
|
264 |
- redirect_to :action => ' |
|
264 | + redirect_to :action => 'index' |
|
265 | end |
|
265 | end |
|
266 |
|
266 | ||
|
267 | def contest_management |
|
267 | def contest_management |
@@ -1,27 +1,28 | |||||
|
1 | %h1 Listing users |
|
1 | %h1 Listing users |
|
|
2 | + | ||
|
|
3 | + .panel.panel-primary | ||
|
|
4 | + .panel-title.panel-heading | ||
|
|
5 | + Quick Add | ||
|
|
6 | + .panel-body | ||
|
|
7 | + = form_tag( {method: 'post'}, {class: 'form-inline'}) do | ||
|
|
8 | + .form-group | ||
|
|
9 | + = label_tag 'user_login', 'Login' | ||
|
|
10 | + = text_field 'user', 'login', :size => 10,class: 'form-control' | ||
|
|
11 | + .form-group | ||
|
|
12 | + = label_tag 'user_full_name', 'Full Name' | ||
|
|
13 | + = text_field 'user', 'full_name', :size => 10,class: 'form-control' | ||
|
|
14 | + .form-group | ||
|
|
15 | + = label_tag 'user_password', 'Password' | ||
|
|
16 | + = text_field 'user', 'password', :size => 10,class: 'form-control' | ||
|
|
17 | + .form-group | ||
|
|
18 | + = label_tag 'user_password_confirmation', 'Confirm' | ||
|
|
19 | + = text_field 'user', 'password_confirmation', :size => 10,class: 'form-control' | ||
|
|
20 | + .form-group | ||
|
|
21 | + = label_tag 'user_email', 'email' | ||
|
|
22 | + = text_field 'user', 'email', :size => 10,class: 'form-control' | ||
|
|
23 | + =submit_tag "Create", class: 'btn btn-primary' | ||
|
|
24 | + | ||
|
2 | .submitbox |
|
25 | .submitbox |
|
3 | - %b Quick add |
|
||
|
4 | - = form_tag :action => 'create' do |
|
||
|
5 | - %table{:border => "0"} |
|
||
|
6 | - %tr |
|
||
|
7 | - %td |
|
||
|
8 | - %label{:for => "user_login"} Login |
|
||
|
9 | - %td |
|
||
|
10 | - %label{:for => "user_full_name"} Full name |
|
||
|
11 | - %td |
|
||
|
12 | - %label{:for => "user_password"} Password |
|
||
|
13 | - %td |
|
||
|
14 | - %label{:for => "user_password_confirmation"} Confirm |
|
||
|
15 | - %td |
|
||
|
16 | - %label{:for => "user_email"} Email |
|
||
|
17 | - %tr |
|
||
|
18 | - %td= text_field 'user', 'login', :size => 10 |
|
||
|
19 | - %td= text_field 'user', 'full_name', :size => 30 |
|
||
|
20 | - %td= password_field 'user', 'password', :size => 10 |
|
||
|
21 | - %td= password_field 'user', 'password_confirmation', :size => 10 |
|
||
|
22 | - %td= email_field 'user', 'email', :size => 15 |
|
||
|
23 | - %td= submit_tag "Create" |
|
||
|
24 | - %br/ |
|
||
|
25 | %b Import from site management |
|
26 | %b Import from site management |
|
26 | = form_tag({:action => 'import'}, :multipart => true) do |
|
27 | = form_tag({:action => 'import'}, :multipart => true) do |
|
27 | File: #{file_field_tag 'file'} #{submit_tag 'Import'} |
|
28 | File: #{file_field_tag 'file'} #{submit_tag 'Import'} |
You need to be logged in to leave comments.
Login now