Show More
Commit Description:
- refactor direct_edit into submissions/edit...
Commit Description:
- refactor direct_edit into submissions/edit
- also refactor short
References:
File last commit:
Show/Diff file:
Action:
app/views/report/max_score.html.haml
| 85 lines
| 2.7 KiB
| text/x-haml
| HamlLexer
|
r593 | %h1 Maximum score | |||
r594 | = form_tag report_show_max_score_path | |||
r593 | .row | |||
.col-md-4 | ||||
.panel.panel-primary | ||||
.panel-heading | ||||
Problems | ||||
.panel-body | ||||
r594 | %p | |||
Select problem(s) that we wish to know the score. | ||||
= label_tag :problem_id, "Problems" | ||||
= select_tag 'problem_id[]', | ||||
options_for_select(Problem.all.collect {|p| ["[#{p.name}] #{p.full_name}", p.id]}), | ||||
{ class: 'select2 form-control', multiple: "true" } | ||||
r593 | .col-md-4 | |||
.panel.panel-primary | ||||
.panel-heading | ||||
Submission range | ||||
.panel-body | ||||
r594 | %p | |||
Input minimum and maximum range of submission ID that should be included. A blank value for min and max means -1 and infinity, respectively. | ||||
r593 | .form-group | |||
r594 | = label_tag :from, "Min" | |||
r593 | = text_field_tag 'from_id', nil, class: "form-control" | |||
.form-group | ||||
r594 | = label_tag :from, "Max" | |||
r593 | = text_field_tag 'to_id', nil, class: "form-control" | |||
.col-md-4 | ||||
.panel.panel-primary | ||||
.panel-heading | ||||
Users | ||||
.panel-body | ||||
.radio | ||||
%label | ||||
= radio_button_tag 'users', 'all', true | ||||
All users | ||||
.radio | ||||
%label | ||||
= radio_button_tag 'users', 'enabled' | ||||
Only enabled users | ||||
.row | ||||
.col-md-12 | ||||
= button_tag 'Show', class: "btn btn-primary btn-large" | ||||
= button_tag 'Download CSV', class: "btn btn-primary btn-large" | ||||
r594 | ||||
- if @scorearray | ||||
%h2 Result | ||||
%table.table.sortable.table-striped.table-bordered.table-condensed | ||||
%thead | ||||
%tr | ||||
%th Login | ||||
%th Name | ||||
%th Activated? | ||||
%th Logged_in | ||||
%th Contest(s) | ||||
%th Remark | ||||
- @problems.each do |p| | ||||
%th.text-right= p.name | ||||
%th.text-right Total | ||||
%th.text-right Passed | ||||
%tbody | ||||
- @scorearray.each do |sc| | ||||
%tr | ||||
- total,num_passed = 0,0 | ||||
- sc.each_index do |i| | ||||
- if i == 0 | ||||
%td= link_to sc[i].login, controller: 'users', action: 'profile', id: sc[i] | ||||
%td= sc[i].full_name | ||||
%td= sc[i].activated | ||||
%td= sc[i].try(:contest_stat).try(:started_at) ? 'yes' : 'no' | ||||
%td= sc[i].contests.collect {|c| c.name}.join(', ') | ||||
%td= sc[i].remark | ||||
- else | ||||
%td.text-right= sc[i][0] | ||||
- total += sc[i][0] | ||||
- num_passed += 1 if sc[i][1] | ||||
%td.text-right= total | ||||
%td.text-right= num_passed | ||||
:javascript | ||||
$.bootstrapSortable(true,'reversed') | ||||
r593 | /.col-md-4.col-md-offset-1 | |||
/ = button_tag 'Show', class: "btn btn-primary btn-block" | ||||
/.col-md-4.col-md-offset-2 | ||||
/ = button_tag 'Download CSV', class: "btn btn-primary btn-block" | ||||