diff --git a/app/controllers/user_admin_controller.rb b/app/controllers/user_admin_controller.rb --- a/app/controllers/user_admin_controller.rb +++ b/app/controllers/user_admin_controller.rb @@ -55,7 +55,7 @@ @user.activated = true if @user.save flash[:notice] = 'User was successfully created.' - redirect_to :action => 'list' + redirect_to :action => 'index' else render :action => 'new' end @@ -65,7 +65,7 @@ @user = User.find(params[:id]) @user.last_ip = nil @user.save - redirect_to action: 'list', page: params[:page] + redirect_to action: 'index', page: params[:page] end def create_from_list @@ -113,7 +113,7 @@ flash[:notice] = 'User(s) ' + note.join(', ') + ' were successfully created. ' + '( (+) - created with random passwords.)' - redirect_to :action => 'list' + redirect_to :action => 'index' end def edit @@ -132,7 +132,7 @@ def destroy User.find(params[:id]).destroy - redirect_to :action => 'list' + redirect_to :action => 'index' end def user_stat @@ -199,7 +199,7 @@ def import if params[:file]=='' flash[:notice] = 'Error importing no file' - redirect_to :action => 'list' and return + redirect_to :action => 'index' and return end import_from_file(params[:file]) end @@ -252,7 +252,7 @@ if user and contest user.contests << contest end - redirect_to :action => 'list' + redirect_to :action => 'index' end def remove_from_contest @@ -261,7 +261,7 @@ if user and contest user.contests.delete(contest) end - redirect_to :action => 'list' + redirect_to :action => 'index' end def contest_management diff --git a/app/views/user_admin/index.html.haml b/app/views/user_admin/index.html.haml --- a/app/views/user_admin/index.html.haml +++ b/app/views/user_admin/index.html.haml @@ -1,27 +1,28 @@ %h1 Listing users + +.panel.panel-primary + .panel-title.panel-heading + Quick Add + .panel-body + = form_tag( {method: 'post'}, {class: 'form-inline'}) do + .form-group + = label_tag 'user_login', 'Login' + = text_field 'user', 'login', :size => 10,class: 'form-control' + .form-group + = label_tag 'user_full_name', 'Full Name' + = text_field 'user', 'full_name', :size => 10,class: 'form-control' + .form-group + = label_tag 'user_password', 'Password' + = text_field 'user', 'password', :size => 10,class: 'form-control' + .form-group + = label_tag 'user_password_confirmation', 'Confirm' + = text_field 'user', 'password_confirmation', :size => 10,class: 'form-control' + .form-group + = label_tag 'user_email', 'email' + = text_field 'user', 'email', :size => 10,class: 'form-control' + =submit_tag "Create", class: 'btn btn-primary' + .submitbox - %b Quick add - = form_tag :action => 'create' do - %table{:border => "0"} - %tr - %td - %label{:for => "user_login"} Login - %td - %label{:for => "user_full_name"} Full name - %td - %label{:for => "user_password"} Password - %td - %label{:for => "user_password_confirmation"} Confirm - %td - %label{:for => "user_email"} Email - %tr - %td= text_field 'user', 'login', :size => 10 - %td= text_field 'user', 'full_name', :size => 30 - %td= password_field 'user', 'password', :size => 10 - %td= password_field 'user', 'password_confirmation', :size => 10 - %td= email_field 'user', 'email', :size => 15 - %td= submit_tag "Create" - %br/ %b Import from site management = form_tag({:action => 'import'}, :multipart => true) do File: #{file_field_tag 'file'} #{submit_tag 'Import'}