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:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r190:27e07d862fff - - 9 files changed: 181 inserted, 57 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 16 @hidden_columns = ['hashed_password', 'salt', 'created_at', 'updated_at']
17 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 29 def show
20 30 @user = User.find(params[:id])
21 31 end
@@ -125,6 +125,9
125 125 begin
126 126 if self.site==nil
127 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 131 end
129 132 rescue
130 133 end
@@ -19,7 +19,7
19 19 %b= flash[:notice]
20 20 %hr/
21 21
22 - %div{ :style => "border: solid 1px gray; padding: 2px; background: #f0f0f0;"}
22 + %div{ :style => "border: solid 1px gray; padding: 4px; background: #eeeeff;"}
23 23 - form_tag :controller => 'login', :action => 'login' do
24 24 %table
25 25 %tr
@@ -7,7 +7,10
7 7 - else
8 8 (n/a)
9 9 %td{:align => "center"}
10 - = test_request.submission.number
10 + - if test_request.submission
11 + = test_request.submission.number
12 + - else
13 + n/a
11 14 %td{:align => "center"}
12 15 = test_request.status_str
13 16 %td{:align => "center"}
@@ -25,8 +25,14
25 25 <% form_tag({:action => 'import'}, :multipart => true) do %>
26 26 File: <%= file_field_tag 'file' %> <%= submit_tag 'Import' %>
27 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 34 </div>
35 +
30 36 <table>
31 37 <tr>
32 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 6 :'th' => {
3 7 :date => {
@@ -66,6 +70,22
66 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 91 # Active Record
@@ -4,6 +4,6
4 4 end
5 5
6 6 def self.down
7 - execute "ALTER TABLE `users` CHANGE `login` `login` VARCHAR( 10 )"
7 + # don't have to revert
8 8 end
9 9 end
@@ -1,31 +1,66
1 - /* Normal text */
1 + /* Main Default */
2 2 body {
3 + background: white url(../images/topbg.jpg) repeat-x top center;
3 4 font-size: 13px;
4 - font-family: "Sans Serif";
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 45 /* This is the main menu bad*/
8 46 div.userbar {
9 - border-top: thin solid grey;
10 - border-bottom: thin solid grey;
47 + line-height: 1.5em;
11 48 text-align: right;
12 49 font-size: 12px;
13 50 }
14 51
15 52 /* This is the top bar, displaying user's full name */
16 53 div.title {
17 - font-size: 12px;
18 - background: #ddffdd;
19 - border: 1px solid black;
20 - padding: 2px;
21 - margin-top: 3px;
22 - margin-bottom: 5px;
54 + // background: #ddddff;
55 + // border: 1px dashed blue;
56 + padding: 10px 0px;
57 + line-height: 1.5em;
58 + font-size: 13px;
23 59 }
24 60
25 61 div.title span.contest-over-msg {
26 62 font-size: 15px;
27 63 color: red;
28 - font-weight: bold;
29 64 }
30 65
31 66 div.title table {
@@ -35,27 +70,36
35 70 div.title td.left-col {
36 71 text-align: left;
37 72 vertical-align: top;
73 + color: #444444;
38 74 }
39 75
40 76 div.title td.right-col {
41 77 text-align: right;
42 78 vertical-align: top;
79 + font-size: 14px;
80 + font-weight: bold;
81 + color: #116699;
43 82 }
44 83
45 84 /* Standard table with header and rows with alternating background */
46 85 table.info {
47 - border: 1px solid black;
86 + margin: 10px 0;
87 + border: 1px solid #666666;
48 88 border-collapse: collapse;
49 89 font-size: 12px;
50 90 }
51 91
52 92 table.info th {
53 - border: 1px solid black;
93 + border: 1px solid #666666;
94 + line-height: 1.5em;
95 + padding: 0 0.5em;
54 96 }
55 97
56 98 table.info td {
57 - border-left: 1px solid black;
58 - border-right: 1px solid black;
99 + border-left: 1px solid #666666;
100 + border-right: 1px solid #666666;
101 + line-height: 1.5em;
102 + padding: 0 0.5em;
59 103 }
60 104
61 105 tr.info-head {
@@ -64,29 +108,30
64 108 }
65 109
66 110 tr.info-odd {
67 - background: #dddddd;
111 + background: #eeeeee;
68 112 }
69 113
70 114 tr.info-even {
71 - background: #f0f0f0;
115 + background: #f9f9f9;
72 116 }
73 117
74 118 /*******************************
75 119 [Main]
76 120 ********************************/
77 121 div.submitbox {
78 - border: thin solid black;
122 + background: #eeeeff;
123 + border: 1px dotted #99aaee;
79 124 padding: 5px;
80 - color: white;
81 - background-color: #777777;
125 + margin: 10px 0px;
126 + color: black;
82 127 font-weight: bold;
83 128 font-size: 13px;
84 129 }
85 130
86 131 div.errorExplanation {
87 - border: 1px dashed black;
88 - color: black;
89 - padding: 5px;
132 + border: 1px dotted gray;
133 + color: #bb2222;
134 + padding: 5px 15px 5px 15px;
90 135 margin-bottom: 5px;
91 136 background-color: white;
92 137 }
@@ -124,9 +169,10
124 169 div.task-menu {
125 170 text-align: center;
126 171 font-size: 13px;
172 + line-height: 1.75em;
127 173 font-weight: bold;
128 - border-top: 1px solid black;
129 - border-bottom: 1px solid black;
174 + border-top: 1px dashed gray;
175 + border-bottom: 1px dashed gray;
130 176 margin-top: 2px;
131 177 margin-bottom: 4px;
132 178 }
@@ -135,9 +181,10
135 181 [Submission]
136 182 ********************************/
137 183 table.taskdesc {
138 - border: 1px solid black;
184 + border: 2px solid #dddddd;
139 185 border-collapse: collapse;
140 - width: 95%;
186 + margin: 10px auto;
187 + width: 90%;
141 188 font-size: 13px;
142 189 }
143 190
@@ -146,11 +193,12
146 193 }
147 194
148 195 table.taskdesc tr.name {
149 - border: 1px solid black;
150 - background: #aaaaaa;
151 - color: white;
196 + border: 2px solid #dddddd;
197 + background: #dddddd;
198 + color: #333333;
152 199 font-weight: bold;
153 200 font-size: 14px;
201 + line-height: 1.5em;
154 202 text-align: center;
155 203 }
156 204
@@ -167,20 +215,20
167 215 }
168 216
169 217 /**********************
170 - [Announcement]
218 + Announcement
171 219 ***********************/
172 220
173 221 div.announcementbox {
174 - margin-top: 10px;
175 - margin-bottom: 10px;
176 - background: green;
222 + margin: 10px 0px;
223 + background: #bbddee;
177 224 padding: 1px;
178 225 }
179 226
180 227 div.announcementbox span.title {
181 228 font-weight: bold;
182 - color: white;
229 + color: #224455;
183 230 padding-left: 10px;
231 + line-height: 1.6em;
184 232 }
185 233
186 234 div.announcement {
@@ -202,30 +250,44
202 250 }
203 251
204 252 /******************
205 - [Messages
253 + Messages
206 254 ******************/
207 255
208 256 div.message {
209 - padding-top: 5px;
210 - padding-left: 10px;
257 + margin: 10px 0 0;
258 + }
259 +
260 + div.message div.message {
261 + margin: 0 0 0 30px;
211 262 }
212 263
213 264 div.message div.body {
214 - border: 1px solid green;
215 - background: #eeffee;
265 + border: 2px solid #dddddd;
266 + background: #fff8f8;
216 267 padding-left: 5px;
217 268 }
218 269
219 270 div.message div.reply-body {
220 - border: 1px solid black;
221 - background: #ffeeee;
271 + border: 2px solid #bbbbbb;
272 + background: #fffff8;
222 273 padding-left: 5px;
223 274 }
224 275
225 276 div.message div.stat {
226 277 font-size: 10px;
227 - color: white;
228 - background: green;
278 + line-height: 1.75em;
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 291 font-weight: bold;
230 292 }
231 293
@@ -234,17 +296,17
234 296 ********************/
235 297 div.contest-title {
236 298 color: white;
237 - background: #007700;
238 299 text-align: center;
239 - padding: 5px;
300 + line-height: 2em;
240 301 }
241 302
242 303 div.registration-desc {
243 - margin-top: 5px;
244 - margin-bottom: 5px;
245 - border: solid 1px gray;
246 - padding: 10px;
247 - background: #f0f0f0;
304 + border: 1px dotted gray;
305 + background: #f5f5f5;
306 + padding: 5px;
307 + margin: 10px 0;
308 + font-size: 12px;
309 + line-height: 1.5em;
248 310 }
249 311
250 312 /********************
@@ -252,9 +314,10
252 314 ********************/
253 315
254 316 div.test-desc {
255 - border: solid 1px gray;
256 - background: #f0f0f0;
317 + border: 1px dotted gray;
318 + background: #f5f5f5;
257 319 padding: 5px;
320 + margin: 10px 0;
258 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