- content_for :header do = stylesheet_link_tag 'tablesorter-theme.cafe' = javascript_include_tag 'local_jquery' %script{:type=>"text/javascript"} $(function () { $('#since_datetime').datetimepicker({ showButtonPanel: true, dateFormat: "yy-mm-dd", controlType: "slider"} ); $('#until_datetime').datetimepicker({ showButtonPanel: true, dateFormat: "yy-mm-dd", controlType: "slider"} ); $('#my_table').tablesorter({widthFixed: true, widgets: ['zebra']}); $('#my_table2').tablesorter({widthFixed: true, widgets: ['zebra']}); $('#sub_table').tablesorter({widthFixed: true, widgets: ['zebra']}); }); %h1 Login status =render partial: 'report_menu' = form_tag({session: :url }) do .submitbox %table %tr %td{colspan: 6, style: 'font-weight: bold'}= 'Query login & submit in the range' %tr %td{style: 'width: 120px; font-weight: bold'}= 'Login date range' %td{align: 'right'} since: %td= text_field_tag 'since_datetime', @since_time %tr %td %td{align: 'right'} until: %td= text_field_tag 'until_datetime', @until_time %tr %td %td %td Blank mean no condition %tr %td{style: 'width: 120px; font-weight: bold'}= "ID" %td{colspan: 2}= text_field_tag 'SID', @sid, size: 40 %tr %td %td %td= submit_tag 'query' %h2 Logs - if @sid %table %tbody - @sid.each do |id| - user = User.where("login = ?",id).first %tr //%td= link_to id, controller: :user, action: :profile, id: id %td= link_to id, "https://www.nattee.net/java/users/profile/#{user.id}" %td= user.full_name //%table.tablesorter-cafe#my_table %table.info %thead %tr.info-head %th Time %th Action %th IP %th login %th name %th problem %th score %tbody - if @logs - @logs.each do |l| %tr{class: cycle('info-even','info-odd')} %td= l[:submitted_at].strftime "%Y.%b.%d %H:%M:%S" //%td= l[:id] == -1 ? "LOGIN" : link_to("submit #{l[:id]}", controller: 'graders' , action: 'submission', id: l[:id]) %td= l[:id] == -1 ? "LOGIN" : link_to( "submit #{l[:id]}", "https://www.nattee.net/java/graders/submission/#{l[:id]}") %td= l[:ip_address] //%td= link_to l[:login], controller: 'users', action: 'profile', id: l[:id] %td= link_to( l[:login], "https://www.nattee.net/java/users/profile/#{l.user_id}") %td= l[:full_name] %td= l[:id] == -1 ? "" : l.problem.name %td= l[:id] == -1 ? "" : l.points * 100/ l.problem.full_score