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: 70 inserted, 11 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 |
@@ -1,50 +1,56 | |||
|
1 | 1 | source 'https://rubygems.org' |
|
2 | 2 | |
|
3 | 3 | gem 'rails', '3.2.19' |
|
4 | 4 | |
|
5 | 5 | # Bundle edge Rails instead: |
|
6 | 6 | # gem 'rails', :git => 'git://github.com/rails/rails.git' |
|
7 | 7 | |
|
8 | 8 | gem 'mysql2' |
|
9 | 9 | |
|
10 | 10 | # Gems used only for assets and not required |
|
11 | 11 | # in production environments by default. |
|
12 | 12 | group :assets do |
|
13 | 13 | gem 'sass-rails', '~> 3.2.3' |
|
14 | 14 | gem 'coffee-rails', '~> 3.2.1' |
|
15 | 15 | |
|
16 | 16 | # See https://github.com/sstephenson/execjs#readme for more supported runtimes |
|
17 | 17 | # gem 'therubyracer', :platforms => :ruby |
|
18 | 18 | |
|
19 | 19 | gem 'uglifier', '>= 1.0.3' |
|
20 | 20 | end |
|
21 | 21 | |
|
22 | 22 | gem 'prototype-rails' |
|
23 | 23 | |
|
24 | 24 | # To use ActiveModel has_secure_password |
|
25 | 25 | # gem 'bcrypt-ruby', '~> 3.0.0' |
|
26 | 26 | |
|
27 | 27 | # To use Jbuilder templates for JSON |
|
28 | 28 | # gem 'jbuilder' |
|
29 | 29 | |
|
30 | 30 | # Use unicorn as the app server |
|
31 | 31 | # gem 'unicorn' |
|
32 | 32 | |
|
33 | 33 | # Deploy with Capistrano |
|
34 | 34 | # gem 'capistrano' |
|
35 | 35 | |
|
36 | 36 | # To use debugger |
|
37 | 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 | 45 | gem "haml" |
|
40 | 46 | gem "mail" |
|
41 | 47 | gem "rdiscount" |
|
42 | 48 | gem "test-unit" |
|
43 | 49 | gem 'will_paginate', '~> 3.0.0' |
|
44 | 50 | gem 'dynamic_form' |
|
45 | 51 | gem 'in_place_editing' |
|
46 | 52 | gem 'verification', :git => 'git://github.com/sikachu/verification.git' |
|
47 | 53 | |
|
48 | 54 | group :test, :development do |
|
49 | 55 | gem "rspec-rails", "~> 2.0" |
|
50 | 56 | end |
@@ -10,142 +10,157 | |||
|
10 | 10 | remote: https://rubygems.org/ |
|
11 | 11 | specs: |
|
12 | 12 | actionmailer (3.2.19) |
|
13 | 13 | actionpack (= 3.2.19) |
|
14 | 14 | mail (~> 2.5.4) |
|
15 | 15 | actionpack (3.2.19) |
|
16 | 16 | activemodel (= 3.2.19) |
|
17 | 17 | activesupport (= 3.2.19) |
|
18 | 18 | builder (~> 3.0.0) |
|
19 | 19 | erubis (~> 2.7.0) |
|
20 | 20 | journey (~> 1.0.4) |
|
21 | 21 | rack (~> 1.4.5) |
|
22 | 22 | rack-cache (~> 1.2) |
|
23 | 23 | rack-test (~> 0.6.1) |
|
24 | 24 | sprockets (~> 2.2.1) |
|
25 | 25 | activemodel (3.2.19) |
|
26 | 26 | activesupport (= 3.2.19) |
|
27 | 27 | builder (~> 3.0.0) |
|
28 | 28 | activerecord (3.2.19) |
|
29 | 29 | activemodel (= 3.2.19) |
|
30 | 30 | activesupport (= 3.2.19) |
|
31 | 31 | arel (~> 3.0.2) |
|
32 | 32 | tzinfo (~> 0.3.29) |
|
33 | 33 | activeresource (3.2.19) |
|
34 | 34 | activemodel (= 3.2.19) |
|
35 | 35 | activesupport (= 3.2.19) |
|
36 | 36 | activesupport (3.2.19) |
|
37 | 37 | i18n (~> 0.6, >= 0.6.4) |
|
38 | 38 | multi_json (~> 1.0) |
|
39 | 39 | arel (3.0.3) |
|
40 | 40 | builder (3.0.4) |
|
41 | 41 | coffee-rails (3.2.2) |
|
42 | 42 | coffee-script (>= 2.2.0) |
|
43 | 43 | railties (~> 3.2.0) |
|
44 | 44 | coffee-script (2.3.0) |
|
45 | 45 | coffee-script-source |
|
46 | 46 | execjs |
|
47 | 47 | coffee-script-source (1.7.1) |
|
48 | 48 | diff-lcs (1.2.5) |
|
49 | 49 | dynamic_form (1.1.4) |
|
50 | 50 | erubis (2.7.0) |
|
51 | 51 | execjs (2.2.1) |
|
52 | 52 | haml (4.0.5) |
|
53 | 53 | tilt |
|
54 | 54 | hike (1.2.3) |
|
55 | 55 | i18n (0.6.11) |
|
56 | 56 | in_place_editing (1.2.0) |
|
57 | 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 | 70 | json (1.8.1) |
|
59 | 71 | mail (2.5.4) |
|
60 | 72 | mime-types (~> 1.16) |
|
61 | 73 | treetop (~> 1.4.8) |
|
62 | 74 | mime-types (1.25.1) |
|
63 | 75 | multi_json (1.10.1) |
|
64 | 76 | mysql2 (0.3.16) |
|
65 | 77 | polyglot (0.3.5) |
|
66 | 78 | power_assert (0.1.3) |
|
67 | 79 | prototype-rails (3.2.1) |
|
68 | 80 | rails (~> 3.2) |
|
69 | 81 | rack (1.4.5) |
|
70 | 82 | rack-cache (1.2) |
|
71 | 83 | rack (>= 0.4) |
|
72 | 84 | rack-ssl (1.3.4) |
|
73 | 85 | rack |
|
74 | 86 | rack-test (0.6.2) |
|
75 | 87 | rack (>= 1.0) |
|
76 | 88 | rails (3.2.19) |
|
77 | 89 | actionmailer (= 3.2.19) |
|
78 | 90 | actionpack (= 3.2.19) |
|
79 | 91 | activerecord (= 3.2.19) |
|
80 | 92 | activeresource (= 3.2.19) |
|
81 | 93 | activesupport (= 3.2.19) |
|
82 | 94 | bundler (~> 1.0) |
|
83 | 95 | railties (= 3.2.19) |
|
84 | 96 | railties (3.2.19) |
|
85 | 97 | actionpack (= 3.2.19) |
|
86 | 98 | activesupport (= 3.2.19) |
|
87 | 99 | rack-ssl (~> 1.3.2) |
|
88 | 100 | rake (>= 0.8.7) |
|
89 | 101 | rdoc (~> 3.4) |
|
90 | 102 | thor (>= 0.14.6, < 2.0) |
|
91 | 103 | rake (10.3.2) |
|
92 | 104 | rdiscount (2.1.7.1) |
|
93 | 105 | rdoc (3.12.2) |
|
94 | 106 | json (~> 1.4) |
|
95 | 107 | rspec-collection_matchers (1.0.0) |
|
96 | 108 | rspec-expectations (>= 2.99.0.beta1) |
|
97 | 109 | rspec-core (2.99.2) |
|
98 | 110 | rspec-expectations (2.99.2) |
|
99 | 111 | diff-lcs (>= 1.1.3, < 2.0) |
|
100 | 112 | rspec-mocks (2.99.2) |
|
101 | 113 | rspec-rails (2.99.0) |
|
102 | 114 | actionpack (>= 3.0) |
|
103 | 115 | activemodel (>= 3.0) |
|
104 | 116 | activesupport (>= 3.0) |
|
105 | 117 | railties (>= 3.0) |
|
106 | 118 | rspec-collection_matchers |
|
107 | 119 | rspec-core (~> 2.99.0) |
|
108 | 120 | rspec-expectations (~> 2.99.0) |
|
109 | 121 | rspec-mocks (~> 2.99.0) |
|
110 | 122 | sass (3.4.1) |
|
111 | 123 | sass-rails (3.2.6) |
|
112 | 124 | railties (~> 3.2.0) |
|
113 | 125 | sass (>= 3.1.10) |
|
114 | 126 | tilt (~> 1.3) |
|
115 | 127 | sprockets (2.2.2) |
|
116 | 128 | hike (~> 1.2) |
|
117 | 129 | multi_json (~> 1.0) |
|
118 | 130 | rack (~> 1.0) |
|
119 | 131 | tilt (~> 1.1, != 1.3.0) |
|
120 | 132 | test-unit (3.0.1) |
|
121 | 133 | power_assert |
|
122 | 134 | thor (0.19.1) |
|
123 | 135 | tilt (1.4.1) |
|
124 | 136 | treetop (1.4.15) |
|
125 | 137 | polyglot |
|
126 | 138 | polyglot (>= 0.3.1) |
|
127 | 139 | tzinfo (0.3.41) |
|
128 | 140 | uglifier (2.5.3) |
|
129 | 141 | execjs (>= 0.3.0) |
|
130 | 142 | json (>= 1.8.0) |
|
131 | 143 | will_paginate (3.0.7) |
|
132 | 144 | |
|
133 | 145 | PLATFORMS |
|
134 | 146 | ruby |
|
135 | 147 | |
|
136 | 148 | DEPENDENCIES |
|
137 | 149 | coffee-rails (~> 3.2.1) |
|
138 | 150 | dynamic_form |
|
139 | 151 | haml |
|
140 | 152 | in_place_editing |
|
153 | + jquery-rails | |
|
154 | + jquery-timepicker-addon-rails | |
|
155 | + jquery-ui-sass-rails | |
|
141 | 156 | |
|
142 | 157 | mysql2 |
|
143 | 158 | prototype-rails |
|
144 | 159 | rails (= 3.2.19) |
|
145 | 160 | rdiscount |
|
146 | 161 | rspec-rails (~> 2.0) |
|
147 | 162 | sass-rails (~> 3.2.3) |
|
148 | 163 | test-unit |
|
149 | 164 | uglifier (>= 1.0.3) |
|
150 | 165 | verification! |
|
151 | 166 | will_paginate (~> 3.0.0) |
@@ -1,48 +1,56 | |||
|
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 | 9 | body |
|
2 | 10 | background: white image-url("topbg.jpg") repeat-x top center |
|
3 | 11 | font-size: 13px |
|
4 | 12 | font-family: Tahoma, "sans-serif" |
|
5 | 13 | margin: 10px |
|
6 | 14 | padding: 10px |
|
7 | 15 | |
|
8 | 16 | |
|
9 | 17 | input |
|
10 | 18 | font-family: Tahoma, "sans-serif" |
|
11 | 19 | |
|
12 | 20 | |
|
13 | 21 | h1 |
|
14 | 22 | font-size: 24px |
|
15 | 23 | color: #334488 |
|
16 | 24 | line-height: 2em |
|
17 | 25 | |
|
18 | 26 | |
|
19 | 27 | h2 |
|
20 | 28 | font-size: 18px |
|
21 | 29 | color: #5566bb |
|
22 | 30 | line-height: 1.5em |
|
23 | 31 | |
|
24 | 32 | |
|
25 | 33 | hr |
|
26 | 34 | border-top: 1px solid #dddddd |
|
27 | 35 | border-bottom: 1px solid #eeeeee |
|
28 | 36 | |
|
29 | 37 | |
|
30 | 38 | a |
|
31 | 39 | color: #6666cc |
|
32 | 40 | text-decoration: none |
|
33 | 41 | |
|
34 | 42 | &:link, &:visited |
|
35 | 43 | color: #6666cc |
|
36 | 44 | text-decoration: none |
|
37 | 45 | |
|
38 | 46 | &:hover, &:focus |
|
39 | 47 | color: #111166 |
|
40 | 48 | text-decoration: none |
|
41 | 49 | |
|
42 | 50 | |
|
43 | 51 | div |
|
44 | 52 | &.userbar |
|
45 | 53 | line-height: 1.5em |
|
46 | 54 | text-align: right |
|
47 | 55 | font-size: 12px |
|
48 | 56 | |
@@ -245,49 +253,49 | |||
|
245 | 253 | &.message |
|
246 | 254 | margin: 10px 0 0 |
|
247 | 255 | |
|
248 | 256 | div |
|
249 | 257 | &.message |
|
250 | 258 | margin: 0 0 0 30px |
|
251 | 259 | |
|
252 | 260 | &.body |
|
253 | 261 | border: 2px solid #dddddd |
|
254 | 262 | background: #fff8f8 |
|
255 | 263 | padding-left: 5px |
|
256 | 264 | |
|
257 | 265 | &.reply-body |
|
258 | 266 | border: 2px solid #bbbbbb |
|
259 | 267 | background: #fffff8 |
|
260 | 268 | padding-left: 5px |
|
261 | 269 | |
|
262 | 270 | &.stat |
|
263 | 271 | font-size: 10px |
|
264 | 272 | line-height: 1.75em |
|
265 | 273 | padding: 0 5px |
|
266 | 274 | color: #333333 |
|
267 | 275 | background: #dddddd |
|
268 | 276 | font-weight: bold |
|
269 | 277 | |
|
270 | 278 | &.message div.stat |
|
271 | 279 | font-size: 10px |
|
272 | 280 | line-height: 1.75em |
|
273 | 281 | padding: 0 5px |
|
274 | 282 | color: #444444 |
|
275 | 283 | background: #bbbbbb |
|
276 | 284 | font-weight: bold |
|
277 | 285 | |
|
278 | 286 | &.contest-title |
|
279 | 287 | color: white |
|
280 | 288 | text-align: center |
|
281 | 289 | line-height: 2em |
|
282 | 290 | |
|
283 | 291 | &.registration-desc, &.test-desc |
|
284 | 292 | border: 1px dotted gray |
|
285 | 293 | background: #f5f5f5 |
|
286 | 294 | padding: 5px |
|
287 | 295 | margin: 10px 0 |
|
288 | 296 | font-size: 12px |
|
289 | 297 | line-height: 1.5em |
|
290 | 298 | |
|
291 | 299 | h2.contest-title |
|
292 | 300 | margin-top: 5px |
|
293 | - margin-bottom: 5px No newline at end of file | |
|
301 | + margin-bottom: 5px |
@@ -1,13 +1,18 | |||
|
1 | 1 | class ReportController < ApplicationController |
|
2 | 2 | def login_stat |
|
3 | 3 | @logins = Array.new |
|
4 | 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 | 10 | User.all.each do |user| |
|
6 | 11 | @logins << { login: user.login, |
|
7 | 12 | full_name: user.full_name, |
|
8 | 13 | count: Login.where(user_id: user.id).count(:id), |
|
9 | 14 | min: Login.where(user_id: user.id).maximum(:created_at), |
|
10 | 15 | max: Login.where(user_id: user.id).minimum(:created_at) } |
|
11 | 16 | end |
|
12 | 17 | end |
|
13 | 18 | end |
@@ -1,21 +1,23 | |||
|
1 | 1 | <!DOCTYPE html> |
|
2 | 2 | <html> |
|
3 | 3 | <head> |
|
4 | 4 | <title><%= GraderConfiguration['contest.name'] %></title> |
|
5 | 5 | <%= stylesheet_link_tag "application", :media => "all" %> |
|
6 | 6 | <%= javascript_include_tag "application" %> |
|
7 | 7 | <%= csrf_meta_tags %> |
|
8 | + <%= content_for :header %> | |
|
8 | 9 | <%= yield :head %> |
|
10 | + | |
|
9 | 11 | </head> |
|
10 | 12 | <body> |
|
11 | 13 | |
|
12 | 14 | <div class="userbar"> |
|
13 | 15 | <%= user_header %> |
|
14 | 16 | </div> |
|
15 | 17 | |
|
16 | 18 | <%= content_tag(:p,flash[:notice],:style => "color:green") if flash[:notice]!=nil %> |
|
17 | 19 | |
|
18 | 20 | <%= yield %> |
|
19 | 21 | |
|
20 | 22 | </body> |
|
21 | 23 | </html> |
@@ -1,18 +1,19 | |||
|
1 | 1 | |
|
2 |
- = form_tag({ |
|
|
2 | + = form_tag({session: :url }) do | |
|
3 | 3 | .submitbox |
|
4 | 4 | %table |
|
5 | 5 | %tr |
|
6 | 6 | %td{colspan: 6, style: 'font-weight: bold'} Query maximum score in submission range |
|
7 | 7 | %tr |
|
8 |
- %td{style: 'width: 120px; font-weight: bold'} |
|
|
9 |
- %td{align: 'right'} |
|
|
10 |
- %td= text_field_tag 's |
|
|
11 | - %td Time: | |
|
12 | - %td= text_field_tag 'start_time', params[:start_time], style: 'width:40px' | |
|
13 | - %td= submit_tag 'query' | |
|
8 | + %td{style: 'width: 120px; font-weight: bold'}= param_text | |
|
9 | + %td{align: 'right'} since: | |
|
10 | + %td= text_field_tag 'since_datetime' | |
|
14 | 11 | %tr |
|
15 | 12 |
%td |
|
16 | - %td{colspan: 5} Leave blank date and/or time for no condition | |
|
17 | - %br/ | |
|
13 | + %td{align: 'right'} until: | |
|
14 | + %td= text_field_tag 'until_datetime' | |
|
15 | + %tr | |
|
16 | + %td | |
|
17 | + %td | |
|
18 | + %td= submit_tag 'query' | |
|
18 | 19 |
@@ -1,28 +1,44 | |||
|
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 | 11 | %h1 Login status |
|
2 | 12 | |
|
3 | 13 | |
|
14 | + | |
|
4 | 15 | .task-menu |
|
5 | 16 | Reports |
|
6 | 17 | %br/ |
|
7 | 18 | = link_to '[Submission]', :action => 'submit_stat' |
|
8 | 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 | 28 | %table.info |
|
13 | 29 | %thead |
|
14 | 30 | %tr.info-head |
|
15 | 31 | %th login |
|
16 | 32 | %th full name |
|
17 | 33 | %th login count |
|
18 | 34 | %th earliest |
|
19 | 35 | %th latest |
|
20 | 36 | %tbody |
|
21 | 37 | - @logins.each do |l| |
|
22 | 38 | %tr{class: cycle('info-even','info-odd')} |
|
23 | 39 | %td= l[:login] |
|
24 | 40 | %td= l[:full_name] |
|
25 | 41 | %td= l[:count] |
|
26 | 42 | %td= l[:min] |
|
27 | 43 | %td= l[:max] |
|
28 | 44 |
You need to be logged in to leave comments.
Login now