diff --git a/app/views/users/profile.html.haml b/app/views/users/profile.html.haml --- a/app/views/users/profile.html.haml +++ b/app/views/users/profile.html.haml @@ -1,9 +1,9 @@ - content_for :header do = javascript_include_tag 'local_jquery' -%script{:type=>"text/javascript"} +:javascript $(function () { - $('#submission_table').tablesorter({widgets: ['zebra']}); + $('#submission_table').tablesorter({widgets: ['zebra']}); }); :css @@ -11,16 +11,30 @@ font-family: Droid Sans Mono,Consolas, monospace, mono, Courier New, Courier; } -%h1= @user.full_name + ' Profile' +%h1= @user.full_name -%h2 Basic info Login: #{@user.login}
Full name: #{@user.full_name}
%h2 Problem Stat +%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)}%) -%h2 Submissions +%h2 Submission History + +=render partial: 'application/bar_graph', locals: {histogram: @histogram, param: {bar_width: 7}} + %table.tablesorter-cafe#submission_table %thead @@ -39,7 +53,7 @@ - next unless s.problem %tr %td= link_to "#{s.id}", controller: "graders", action: "submission", id: s.id - %td= s.problem.name + %td= link_to s.problem.name, controller: "problems", action: "stat", id: s.problem %td= s.problem.full_name %td= s.language.pretty_name %td #{s.submitted_at.strftime('%Y-%m-%d %H:%M')} (#{time_ago_in_words(s.submitted_at)} ago)