Description:
user_admin
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r673:99c14e332823 - - 7 files changed: 84 inserted, 74 deleted

@@ -0,0 +1,31
1 + = error_messages_for 'user'
2 + / [form:user]
3 + .form-group
4 + %label.col-md-2.control-label{for: :login} Login
5 + .col-md-4
6 + = text_field 'user', 'login', class: 'form-control'
7 + .form-group
8 + %label.col-md-2.control-label{for: :full_name} Login
9 + .col-md-4
10 + = text_field 'user', 'full_name', class: 'form-control'
11 + .form-group
12 + %label.col-md-2.control-label{for: :password} Password
13 + .col-md-4
14 + = password_field 'user', 'password', class: 'form-control'
15 + .form-group
16 + %label.col-md-2.control-label{for: :password_confirmation} Password (confirm)
17 + .col-md-4
18 + = password_field 'user', 'password_confirmation', class: 'form-control'
19 + .form-group
20 + %label.col-md-2.control-label{for: :email} E-mail
21 + .col-md-4
22 + = email_field 'user', 'email', class: 'form-control'
23 + .form-group
24 + %label.col-md-2.control-label{for: :alias} Alias
25 + .col-md-4
26 + = text_field 'user', 'alias', class: 'form-control'
27 + .form-group
28 + %label.col-md-2.control-label{for: :remark} Remark
29 + .col-md-4
30 + = text_field 'user', 'remark', class: 'form-control'
31 + / [eoform:user]
@@ -1,24 +1,22
1 1 %h1 Groups
2 2
3 3 %p
4 4 = link_to 'New Group', new_group_path, class: 'btn btn-primary'
5 5 %table.table.table-hover
6 6 %thead
7 7 %tr
8 8 %th Name
9 9 %th Description
10 10 %th
11 11 %th
12 - %th
13 12
14 13 %tbody
15 14 - @groups.each do |group|
16 15 %tr
17 16 %td= group.name
18 17 %td= group.description
19 - %td= link_to 'Show', group, class: 'btn btn-default'
20 - %td= link_to 'Edit', edit_group_path(group), class: 'btn btn-default'
18 + %td= link_to 'View', group, class: 'btn btn-default'
21 19 %td= link_to 'Destroy', group, :method => :delete, :data => { :confirm => 'Are you sure?' }, class: 'btn btn-danger'
22 20
23 21 %br
24 22
@@ -1,67 +1,72
1 - %p#notice= notice
2 -
3 1 %p
4 2 %b Name:
5 3 = @group.name
6 4 %p
7 5 %b Description:
8 6 = @group.description
9 7
10 8 %br
11 9 = link_to 'Edit', edit_group_path(@group)
12 10 \|
13 11 = link_to 'Back', groups_path
14 12
15 13 .row
14 + %h1 Group details
15 + .row
16 16 .col-md-6
17 - %h1 Users in this group
18 -
19 - =form_tag add_user_group_path(@group), class: 'form-inline' do
20 - .form-group
21 - =label_tag :user_id, "User"
22 - =select_tag :user_id, options_from_collection_for_select(User.all,'id','full_name'), class: 'select2'
23 - =submit_tag "Add",class: 'btn btn-primary'
17 + .panel.panel-default
18 + .panel-heading
19 + .panel-title Users in this group
20 + .panel-body
21 + =form_tag add_user_group_path(@group), class: 'form-inline' do
22 + .form-group
23 + =label_tag :user_id, "User"
24 + =select_tag :user_id, options_from_collection_for_select(User.all,'id','full_name'), class: 'select2'
25 + =submit_tag "Add",class: 'btn btn-primary'
24 26
25 27
26 - %table.table.table-hover
27 - %thead
28 - %tr
29 - %th Login
30 - %th Full name
31 - %th Remark
32 - %th
28 + %table.table.table-hover
29 + %thead
30 + %tr
31 + %th Login
32 + %th Full name
33 + %th Remark
34 + %th
33 35
34 - %tbody
35 - - @group.users.each do |user|
36 - %tr
37 - %td= user.login
38 - %td= user.full_name
39 - %td= user.remark
40 - %td= link_to 'Remove', remove_user_group_path(@group,user), :method => :delete, :data => { :confirm => "Remove #{user.full_name}?" }, class: 'btn btn-danger'
36 + %tbody
37 + - @group.users.each do |user|
38 + %tr
39 + %td= user.login
40 + %td= user.full_name
41 + %td= user.remark
42 + %td= link_to 'Remove', remove_user_group_path(@group,user), :method => :delete, :data => { :confirm => "Remove #{user.full_name}?" }, class: 'btn btn-danger'
41 43 .col-md-6
42 - %h1 Problems in this group
44 + .panel.panel-default
45 + .panel-heading
46 + .panel-title Problems
47 + .panel-body
43 48
44 - =form_tag add_problem_group_path(@group), class: 'form-inline' do
45 - .form-group
46 - =label_tag :problem_id, "Problem"
47 - =select_tag :problem_id, options_from_collection_for_select(Problem.all,'id','full_name'), class: 'select2'
48 - =submit_tag "Add",class: 'btn btn-primary'
49 + =form_tag add_problem_group_path(@group), class: 'form-inline' do
50 + .form-group
51 + =label_tag :problem_id, "Problem"
52 + =select_tag :problem_id, options_from_collection_for_select(Problem.all,'id','full_name'), class: 'select2'
53 + =submit_tag "Add",class: 'btn btn-primary'
49 54
50 55
51 - %table.table.table-hover
52 - %thead
53 - %tr
54 - %th name
55 - %th Full name
56 - %th Full score
57 - %th
56 + %table.table.table-hover
57 + %thead
58 + %tr
59 + %th name
60 + %th Full name
61 + %th Full score
62 + %th
58 63
59 - %tbody
60 - - @group.problems.each do |problem|
61 - %tr
62 - %td= problem.name
63 - %td= problem.full_name
64 - %td= problem.full_score
65 - %td= link_to 'Remove', remove_problem_group_path(@group,problem), :method => :delete, :data => { :confirm => "Remove #{problem.full_name}?" }, class: 'btn btn-danger'
64 + %tbody
65 + - @group.problems.each do |problem|
66 + %tr
67 + %td= problem.name
68 + %td= problem.full_name
69 + %td= problem.full_score
70 + %td= link_to 'Remove', remove_problem_group_path(@group,problem), :method => :delete, :data => { :confirm => "Remove #{problem.full_name}?" }, class: 'btn btn-danger'
66 71
67 72
@@ -26,48 +26,49
26 26 = add_menu("#{I18n.t 'menu.hall_of_fame'}", 'report', 'problem_hof')
27 27 / display MODE button (with countdown in contest mode)
28 28 - if GraderConfiguration.analysis_mode?
29 29 %div.navbar-btn.btn.btn-success#countdown= "ANALYSIS MODE"
30 30 - elsif GraderConfiguration.time_limit_mode?
31 31 - if @current_user.contest_finished?
32 32 %div.navbar-btn.btn.btn-danger#countdown= "Contest is over"
33 33 - elsif !@current_user.contest_started?
34 34 %div.navbar-btn.btn.btn-primary#countdown= (t 'title_bar.contest_not_started')
35 35 - else
36 36 %div.navbar-btn.btn.btn-primary#countdown asdf
37 37 :javascript
38 38 $("#countdown").countdown({until: "+#{@current_user.contest_time_left.to_i}s", layout: 'Time left: {hnn}:{mnn}:{snn}'});
39 39 / admin section
40 40 - if (@current_user!=nil) and (session[:admin])
41 41 / management
42 42 %li.dropdown
43 43 %a.dropdown-toggle{href: '#', data: {toggle:'dropdown'}, aria: {haspopup:"true", expanded:"false"}, role: "button"}
44 44 Manage
45 45 %span.caret
46 46 %ul.dropdown-menu
47 47 = add_menu( 'Announcements', 'announcements', 'index')
48 48 = add_menu( 'Problems', 'problems', 'index')
49 49 = add_menu( 'Users', 'user_admin', 'index')
50 + = add_menu( 'User Groups', 'groups', 'index')
50 51 = add_menu( 'Graders', 'graders', 'list')
51 52 = add_menu( 'Message ', 'messages', 'console')
52 53 %li.divider{role: 'separator'}
53 54 = add_menu( 'System config', 'configurations', 'index')
54 55 %li.divider{role: 'separator'}
55 56 = add_menu( 'Sites', 'sites', 'index')
56 57 = add_menu( 'Contests', 'contest_management', 'index')
57 58 / report
58 59 %li.dropdown
59 60 %a.dropdown-toggle{href: '#', data: {toggle:'dropdown'}, aria: {haspopup:"true", expanded:"false"}, role: "button"}
60 61 Report
61 62 %span.caret
62 63 %ul.dropdown-menu
63 64 = add_menu( 'Current Score', 'report', 'current_score')
64 65 = add_menu( 'Score Report', 'report', 'max_score')
65 66 = add_menu( 'Report', 'report', 'multiple_login')
66 67 - if (ungraded = Submission.where('graded_at is null').where('submitted_at < ?', 1.minutes.ago).count) > 0
67 68 =link_to "#{ungraded} backlogs!",
68 69 grader_list_path,
69 70 class: 'navbar-btn btn btn-default btn-warning', data: {toggle: 'tooltip'},title: 'Number of ungraded submission'
70 71
71 72 %ul.nav.navbar-nav.navbar-right
72 73 = add_menu("#{content_tag(:span,'',class: 'glyphicon glyphicon-question-sign')}".html_safe, 'main', 'help')
73 74 = add_menu("#{content_tag(:span,'',class: 'glyphicon glyphicon-comment')}".html_safe, 'messages', 'list', {title: I18n.t('menu.messages'), data: {toggle: 'tooltip'}})
@@ -1,11 +1,11
1 1 %h1 Editing user
2 2
3 - = form_tag :action => 'update', :id => @user do
3 + = form_tag( {:action => 'update', :id => @user}, {class: 'form-horizontal'}) do
4 4 = error_messages_for 'user'
5 5 = render partial: "form"
6 - = submit_tag "Edit"
6 + = submit_tag "Edit", class: 'btn btn-primary'
7 7
8 8
9 9 = link_to 'Show', :action => 'show', :id => @user
10 10 |
11 11 = link_to 'Back', :action => 'list'
@@ -1,10 +1,10
1 1 <h1>User information</h1>
2 2
3 3 <% for column in User.content_columns %>
4 4 <p>
5 5 <b><%= column.human_name %>:</b> <%=h @user.send(column.name) %>
6 6 </p>
7 7 <% end %>
8 8
9 9 <%= link_to 'Edit', :action => 'edit', :id => @user %> |
10 - <%= link_to 'Back', :action => 'list' %>
10 + <%= link_to 'Back', :action => 'index' %>
deleted file
You need to be logged in to leave comments. Login now