Description:
(in progress) add date range
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r412:cee35860e689 - - 8 files changed: 71 inserted, 12 deleted
@@ -0,0 +1,6 | |||||
|
|
1 | + //= require jquery | ||
|
|
2 | + //= require jquery_ujs | ||
|
|
3 | + //= require jquery.ui.all | ||
|
|
4 | + //= require jquery.ui.datepicker | ||
|
|
5 | + //= require jquery.ui.slider | ||
|
|
6 | + //= require jquery-ui-timepicker-addon |
@@ -32,12 +32,18 | |||||
|
32 |
|
32 | ||
|
33 | # Deploy with Capistrano |
|
33 | # Deploy with Capistrano |
|
34 | # gem 'capistrano' |
|
34 | # gem 'capistrano' |
|
35 |
|
35 | ||
|
36 | # To use debugger |
|
36 | # To use debugger |
|
37 | # gem 'debugger' |
|
37 | # gem 'debugger' |
|
|
38 | + # | ||
|
|
39 | + | ||
|
|
40 | + gem 'jquery-rails' | ||
|
|
41 | + gem 'jquery-ui-sass-rails' | ||
|
|
42 | + gem 'jquery-timepicker-addon-rails' | ||
|
|
43 | + | ||
|
38 |
|
44 | ||
|
39 | gem "haml" |
|
45 | gem "haml" |
|
40 | gem "mail" |
|
46 | gem "mail" |
|
41 | gem "rdiscount" |
|
47 | gem "rdiscount" |
|
42 | gem "test-unit" |
|
48 | gem "test-unit" |
|
43 | gem 'will_paginate', '~> 3.0.0' |
|
49 | gem 'will_paginate', '~> 3.0.0' |
@@ -52,12 +52,24 | |||||
|
52 | haml (4.0.5) |
|
52 | haml (4.0.5) |
|
53 | tilt |
|
53 | tilt |
|
54 | hike (1.2.3) |
|
54 | hike (1.2.3) |
|
55 | i18n (0.6.11) |
|
55 | i18n (0.6.11) |
|
56 | in_place_editing (1.2.0) |
|
56 | in_place_editing (1.2.0) |
|
57 | journey (1.0.4) |
|
57 | journey (1.0.4) |
|
|
58 | + jquery-rails (3.1.1) | ||
|
|
59 | + railties (>= 3.0, < 5.0) | ||
|
|
60 | + thor (>= 0.14, < 2.0) | ||
|
|
61 | + jquery-timepicker-addon-rails (1.4.1) | ||
|
|
62 | + railties (>= 3.1) | ||
|
|
63 | + jquery-ui-rails (4.0.3) | ||
|
|
64 | + jquery-rails | ||
|
|
65 | + railties (>= 3.1.0) | ||
|
|
66 | + jquery-ui-sass-rails (4.0.3.0) | ||
|
|
67 | + jquery-rails | ||
|
|
68 | + jquery-ui-rails (= 4.0.3) | ||
|
|
69 | + railties (>= 3.1.0) | ||
|
58 | json (1.8.1) |
|
70 | json (1.8.1) |
|
59 | mail (2.5.4) |
|
71 | mail (2.5.4) |
|
60 | mime-types (~> 1.16) |
|
72 | mime-types (~> 1.16) |
|
61 | treetop (~> 1.4.8) |
|
73 | treetop (~> 1.4.8) |
|
62 | mime-types (1.25.1) |
|
74 | mime-types (1.25.1) |
|
63 | multi_json (1.10.1) |
|
75 | multi_json (1.10.1) |
@@ -135,12 +147,15 | |||||
|
135 |
|
147 | ||
|
136 | DEPENDENCIES |
|
148 | DEPENDENCIES |
|
137 | coffee-rails (~> 3.2.1) |
|
149 | coffee-rails (~> 3.2.1) |
|
138 | dynamic_form |
|
150 | dynamic_form |
|
139 | haml |
|
151 | haml |
|
140 | in_place_editing |
|
152 | in_place_editing |
|
|
153 | + jquery-rails | ||
|
|
154 | + jquery-timepicker-addon-rails | ||
|
|
155 | + jquery-ui-sass-rails | ||
|
141 |
|
156 | ||
|
142 | mysql2 |
|
157 | mysql2 |
|
143 | prototype-rails |
|
158 | prototype-rails |
|
144 | rails (= 3.2.19) |
|
159 | rails (= 3.2.19) |
|
145 | rdiscount |
|
160 | rdiscount |
|
146 | rspec-rails (~> 2.0) |
|
161 | rspec-rails (~> 2.0) |
@@ -1,6 +1,14 | |||||
|
|
1 | + | ||
|
|
2 | + @import jquery.ui.core | ||
|
|
3 | + @import jquery.ui.theme | ||
|
|
4 | + @import jquery.ui.datepicker | ||
|
|
5 | + @import jquery.ui.slider | ||
|
|
6 | + @import jquery-ui-timepicker-addon | ||
|
|
7 | + | ||
|
|
8 | + | ||
|
1 | body |
|
9 | body |
|
2 | background: white image-url("topbg.jpg") repeat-x top center |
|
10 | background: white image-url("topbg.jpg") repeat-x top center |
|
3 | font-size: 13px |
|
11 | font-size: 13px |
|
4 | font-family: Tahoma, "sans-serif" |
|
12 | font-family: Tahoma, "sans-serif" |
|
5 | margin: 10px |
|
13 | margin: 10px |
|
6 | padding: 10px |
|
14 | padding: 10px |
@@ -287,7 +295,7 | |||||
|
287 | margin: 10px 0 |
|
295 | margin: 10px 0 |
|
288 | font-size: 12px |
|
296 | font-size: 12px |
|
289 | line-height: 1.5em |
|
297 | line-height: 1.5em |
|
290 |
|
298 | ||
|
291 | h2.contest-title |
|
299 | h2.contest-title |
|
292 | margin-top: 5px |
|
300 | margin-top: 5px |
|
293 | - margin-bottom: 5px No newline at end of file |
|
301 | + margin-bottom: 5px |
@@ -1,10 +1,15 | |||||
|
1 | class ReportController < ApplicationController |
|
1 | class ReportController < ApplicationController |
|
2 | def login_stat |
|
2 | def login_stat |
|
3 | @logins = Array.new |
|
3 | @logins = Array.new |
|
4 | login = Login.all |
|
4 | login = Login.all |
|
|
5 | + | ||
|
|
6 | + date_and_time = '%y-%m-%d %H:%M' | ||
|
|
7 | + since_time = strptime(params[:since_datetime],date_and_time) | ||
|
|
8 | + until_time = strptime(params[:until_datetime],date_and_time) | ||
|
|
9 | + | ||
|
5 | User.all.each do |user| |
|
10 | User.all.each do |user| |
|
6 | @logins << { login: user.login, |
|
11 | @logins << { login: user.login, |
|
7 | full_name: user.full_name, |
|
12 | full_name: user.full_name, |
|
8 | count: Login.where(user_id: user.id).count(:id), |
|
13 | count: Login.where(user_id: user.id).count(:id), |
|
9 | min: Login.where(user_id: user.id).maximum(:created_at), |
|
14 | min: Login.where(user_id: user.id).maximum(:created_at), |
|
10 | max: Login.where(user_id: user.id).minimum(:created_at) } |
|
15 | max: Login.where(user_id: user.id).minimum(:created_at) } |
@@ -2,13 +2,15 | |||||
|
2 | <html> |
|
2 | <html> |
|
3 | <head> |
|
3 | <head> |
|
4 | <title><%= GraderConfiguration['contest.name'] %></title> |
|
4 | <title><%= GraderConfiguration['contest.name'] %></title> |
|
5 | <%= stylesheet_link_tag "application", :media => "all" %> |
|
5 | <%= stylesheet_link_tag "application", :media => "all" %> |
|
6 | <%= javascript_include_tag "application" %> |
|
6 | <%= javascript_include_tag "application" %> |
|
7 | <%= csrf_meta_tags %> |
|
7 | <%= csrf_meta_tags %> |
|
|
8 | + <%= content_for :header %> | ||
|
8 | <%= yield :head %> |
|
9 | <%= yield :head %> |
|
|
10 | + | ||
|
9 | </head> |
|
11 | </head> |
|
10 | <body> |
|
12 | <body> |
|
11 |
|
13 | ||
|
12 | <div class="userbar"> |
|
14 | <div class="userbar"> |
|
13 | <%= user_header %> |
|
15 | <%= user_header %> |
|
14 | </div> |
|
16 | </div> |
@@ -1,18 +1,19 | |||||
|
1 |
|
1 | ||
|
2 |
- = form_tag({ |
|
2 | + = form_tag({session: :url }) do |
|
3 | .submitbox |
|
3 | .submitbox |
|
4 | %table |
|
4 | %table |
|
5 | %tr |
|
5 | %tr |
|
6 | %td{colspan: 6, style: 'font-weight: bold'} Query maximum score in submission range |
|
6 | %td{colspan: 6, style: 'font-weight: bold'} Query maximum score in submission range |
|
7 | %tr |
|
7 | %tr |
|
8 |
- %td{style: 'width: 120px; font-weight: bold'} |
|
8 | + %td{style: 'width: 120px; font-weight: bold'}= param_text |
|
9 |
- %td{align: 'right'} |
|
9 | + %td{align: 'right'} since: |
|
10 |
- %td= text_field_tag 's |
|
10 | + %td= text_field_tag 'since_datetime' |
|
11 |
- |
|
11 | + %tr |
|
12 | - %td= text_field_tag 'start_time', params[:start_time], style: 'width:40px' |
|
12 | + %td |
|
|
13 | + %td{align: 'right'} until: | ||
|
|
14 | + %td= text_field_tag 'until_datetime' | ||
|
|
15 | + %tr | ||
|
|
16 | + %td | ||
|
|
17 | + %td | ||
|
13 | %td= submit_tag 'query' |
|
18 | %td= submit_tag 'query' |
|
14 | - %tr |
|
||
|
15 | - %td |
|
||
|
16 | - %td{colspan: 5} Leave blank date and/or time for no condition |
|
||
|
17 | - %br/ |
|
||
|
18 |
|
19 |
@@ -1,16 +1,32 | |||||
|
|
1 | + - content_for :header do | ||
|
|
2 | + = javascript_include_tag 'new' | ||
|
|
3 | + | ||
|
|
4 | + %script{:type=>"text/javascript"} | ||
|
|
5 | + $(function () { | ||
|
|
6 | + $('#since_datetime').datetimepicker({ showButtonPanel: true, dateFormat: "yy-mm-dd", controlType: "slider"} ); | ||
|
|
7 | + $('#until_datetime').datetimepicker({ showButtonPanel: true, dateFormat: "yy-mm-dd", controlType: "slider"} ); | ||
|
|
8 | + }); | ||
|
|
9 | + | ||
|
|
10 | + | ||
|
1 | %h1 Login status |
|
11 | %h1 Login status |
|
2 |
|
12 | ||
|
3 |
|
13 | ||
|
|
14 | + | ||
|
4 | .task-menu |
|
15 | .task-menu |
|
5 | Reports |
|
16 | Reports |
|
6 | %br/ |
|
17 | %br/ |
|
7 | = link_to '[Submission]', :action => 'submit_stat' |
|
18 | = link_to '[Submission]', :action => 'submit_stat' |
|
8 | = link_to '[Login]', :action => 'login_stat' |
|
19 | = link_to '[Login]', :action => 'login_stat' |
|
9 |
|
20 | ||
|
10 | - =render partial: 'date_range' |
|
21 | + |
|
|
22 | + =render partial: 'date_range', locals: {param_text: 'Submission range:' } | ||
|
|
23 | + | ||
|
|
24 | + hahaha | ||
|
|
25 | + | ||
|
|
26 | + =params[:since_datetime] | ||
|
11 |
|
27 | ||
|
12 | %table.info |
|
28 | %table.info |
|
13 | %thead |
|
29 | %thead |
|
14 | %tr.info-head |
|
30 | %tr.info-head |
|
15 | %th login |
|
31 | %th login |
|
16 | %th full name |
|
32 | %th full name |
You need to be logged in to leave comments.
Login now