Description:
user_admin
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
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] |
@@ -9,15 +9,13 | |||||
|
9 | %th Description |
|
9 | %th Description |
|
10 | %th |
|
10 | %th |
|
11 | %th |
|
11 | %th |
|
12 | - %th |
|
||
|
13 |
|
12 | ||
|
14 | %tbody |
|
13 | %tbody |
|
15 | - @groups.each do |group| |
|
14 | - @groups.each do |group| |
|
16 | %tr |
|
15 | %tr |
|
17 | %td= group.name |
|
16 | %td= group.name |
|
18 | %td= group.description |
|
17 | %td= group.description |
|
19 |
- %td= link_to ' |
|
18 | + %td= link_to 'View', group, class: 'btn btn-default' |
|
20 | - %td= link_to 'Edit', edit_group_path(group), class: 'btn btn-default' |
|
||
|
21 | %td= link_to 'Destroy', group, :method => :delete, :data => { :confirm => 'Are you sure?' }, class: 'btn btn-danger' |
|
19 | %td= link_to 'Destroy', group, :method => :delete, :data => { :confirm => 'Are you sure?' }, class: 'btn btn-danger' |
|
22 |
|
20 | ||
|
23 | %br |
|
21 | %br |
@@ -1,5 +1,3 | |||||
|
1 | - %p#notice= notice |
|
||
|
2 | - |
|
||
|
3 |
|
|
1 | %p |
|
4 | %b Name: |
|
2 | %b Name: |
|
5 | = @group.name |
|
3 | = @group.name |
@@ -13,55 +11,62 | |||||
|
13 | = link_to 'Back', groups_path |
|
11 | = link_to 'Back', groups_path |
|
14 |
|
12 | ||
|
15 | .row |
|
13 | .row |
|
|
14 | + %h1 Group details | ||
|
|
15 | + .row | ||
|
16 | .col-md-6 |
|
16 | .col-md-6 |
|
17 | - %h1 Users in this group |
|
17 | + .panel.panel-default |
|
18 | - |
|
18 | + .panel-heading |
|
19 | - =form_tag add_user_group_path(@group), class: 'form-inline' do |
|
19 | + .panel-title Users in this group |
|
20 | - .form-group |
|
20 | + .panel-body |
|
21 | - =label_tag :user_id, "User" |
|
21 | + =form_tag add_user_group_path(@group), class: 'form-inline' do |
|
22 | - =select_tag :user_id, options_from_collection_for_select(User.all,'id','full_name'), class: 'select2' |
|
22 | + .form-group |
|
23 | - =submit_tag "Add",class: 'btn btn-primary' |
|
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 |
|
28 | + %table.table.table-hover |
|
27 | - %thead |
|
29 | + %thead |
|
28 | - %tr |
|
30 | + %tr |
|
29 | - %th Login |
|
31 | + %th Login |
|
30 | - %th Full name |
|
32 | + %th Full name |
|
31 | - %th Remark |
|
33 | + %th Remark |
|
32 | - %th |
|
34 | + %th |
|
33 |
|
35 | ||
|
34 | - %tbody |
|
36 | + %tbody |
|
35 | - - @group.users.each do |user| |
|
37 | + - @group.users.each do |user| |
|
36 | - %tr |
|
38 | + %tr |
|
37 | - %td= user.login |
|
39 | + %td= user.login |
|
38 | - %td= user.full_name |
|
40 | + %td= user.full_name |
|
39 | - %td= user.remark |
|
41 | + %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' |
|
42 | + %td= link_to 'Remove', remove_user_group_path(@group,user), :method => :delete, :data => { :confirm => "Remove #{user.full_name}?" }, class: 'btn btn-danger' |
|
41 | .col-md-6 |
|
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 |
|
49 | + =form_tag add_problem_group_path(@group), class: 'form-inline' do |
|
45 | - .form-group |
|
50 | + .form-group |
|
46 | - =label_tag :problem_id, "Problem" |
|
51 | + =label_tag :problem_id, "Problem" |
|
47 | - =select_tag :problem_id, options_from_collection_for_select(Problem.all,'id','full_name'), class: 'select2' |
|
52 | + =select_tag :problem_id, options_from_collection_for_select(Problem.all,'id','full_name'), class: 'select2' |
|
48 | - =submit_tag "Add",class: 'btn btn-primary' |
|
53 | + =submit_tag "Add",class: 'btn btn-primary' |
|
49 |
|
54 | ||
|
50 |
|
55 | ||
|
51 | - %table.table.table-hover |
|
56 | + %table.table.table-hover |
|
52 | - %thead |
|
57 | + %thead |
|
53 | - %tr |
|
58 | + %tr |
|
54 | - %th name |
|
59 | + %th name |
|
55 | - %th Full name |
|
60 | + %th Full name |
|
56 | - %th Full score |
|
61 | + %th Full score |
|
57 | - %th |
|
62 | + %th |
|
58 |
|
63 | ||
|
59 | - %tbody |
|
64 | + %tbody |
|
60 | - - @group.problems.each do |problem| |
|
65 | + - @group.problems.each do |problem| |
|
61 | - %tr |
|
66 | + %tr |
|
62 | - %td= problem.name |
|
67 | + %td= problem.name |
|
63 | - %td= problem.full_name |
|
68 | + %td= problem.full_name |
|
64 | - %td= problem.full_score |
|
69 | + %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' |
|
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 |
@@ -47,6 +47,7 | |||||
|
47 | = add_menu( 'Announcements', 'announcements', 'index') |
|
47 | = add_menu( 'Announcements', 'announcements', 'index') |
|
48 | = add_menu( 'Problems', 'problems', 'index') |
|
48 | = add_menu( 'Problems', 'problems', 'index') |
|
49 | = add_menu( 'Users', 'user_admin', 'index') |
|
49 | = add_menu( 'Users', 'user_admin', 'index') |
|
|
50 | + = add_menu( 'User Groups', 'groups', 'index') | ||
|
50 | = add_menu( 'Graders', 'graders', 'list') |
|
51 | = add_menu( 'Graders', 'graders', 'list') |
|
51 | = add_menu( 'Message ', 'messages', 'console') |
|
52 | = add_menu( 'Message ', 'messages', 'console') |
|
52 | %li.divider{role: 'separator'} |
|
53 | %li.divider{role: 'separator'} |
@@ -1,9 +1,9 | |||||
|
1 | %h1 Editing user |
|
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 | = error_messages_for 'user' |
|
4 | = error_messages_for 'user' |
|
5 | = render partial: "form" |
|
5 | = render partial: "form" |
|
6 | - = submit_tag "Edit" |
|
6 | + = submit_tag "Edit", class: 'btn btn-primary' |
|
7 |
|
7 | ||
|
8 |
|
8 | ||
|
9 | = link_to 'Show', :action => 'show', :id => @user |
|
9 | = link_to 'Show', :action => 'show', :id => @user |
@@ -7,4 +7,4 | |||||
|
7 | <% end %> |
|
7 | <% end %> |
|
8 |
|
8 | ||
|
9 | <%= link_to 'Edit', :action => 'edit', :id => @user %> | |
|
9 | <%= link_to 'Edit', :action => 'edit', :id => @user %> | |
|
10 |
- <%= link_to 'Back', :action => ' |
|
10 | + <%= link_to 'Back', :action => 'index' %> |
deleted file |
You need to be logged in to leave comments.
Login now