Show More
Commit Description:
user_admin
Commit Description:
user_admin
References:
File last commit:
Show/Diff file:
Action:
app/views/groups/show.html.haml
| 72 lines
| 2.0 KiB
| text/x-haml
| HamlLexer
|
r672 | %p | |||
%b Name: | ||||
= @group.name | ||||
%p | ||||
%b Description: | ||||
= @group.description | ||||
%br | ||||
= link_to 'Edit', edit_group_path(@group) | ||||
\| | ||||
= link_to 'Back', groups_path | ||||
.row | ||||
r673 | %h1 Group details | |||
.row | ||||
r672 | .col-md-6 | |||
r673 | .panel.panel-default | |||
.panel-heading | ||||
.panel-title Users in this group | ||||
.panel-body | ||||
=form_tag add_user_group_path(@group), class: 'form-inline' do | ||||
.form-group | ||||
=label_tag :user_id, "User" | ||||
=select_tag :user_id, options_from_collection_for_select(User.all,'id','full_name'), class: 'select2' | ||||
=submit_tag "Add",class: 'btn btn-primary' | ||||
r672 | ||||
r673 | %table.table.table-hover | |||
%thead | ||||
%tr | ||||
%th Login | ||||
%th Full name | ||||
%th Remark | ||||
%th | ||||
r672 | ||||
r673 | %tbody | |||
- @group.users.each do |user| | ||||
%tr | ||||
%td= user.login | ||||
%td= user.full_name | ||||
%td= user.remark | ||||
%td= link_to 'Remove', remove_user_group_path(@group,user), :method => :delete, :data => { :confirm => "Remove #{user.full_name}?" }, class: 'btn btn-danger' | ||||
r672 | .col-md-6 | |||
r673 | .panel.panel-default | |||
.panel-heading | ||||
.panel-title Problems | ||||
.panel-body | ||||
r672 | ||||
r673 | =form_tag add_problem_group_path(@group), class: 'form-inline' do | |||
.form-group | ||||
=label_tag :problem_id, "Problem" | ||||
=select_tag :problem_id, options_from_collection_for_select(Problem.all,'id','full_name'), class: 'select2' | ||||
=submit_tag "Add",class: 'btn btn-primary' | ||||
r672 | ||||
r673 | %table.table.table-hover | |||
%thead | ||||
%tr | ||||
%th name | ||||
%th Full name | ||||
%th Full score | ||||
%th | ||||
r672 | ||||
r673 | %tbody | |||
- @group.problems.each do |problem| | ||||
%tr | ||||
%td= problem.name | ||||
%td= problem.full_name | ||||
%td= problem.full_score | ||||
%td= link_to 'Remove', remove_problem_group_path(@group,problem), :method => :delete, :data => { :confirm => "Remove #{problem.full_name}?" }, class: 'btn btn-danger' | ||||
r672 | ||||