Show More
Commit Description:
add more stat
Commit Description:
add more stat
References:
File last commit:
Show/Diff file:
Action:
app/views/users/profile.html.haml
| 66 lines
| 1.6 KiB
| text/x-haml
| HamlLexer
|
r431 | - content_for :header do | |||
r456 | = javascript_include_tag 'local_jquery' | |||
r431 | ||||
r458 | :javascript | |||
r431 | $(function () { | |||
r458 | $('#submission_table').tablesorter({widgets: ['zebra']}); | |||
r431 | }); | |||
r434 | :css | |||
.fix-width { | ||||
font-family: Droid Sans Mono,Consolas, monospace, mono, Courier New, Courier; | ||||
} | ||||
r458 | %h1= @user.full_name | |||
r431 | ||||
<b>Login:</b> #{@user.login} <br/> | ||||
<b>Full name:</b> #{@user.full_name} <br /> | ||||
%h2 Problem Stat | ||||
r458 | %table.info | |||
%thead | ||||
%tr.info-head | ||||
%th Stat | ||||
%th Value | ||||
%tbody | ||||
%tr{class: cycle('info-even','info-odd')} | ||||
%td.info_param Submissions | ||||
%td= @summary[:count] | ||||
%tr{class: cycle('info-even','info-odd')} | ||||
%td.info_param Solved/Attempted Problem | ||||
%td #{@summary[:solve]}/#{@summary[:attempt]} (#{(@summary[:solve]*100.0/@summary[:attempt]).round(1)}%) | ||||
r431 | ||||
r458 | %h2 Submission History | |||
=render partial: 'application/bar_graph', locals: {histogram: @histogram, param: {bar_width: 7}} | ||||
r431 | ||||
%table.tablesorter-cafe#submission_table | ||||
%thead | ||||
%tr | ||||
%th ID | ||||
%th Problem code | ||||
r450 | %th Problem full name | |||
r431 | %th Language | |||
r450 | %th Submitted at | |||
r431 | %th Result | |||
%th Score | ||||
r446 | - if session[:admin] | |||
%th IP | ||||
r431 | %tbody | |||
- @submission.each do |s| | ||||
r434 | - next unless s.problem | |||
r431 | %tr | |||
%td= link_to "#{s.id}", controller: "graders", action: "submission", id: s.id | ||||
%td= s.problem.name | ||||
%td= s.problem.full_name | ||||
%td= s.language.pretty_name | ||||
r450 | %td #{s.submitted_at.strftime('%Y-%m-%d %H:%M')} (#{time_ago_in_words(s.submitted_at)} ago) | |||
r434 | %td.fix-width= s.grader_comment | |||
r444 | %td= (s.points*100)/s.problem.full_score | |||
r446 | - if session[:admin] | |||
%td= s.ip_address | ||||
r431 | ||||