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: 46 inserted, 36 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 -
17 + .panel.panel-default
18 + .panel-heading
19 + .panel-title Users in this group
20 + .panel-body
19 21 =form_tag add_user_group_path(@group), class: 'form-inline' do
20 22 .form-group
21 23 =label_tag :user_id, "User"
22 24 =select_tag :user_id, options_from_collection_for_select(User.all,'id','full_name'), class: 'select2'
23 25 =submit_tag "Add",class: 'btn btn-primary'
24 26
25 27
26 28 %table.table.table-hover
27 29 %thead
28 30 %tr
29 31 %th Login
30 32 %th Full name
31 33 %th Remark
32 34 %th
33 35
34 36 %tbody
35 37 - @group.users.each do |user|
36 38 %tr
37 39 %td= user.login
38 40 %td= user.full_name
39 41 %td= user.remark
40 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 49 =form_tag add_problem_group_path(@group), class: 'form-inline' do
45 50 .form-group
46 51 =label_tag :problem_id, "Problem"
47 52 =select_tag :problem_id, options_from_collection_for_select(Problem.all,'id','full_name'), class: 'select2'
48 53 =submit_tag "Add",class: 'btn btn-primary'
49 54
50 55
51 56 %table.table.table-hover
52 57 %thead
53 58 %tr
54 59 %th name
55 60 %th Full name
56 61 %th Full score
57 62 %th
58 63
59 64 %tbody
60 65 - @group.problems.each do |problem|
61 66 %tr
62 67 %td= problem.name
63 68 %td= problem.full_name
64 69 %td= problem.full_score
65 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
@@ -2,92 +2,93
2 2 %nav
3 3 .container-fluid
4 4 .navbar-header
5 5 %button.navbar-toggle.collapsed{ data: {toggle: 'collapse', target: '#navbar-collapse'} }
6 6 %span.sr-only Togggle Navigation
7 7 %span.icon-bar
8 8 %span.icon-bar
9 9 %span.icon-bar
10 10 %a.navbar-brand{href: main_list_path}
11 11 %span.glyphicon.glyphicon-home
12 12 MAIN
13 13 .collapse.navbar-collapse#navbar-collapse
14 14 %ul.nav.navbar-nav
15 15 / submission
16 16 - if (@current_user!=nil) and (GraderConfiguration.show_tasks_to?(@current_user))
17 17 %li.dropdown
18 18 %a.dropdown-toggle{href: '#', data: {toggle:'dropdown'}, aria: {haspopup:"true", expanded:"false"}, role: "button"}
19 19 = "#{I18n.t 'menu.submissions'}"
20 20 %span.caret
21 21 %ul.dropdown-menu
22 22 = add_menu("View", 'submissions', 'index')
23 23 = add_menu("Self Test", 'test', 'index')
24 24 / hall of fame
25 25 - if GraderConfiguration['right.user_hall_of_fame']
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'}})
74 75 - if GraderConfiguration['system.user_setting_enabled']
75 76 = add_menu("#{content_tag(:span,'',class: 'glyphicon glyphicon-cog')}".html_safe, 'users', 'index', {title: I18n.t('menu.settings'), data: {toggle: 'tooltip'}})
76 77 = add_menu("#{content_tag(:span,'',class: 'glyphicon glyphicon-log-out')} #{@current_user.full_name}".html_safe, 'main', 'login', {title: I18n.t('menu.log_out'), data: {toggle: 'tooltip'}})
77 78
78 79 /
79 80 - if (@current_user!=nil) and (session[:admin])
80 81 %nav.navbar.navbar-fixed-top.navbar-inverse.secondnavbar
81 82 .container-fluid
82 83 .collapse.navbar-collapse
83 84 %ul.nav.navbar-nav
84 85 = add_menu( '[Announcements]', 'announcements', 'index')
85 86 = add_menu( '[Msg console]', 'messages', 'console')
86 87 = add_menu( '[Problems]', 'problems', 'index')
87 88 = add_menu( '[Users]', 'user_admin', 'index')
88 89 = add_menu( '[Results]', 'user_admin', 'user_stat')
89 90 = add_menu( '[Report]', 'report', 'multiple_login')
90 91 = add_menu( '[Graders]', 'graders', 'list')
91 92 = add_menu( '[Contests]', 'contest_management', 'index')
92 93 = add_menu( '[Sites]', 'sites', 'index')
93 94 = add_menu( '[System config]', 'configurations', 'index')
@@ -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