Description:
MERGED change set 372:399 from ytopc08-2 branch
git-svn-id: http://theory.cpe.ku.ac.th/grader/web/trunk@401 6386c4cd-e34a-4fa8-8920-d93eb39b512e
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r190:27e07d862fff - - 9 files changed: 180 inserted, 56 deleted
@@ -0,0 +1,19 | |||||
|
|
1 | + %h1 Active users | ||
|
|
2 | + | ||
|
|
3 | + %i | ||
|
|
4 | + I.e., those users that interacts with the system with in the last 60 minutes. | ||
|
|
5 | + %br/ | ||
|
|
6 | + | ||
|
|
7 | + = link_to '[go back to index]', :action => 'index' | ||
|
|
8 | + | ||
|
|
9 | + %table | ||
|
|
10 | + %tr | ||
|
|
11 | + %th # | ||
|
|
12 | + %th login | ||
|
|
13 | + %th full name | ||
|
|
14 | + - counter = 0 | ||
|
|
15 | + - for user in @users | ||
|
|
16 | + %tr | ||
|
|
17 | + %td= counter += 1 | ||
|
|
18 | + %td= user.login | ||
|
|
19 | + %td= user.full_name |
@@ -16,6 +16,16 | |||||
|
16 | @hidden_columns = ['hashed_password', 'salt', 'created_at', 'updated_at'] |
|
16 | @hidden_columns = ['hashed_password', 'salt', 'created_at', 'updated_at'] |
|
17 | end |
|
17 | end |
|
18 |
|
18 | ||
|
|
19 | + def active | ||
|
|
20 | + sessions = ActiveRecord::SessionStore::Session.find(:all, :conditions => ["updated_at >= ?", 60.minutes.ago]) | ||
|
|
21 | + @users = [] | ||
|
|
22 | + sessions.each do |session| | ||
|
|
23 | + if session.data[:user_id] | ||
|
|
24 | + @users << User.find(session.data[:user_id]) | ||
|
|
25 | + end | ||
|
|
26 | + end | ||
|
|
27 | + end | ||
|
|
28 | + | ||
|
19 | def show |
|
29 | def show |
|
20 | @user = User.find(params[:id]) |
|
30 | @user = User.find(params[:id]) |
|
21 | end |
|
31 | end |
@@ -125,6 +125,9 | |||||
|
125 | begin |
|
125 | begin |
|
126 | if self.site==nil |
|
126 | if self.site==nil |
|
127 | self.site = Site.find_by_name('default') |
|
127 | self.site = Site.find_by_name('default') |
|
|
128 | + if self.site==nil | ||
|
|
129 | + self.site = Site.find(1) # when 'default has be renamed' | ||
|
|
130 | + end | ||
|
128 | end |
|
131 | end |
|
129 | rescue |
|
132 | rescue |
|
130 | end |
|
133 | end |
@@ -19,7 +19,7 | |||||
|
19 | %b= flash[:notice] |
|
19 | %b= flash[:notice] |
|
20 | %hr/ |
|
20 | %hr/ |
|
21 |
|
21 | ||
|
22 |
- %div{ :style => "border: solid 1px gray; padding: |
|
22 | + %div{ :style => "border: solid 1px gray; padding: 4px; background: #eeeeff;"} |
|
23 | - form_tag :controller => 'login', :action => 'login' do |
|
23 | - form_tag :controller => 'login', :action => 'login' do |
|
24 | %table |
|
24 | %table |
|
25 | %tr |
|
25 | %tr |
@@ -7,7 +7,10 | |||||
|
7 | - else |
|
7 | - else |
|
8 | (n/a) |
|
8 | (n/a) |
|
9 | %td{:align => "center"} |
|
9 | %td{:align => "center"} |
|
|
10 | + - if test_request.submission | ||
|
10 | = test_request.submission.number |
|
11 | = test_request.submission.number |
|
|
12 | + - else | ||
|
|
13 | + n/a | ||
|
11 | %td{:align => "center"} |
|
14 | %td{:align => "center"} |
|
12 | = test_request.status_str |
|
15 | = test_request.status_str |
|
13 | %td{:align => "center"} |
|
16 | %td{:align => "center"} |
@@ -25,8 +25,14 | |||||
|
25 | <% form_tag({:action => 'import'}, :multipart => true) do %> |
|
25 | <% form_tag({:action => 'import'}, :multipart => true) do %> |
|
26 | File: <%= file_field_tag 'file' %> <%= submit_tag 'Import' %> |
|
26 | File: <%= file_field_tag 'file' %> <%= submit_tag 'Import' %> |
|
27 | <% end %> |
|
27 | <% end %> |
|
|
28 | + <br/> | ||
|
|
29 | + <b>What else: </b> | ||
|
|
30 | + <%= link_to '[New user]', :action => 'new' %> | ||
|
|
31 | + <%= link_to '[New list of users]', :action => 'new_list' %> | ||
|
|
32 | + <%= link_to '[View active users]', :action => 'active' %> | ||
|
28 |
|
33 | ||
|
29 | </div> |
|
34 | </div> |
|
|
35 | + | ||
|
30 | <table> |
|
36 | <table> |
|
31 | <tr> |
|
37 | <tr> |
|
32 | <% for column in User.content_columns %> |
|
38 | <% for column in User.content_columns %> |
@@ -1,3 +1,7 | |||||
|
|
1 | + # Thai translation for Ruby on Rails | ||
|
|
2 | + # original by Prem Sichanugrist (s@sikachu.com/sikandsak@gmail.com) | ||
|
|
3 | + # activerecord keys fixed by Jittat Fakcharoenphol (jittat@gmail.com) | ||
|
|
4 | + | ||
|
1 | { |
|
5 | { |
|
2 | :'th' => { |
|
6 | :'th' => { |
|
3 | :date => { |
|
7 | :date => { |
@@ -66,6 +70,22 | |||||
|
66 | :format => '%n %u' |
|
70 | :format => '%n %u' |
|
67 | } |
|
71 | } |
|
68 | }, |
|
72 | }, |
|
|
73 | + :human => { | ||
|
|
74 | + :format => { | ||
|
|
75 | + :precision => 1, | ||
|
|
76 | + :delimiter => '' | ||
|
|
77 | + }, | ||
|
|
78 | + :storage_units => { | ||
|
|
79 | + :format => "%n %u", | ||
|
|
80 | + :units => { | ||
|
|
81 | + :byte => "B", | ||
|
|
82 | + :kb => "KB", | ||
|
|
83 | + :mb => "MB", | ||
|
|
84 | + :gb => "GB", | ||
|
|
85 | + :tb => "TB", | ||
|
|
86 | + } | ||
|
|
87 | + } | ||
|
|
88 | + }, | ||
|
69 | }, |
|
89 | }, |
|
70 |
|
90 | ||
|
71 | # Active Record |
|
91 | # Active Record |
@@ -4,6 +4,6 | |||||
|
4 | end |
|
4 | end |
|
5 |
|
5 | ||
|
6 | def self.down |
|
6 | def self.down |
|
7 | - execute "ALTER TABLE `users` CHANGE `login` `login` VARCHAR( 10 )" |
|
7 | + # don't have to revert |
|
8 | end |
|
8 | end |
|
9 | end |
|
9 | end |
@@ -1,31 +1,66 | |||||
|
1 | - /* Normal text */ |
|
1 | + /* Main Default */ |
|
2 | body { |
|
2 | body { |
|
|
3 | + background: white url(../images/topbg.jpg) repeat-x top center; | ||
|
3 | font-size: 13px; |
|
4 | font-size: 13px; |
|
4 |
- font-family: |
|
5 | + font-family: Tahoma, "sans-serif"; |
|
|
6 | + margin: 10px; | ||
|
|
7 | + padding: 10px; | ||
|
|
8 | + } | ||
|
|
9 | + | ||
|
|
10 | + /* Form Font */ | ||
|
|
11 | + input { | ||
|
|
12 | + font-family: Tahoma, "sans-serif"; | ||
|
|
13 | + } | ||
|
|
14 | + | ||
|
|
15 | + /* Heading 1/2 */ | ||
|
|
16 | + h1 { | ||
|
|
17 | + font-size: 24px; | ||
|
|
18 | + color: #334488; | ||
|
|
19 | + line-height: 2em; | ||
|
|
20 | + } | ||
|
|
21 | + | ||
|
|
22 | + h2 { | ||
|
|
23 | + font-size: 18px; | ||
|
|
24 | + color: #5566bb; | ||
|
|
25 | + line-height: 1.5em; | ||
|
|
26 | + } | ||
|
|
27 | + | ||
|
|
28 | + /* Bar Line Color and Thickness */ | ||
|
|
29 | + hr { | ||
|
|
30 | + border-top: 1px solid #dddddd; | ||
|
|
31 | + border-bottom: 1px solid #eeeeee; | ||
|
|
32 | + } | ||
|
|
33 | + | ||
|
|
34 | + /* Link + Anchor Color */ | ||
|
|
35 | + a, a:link, a:visited { | ||
|
|
36 | + color: #6666cc; | ||
|
|
37 | + text-decoration: none; | ||
|
|
38 | + } | ||
|
|
39 | + | ||
|
|
40 | + a:hover, a:focus { | ||
|
|
41 | + color: #111166; | ||
|
|
42 | + text-decoration: none; | ||
|
5 | } |
|
43 | } |
|
6 |
|
44 | ||
|
7 | /* This is the main menu bad*/ |
|
45 | /* This is the main menu bad*/ |
|
8 | div.userbar { |
|
46 | div.userbar { |
|
9 | - border-top: thin solid grey; |
|
47 | + line-height: 1.5em; |
|
10 | - border-bottom: thin solid grey; |
|
||
|
11 | text-align: right; |
|
48 | text-align: right; |
|
12 | font-size: 12px; |
|
49 | font-size: 12px; |
|
13 | } |
|
50 | } |
|
14 |
|
51 | ||
|
15 | /* This is the top bar, displaying user's full name */ |
|
52 | /* This is the top bar, displaying user's full name */ |
|
16 | div.title { |
|
53 | div.title { |
|
17 | - font-size: 12px; |
|
54 | + // background: #ddddff; |
|
18 | - background: #ddffdd; |
|
55 | + // border: 1px dashed blue; |
|
19 | - border: 1px solid black; |
|
56 | + padding: 10px 0px; |
|
20 | - padding: 2px; |
|
57 | + line-height: 1.5em; |
|
21 | - margin-top: 3px; |
|
58 | + font-size: 13px; |
|
22 | - margin-bottom: 5px; |
|
||
|
23 | } |
|
59 | } |
|
24 |
|
60 | ||
|
25 | div.title span.contest-over-msg { |
|
61 | div.title span.contest-over-msg { |
|
26 | font-size: 15px; |
|
62 | font-size: 15px; |
|
27 | color: red; |
|
63 | color: red; |
|
28 | - font-weight: bold; |
|
||
|
29 | } |
|
64 | } |
|
30 |
|
65 | ||
|
31 | div.title table { |
|
66 | div.title table { |
@@ -35,27 +70,36 | |||||
|
35 | div.title td.left-col { |
|
70 | div.title td.left-col { |
|
36 | text-align: left; |
|
71 | text-align: left; |
|
37 | vertical-align: top; |
|
72 | vertical-align: top; |
|
|
73 | + color: #444444; | ||
|
38 | } |
|
74 | } |
|
39 |
|
75 | ||
|
40 | div.title td.right-col { |
|
76 | div.title td.right-col { |
|
41 | text-align: right; |
|
77 | text-align: right; |
|
42 | vertical-align: top; |
|
78 | vertical-align: top; |
|
|
79 | + font-size: 14px; | ||
|
|
80 | + font-weight: bold; | ||
|
|
81 | + color: #116699; | ||
|
43 | } |
|
82 | } |
|
44 |
|
83 | ||
|
45 | /* Standard table with header and rows with alternating background */ |
|
84 | /* Standard table with header and rows with alternating background */ |
|
46 | table.info { |
|
85 | table.info { |
|
47 | - border: 1px solid black; |
|
86 | + margin: 10px 0; |
|
|
87 | + border: 1px solid #666666; | ||
|
48 | border-collapse: collapse; |
|
88 | border-collapse: collapse; |
|
49 | font-size: 12px; |
|
89 | font-size: 12px; |
|
50 | } |
|
90 | } |
|
51 |
|
91 | ||
|
52 | table.info th { |
|
92 | table.info th { |
|
53 |
- border: 1px solid |
|
93 | + border: 1px solid #666666; |
|
|
94 | + line-height: 1.5em; | ||
|
|
95 | + padding: 0 0.5em; | ||
|
54 | } |
|
96 | } |
|
55 |
|
97 | ||
|
56 | table.info td { |
|
98 | table.info td { |
|
57 |
- border-left: 1px solid |
|
99 | + border-left: 1px solid #666666; |
|
58 |
- border-right: 1px solid |
|
100 | + border-right: 1px solid #666666; |
|
|
101 | + line-height: 1.5em; | ||
|
|
102 | + padding: 0 0.5em; | ||
|
59 | } |
|
103 | } |
|
60 |
|
104 | ||
|
61 | tr.info-head { |
|
105 | tr.info-head { |
@@ -64,29 +108,30 | |||||
|
64 | } |
|
108 | } |
|
65 |
|
109 | ||
|
66 | tr.info-odd { |
|
110 | tr.info-odd { |
|
67 |
- background: # |
|
111 | + background: #eeeeee; |
|
68 | } |
|
112 | } |
|
69 |
|
113 | ||
|
70 | tr.info-even { |
|
114 | tr.info-even { |
|
71 |
- background: #f |
|
115 | + background: #f9f9f9; |
|
72 | } |
|
116 | } |
|
73 |
|
117 | ||
|
74 | /******************************* |
|
118 | /******************************* |
|
75 | [Main] |
|
119 | [Main] |
|
76 | ********************************/ |
|
120 | ********************************/ |
|
77 | div.submitbox { |
|
121 | div.submitbox { |
|
78 | - border: thin solid black; |
|
122 | + background: #eeeeff; |
|
|
123 | + border: 1px dotted #99aaee; | ||
|
79 | padding: 5px; |
|
124 | padding: 5px; |
|
80 | - color: white; |
|
125 | + margin: 10px 0px; |
|
81 | - background-color: #777777; |
|
126 | + color: black; |
|
82 | font-weight: bold; |
|
127 | font-weight: bold; |
|
83 | font-size: 13px; |
|
128 | font-size: 13px; |
|
84 | } |
|
129 | } |
|
85 |
|
130 | ||
|
86 | div.errorExplanation { |
|
131 | div.errorExplanation { |
|
87 |
- border: 1px d |
|
132 | + border: 1px dotted gray; |
|
88 |
- color: |
|
133 | + color: #bb2222; |
|
89 | - padding: 5px; |
|
134 | + padding: 5px 15px 5px 15px; |
|
90 | margin-bottom: 5px; |
|
135 | margin-bottom: 5px; |
|
91 | background-color: white; |
|
136 | background-color: white; |
|
92 | } |
|
137 | } |
@@ -124,9 +169,10 | |||||
|
124 | div.task-menu { |
|
169 | div.task-menu { |
|
125 | text-align: center; |
|
170 | text-align: center; |
|
126 | font-size: 13px; |
|
171 | font-size: 13px; |
|
|
172 | + line-height: 1.75em; | ||
|
127 | font-weight: bold; |
|
173 | font-weight: bold; |
|
128 |
- border-top: 1px |
|
174 | + border-top: 1px dashed gray; |
|
129 |
- border-bottom: 1px |
|
175 | + border-bottom: 1px dashed gray; |
|
130 | margin-top: 2px; |
|
176 | margin-top: 2px; |
|
131 | margin-bottom: 4px; |
|
177 | margin-bottom: 4px; |
|
132 | } |
|
178 | } |
@@ -135,9 +181,10 | |||||
|
135 | [Submission] |
|
181 | [Submission] |
|
136 | ********************************/ |
|
182 | ********************************/ |
|
137 | table.taskdesc { |
|
183 | table.taskdesc { |
|
138 |
- border: |
|
184 | + border: 2px solid #dddddd; |
|
139 | border-collapse: collapse; |
|
185 | border-collapse: collapse; |
|
140 | - width: 95%; |
|
186 | + margin: 10px auto; |
|
|
187 | + width: 90%; | ||
|
141 | font-size: 13px; |
|
188 | font-size: 13px; |
|
142 | } |
|
189 | } |
|
143 |
|
190 | ||
@@ -146,11 +193,12 | |||||
|
146 | } |
|
193 | } |
|
147 |
|
194 | ||
|
148 | table.taskdesc tr.name { |
|
195 | table.taskdesc tr.name { |
|
149 |
- border: |
|
196 | + border: 2px solid #dddddd; |
|
150 |
- background: # |
|
197 | + background: #dddddd; |
|
151 |
- color: |
|
198 | + color: #333333; |
|
152 | font-weight: bold; |
|
199 | font-weight: bold; |
|
153 | font-size: 14px; |
|
200 | font-size: 14px; |
|
|
201 | + line-height: 1.5em; | ||
|
154 | text-align: center; |
|
202 | text-align: center; |
|
155 | } |
|
203 | } |
|
156 |
|
204 | ||
@@ -167,20 +215,20 | |||||
|
167 | } |
|
215 | } |
|
168 |
|
216 | ||
|
169 | /********************** |
|
217 | /********************** |
|
170 |
- |
|
218 | + Announcement |
|
171 | ***********************/ |
|
219 | ***********************/ |
|
172 |
|
220 | ||
|
173 | div.announcementbox { |
|
221 | div.announcementbox { |
|
174 |
- margin |
|
222 | + margin: 10px 0px; |
|
175 | - margin-bottom: 10px; |
|
223 | + background: #bbddee; |
|
176 | - background: green; |
|
||
|
177 | padding: 1px; |
|
224 | padding: 1px; |
|
178 | } |
|
225 | } |
|
179 |
|
226 | ||
|
180 | div.announcementbox span.title { |
|
227 | div.announcementbox span.title { |
|
181 | font-weight: bold; |
|
228 | font-weight: bold; |
|
182 |
- color: |
|
229 | + color: #224455; |
|
183 | padding-left: 10px; |
|
230 | padding-left: 10px; |
|
|
231 | + line-height: 1.6em; | ||
|
184 | } |
|
232 | } |
|
185 |
|
233 | ||
|
186 | div.announcement { |
|
234 | div.announcement { |
@@ -202,30 +250,44 | |||||
|
202 | } |
|
250 | } |
|
203 |
|
251 | ||
|
204 | /****************** |
|
252 | /****************** |
|
205 |
- |
|
253 | + Messages |
|
206 | ******************/ |
|
254 | ******************/ |
|
207 |
|
255 | ||
|
208 | div.message { |
|
256 | div.message { |
|
209 | - padding-top: 5px; |
|
257 | + margin: 10px 0 0; |
|
210 | - padding-left: 10px; |
|
258 | + } |
|
|
259 | + | ||
|
|
260 | + div.message div.message { | ||
|
|
261 | + margin: 0 0 0 30px; | ||
|
211 | } |
|
262 | } |
|
212 |
|
263 | ||
|
213 | div.message div.body { |
|
264 | div.message div.body { |
|
214 |
- border: |
|
265 | + border: 2px solid #dddddd; |
|
215 |
- background: # |
|
266 | + background: #fff8f8; |
|
216 | padding-left: 5px; |
|
267 | padding-left: 5px; |
|
217 | } |
|
268 | } |
|
218 |
|
269 | ||
|
219 | div.message div.reply-body { |
|
270 | div.message div.reply-body { |
|
220 |
- border: |
|
271 | + border: 2px solid #bbbbbb; |
|
221 |
- background: #ff |
|
272 | + background: #fffff8; |
|
222 | padding-left: 5px; |
|
273 | padding-left: 5px; |
|
223 | } |
|
274 | } |
|
224 |
|
275 | ||
|
225 | div.message div.stat { |
|
276 | div.message div.stat { |
|
226 | font-size: 10px; |
|
277 | font-size: 10px; |
|
227 | - color: white; |
|
278 | + line-height: 1.75em; |
|
228 | - background: green; |
|
279 | + padding: 0 5px; |
|
|
280 | + color: #333333; | ||
|
|
281 | + background: #dddddd; | ||
|
|
282 | + font-weight: bold; | ||
|
|
283 | + } | ||
|
|
284 | + | ||
|
|
285 | + div.message div.message div.stat { | ||
|
|
286 | + font-size: 10px; | ||
|
|
287 | + line-height: 1.75em; | ||
|
|
288 | + padding: 0 5px; | ||
|
|
289 | + color: #444444; | ||
|
|
290 | + background: #bbbbbb; | ||
|
229 | font-weight: bold; |
|
291 | font-weight: bold; |
|
230 | } |
|
292 | } |
|
231 |
|
293 | ||
@@ -234,17 +296,17 | |||||
|
234 | ********************/ |
|
296 | ********************/ |
|
235 | div.contest-title { |
|
297 | div.contest-title { |
|
236 | color: white; |
|
298 | color: white; |
|
237 | - background: #007700; |
|
||
|
238 | text-align: center; |
|
299 | text-align: center; |
|
239 | - padding: 5px; |
|
300 | + line-height: 2em; |
|
240 | } |
|
301 | } |
|
241 |
|
302 | ||
|
242 | div.registration-desc { |
|
303 | div.registration-desc { |
|
243 | - margin-top: 5px; |
|
304 | + border: 1px dotted gray; |
|
244 | - margin-bottom: 5px; |
|
305 | + background: #f5f5f5; |
|
245 | - border: solid 1px gray; |
|
306 | + padding: 5px; |
|
246 |
- |
|
307 | + margin: 10px 0; |
|
247 | - background: #f0f0f0; |
|
308 | + font-size: 12px; |
|
|
309 | + line-height: 1.5em; | ||
|
248 | } |
|
310 | } |
|
249 |
|
311 | ||
|
250 | /******************** |
|
312 | /******************** |
@@ -252,9 +314,10 | |||||
|
252 | ********************/ |
|
314 | ********************/ |
|
253 |
|
315 | ||
|
254 | div.test-desc { |
|
316 | div.test-desc { |
|
255 |
- border: |
|
317 | + border: 1px dotted gray; |
|
256 |
- background: #f |
|
318 | + background: #f5f5f5; |
|
257 | padding: 5px; |
|
319 | padding: 5px; |
|
|
320 | + margin: 10px 0; | ||
|
258 | font-size: 12px; |
|
321 | font-size: 12px; |
|
259 | - margin-bottom: 5px; |
|
322 | + line-height: 1.5em; |
|
260 | } |
|
323 | } |
You need to be logged in to leave comments.
Login now