Description:
more styling
git-svn-id: http://theory.cpe.ku.ac.th/grader/web/trunk@158 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
r78:822d6c35aada - - 12 files changed: 68 inserted, 45 deleted
@@ -0,0 +1,22 | |||||
|
|
1 | + = user_title_bar(@user) | ||
|
|
2 | + | ||
|
|
3 | + .submitbox | ||
|
|
4 | + = error_messages_for 'submission' | ||
|
|
5 | + = render :partial => 'submission_box' | ||
|
|
6 | + | ||
|
|
7 | + | ||
|
|
8 | + %hr/ | ||
|
|
9 | + | ||
|
|
10 | + %table.info | ||
|
|
11 | + %tr.info-head | ||
|
|
12 | + %th | ||
|
|
13 | + %th Tasks | ||
|
|
14 | + %th # of sub(s) | ||
|
|
15 | + %th Results | ||
|
|
16 | + = render :partial => 'problem', :collection => @problems | ||
|
|
17 | + | ||
|
|
18 | + %hr | ||
|
|
19 | + | ||
|
|
20 | + .submitbox | ||
|
|
21 | + = render :partial => 'submission_box' | ||
|
|
22 | + |
@@ -6,27 +6,24 | |||||
|
6 | :redirect_to => { :action => :index } |
|
6 | :redirect_to => { :action => :index } |
|
7 |
|
7 | ||
|
8 |
|
8 | ||
|
9 | def index |
|
9 | def index |
|
10 | redirect_to :action => 'login' |
|
10 | redirect_to :action => 'login' |
|
11 | end |
|
11 | end |
|
12 |
|
12 | ||
|
13 | def login |
|
13 | def login |
|
14 | saved_notice = flash[:notice] |
|
14 | saved_notice = flash[:notice] |
|
15 | reset_session |
|
15 | reset_session |
|
16 | flash[:notice] = saved_notice |
|
16 | flash[:notice] = saved_notice |
|
17 |
|
17 | ||
|
18 | - @title = Configuration['ui.front.title'] |
|
||
|
19 | - @welcome = Configuration['ui.front.welcome_message'] |
|
||
|
20 | - |
|
||
|
21 | render :action => 'login', :layout => 'empty' |
|
18 | render :action => 'login', :layout => 'empty' |
|
22 | end |
|
19 | end |
|
23 |
|
20 | ||
|
24 | def list |
|
21 | def list |
|
25 | prepare_list_information |
|
22 | prepare_list_information |
|
26 | end |
|
23 | end |
|
27 |
|
24 | ||
|
28 | def submit |
|
25 | def submit |
|
29 | @submission = Submission.new(params[:submission]) |
|
26 | @submission = Submission.new(params[:submission]) |
|
30 | @submission.user_id = session[:user_id] |
|
27 | @submission.user_id = session[:user_id] |
|
31 | @submission.language_id = 0 |
|
28 | @submission.language_id = 0 |
|
32 | @submission.source = params['file'].read if params['file']!='' |
|
29 | @submission.source = params['file'].read if params['file']!='' |
@@ -34,13 +34,30 | |||||
|
34 | end |
|
34 | end |
|
35 |
|
35 | ||
|
36 | def format_short_time(time) |
|
36 | def format_short_time(time) |
|
37 | now = Time.now |
|
37 | now = Time.now |
|
38 | st = '' |
|
38 | st = '' |
|
39 | if (time.yday != now.yday) or |
|
39 | if (time.yday != now.yday) or |
|
40 | (time.year != now.year) |
|
40 | (time.year != now.year) |
|
41 | st = time.strftime("%x ") |
|
41 | st = time.strftime("%x ") |
|
42 | end |
|
42 | end |
|
43 | st + time.strftime("%X") |
|
43 | st + time.strftime("%X") |
|
44 | end |
|
44 | end |
|
45 |
|
45 | ||
|
|
46 | + | ||
|
|
47 | + def user_title_bar(user) | ||
|
|
48 | + <<TITLEBAR | ||
|
|
49 | + <div class="title"> | ||
|
|
50 | + <table> | ||
|
|
51 | + <tr> | ||
|
|
52 | + <td class="left-col"> | ||
|
|
53 | + #{user.full_name}<br/> | ||
|
|
54 | + Current time is #{format_short_time(Time.new)}<br/> | ||
|
|
55 | + </td> | ||
|
|
56 | + <td class="right-col">APIO'08</td> | ||
|
|
57 | + </tr> | ||
|
|
58 | + </table> | ||
|
|
59 | + </div> | ||
|
|
60 | + TITLEBAR | ||
|
|
61 | + end | ||
|
|
62 | + | ||
|
46 | end |
|
63 | end |
@@ -5,18 +5,18 | |||||
|
5 | <head> |
|
5 | <head> |
|
6 | <meta http-equiv="content-type" content="text/html;charset=UTF-8" /> |
|
6 | <meta http-equiv="content-type" content="text/html;charset=UTF-8" /> |
|
7 | <title>Grader!</title> |
|
7 | <title>Grader!</title> |
|
8 | <%= stylesheet_link_tag 'application' %> |
|
8 | <%= stylesheet_link_tag 'application' %> |
|
9 | <%= yield :head %> |
|
9 | <%= yield :head %> |
|
10 | </head> |
|
10 | </head> |
|
11 | <body> |
|
11 | <body> |
|
12 |
|
12 | ||
|
13 | <div class="userbar"> |
|
13 | <div class="userbar"> |
|
14 | <%= user_header %> |
|
14 | <%= user_header %> |
|
15 | </div> |
|
15 | </div> |
|
16 |
|
16 | ||
|
17 | - <p style="color: green"><%= flash[:notice] %></p> |
|
17 | + <%= content_tag(:p,flash[:notice],:style => "color:green") if flash[:notice]!=nil %> |
|
18 |
|
18 | ||
|
19 | <%= yield %> |
|
19 | <%= yield %> |
|
20 |
|
20 | ||
|
21 | </body> |
|
21 | </body> |
|
22 | </html> |
|
22 | </html> |
@@ -1,18 +1,18 | |||||
|
1 |
|
1 | ||
|
2 | %tr{:class => ((submission_counter%2==0) ? "info-even" : "info-odd")} |
|
2 | %tr{:class => ((submission_counter%2==0) ? "info-even" : "info-odd")} |
|
3 | %td.info{:align => "center"} |
|
3 | %td.info{:align => "center"} |
|
4 | = submission_counter+1 |
|
4 | = submission_counter+1 |
|
5 | %td.info= format_short_time(submission.submitted_at) |
|
5 | %td.info= format_short_time(submission.submitted_at) |
|
6 | %td.info{:align => "center"} |
|
6 | %td.info{:align => "center"} |
|
7 | = link_to('[load]',{:action => 'source', :id => submission.id}) |
|
7 | = link_to('[load]',{:action => 'source', :id => submission.id}) |
|
8 | %td.info |
|
8 | %td.info |
|
9 | - if submission.graded_at!=nil |
|
9 | - if submission.graded_at!=nil |
|
10 | = "Graded at #{format_short_time(submission.graded_at)}." |
|
10 | = "Graded at #{format_short_time(submission.graded_at)}." |
|
11 | %br/ |
|
11 | %br/ |
|
12 | - = "Score: #{submission.points} " |
|
12 | + = "Score: #{submission.points} " if Configuration['ui.show_score'] |
|
13 | = " [" |
|
13 | = " [" |
|
14 | %tt |
|
14 | %tt |
|
15 | = submission.grader_comment |
|
15 | = submission.grader_comment |
|
16 | = "]" |
|
16 | = "]" |
|
17 | %td.info |
|
17 | %td.info |
|
18 | = render :partial => 'compiler_message', :locals => {:compiler_message => submission.compiler_message } |
|
18 | = render :partial => 'compiler_message', :locals => {:compiler_message => submission.compiler_message } |
@@ -1,20 +1,20 | |||||
|
1 |
|
1 | ||
|
2 | - if submission==nil |
|
2 | - if submission==nil |
|
3 | = "-" |
|
3 | = "-" |
|
4 | - else |
|
4 | - else |
|
5 | - if submission.graded_at==nil |
|
5 | - if submission.graded_at==nil |
|
6 | Submitted at |
|
6 | Submitted at |
|
7 | = format_short_time(submission.submitted_at) |
|
7 | = format_short_time(submission.submitted_at) |
|
8 | - else |
|
8 | - else |
|
9 | = "Graded at #{format_short_time(submission.graded_at)}, " |
|
9 | = "Graded at #{format_short_time(submission.graded_at)}, " |
|
10 | - = "score: #{submission.points} " |
|
10 | + = "score: #{submission.points} " if Configuration['ui.show_score'] |
|
11 | = " [" |
|
11 | = " [" |
|
12 | %tt |
|
12 | %tt |
|
13 | = submission.grader_comment |
|
13 | = submission.grader_comment |
|
14 | = "]" |
|
14 | = "]" |
|
15 | = " | " |
|
15 | = " | " |
|
16 | = link_to('[msg]', {:action => 'compiler_msg', :id => submission.id}, {:popup => true}) |
|
16 | = link_to('[msg]', {:action => 'compiler_msg', :id => submission.id}, {:popup => true}) |
|
17 | = " | " |
|
17 | = " | " |
|
18 | = link_to('[source]',{:action => 'source', :id => submission.id}) |
|
18 | = link_to('[source]',{:action => 'source', :id => submission.id}) |
|
19 | = " | " |
|
19 | = " | " |
|
20 | = link_to '[submissions]', :action => 'submission', :id => problem_name |
|
20 | = link_to '[submissions]', :action => 'submission', :id => problem_name |
@@ -1,15 +1,15 | |||||
|
1 |
- <h1><%= |
|
1 | + <h1><%= Configuration['ui.front.title'] %></h1> |
|
2 |
|
2 | ||
|
3 | - <b><%= @welcome %></b><br/> |
|
3 | + <b><%= Configuration['ui.front.welcome_message'] %></b><br/> |
|
4 | Please login to see the problem list.<br/><br/> |
|
4 | Please login to see the problem list.<br/><br/> |
|
5 |
|
5 | ||
|
6 | <% if flash[:notice] %> |
|
6 | <% if flash[:notice] %> |
|
7 | <hr> |
|
7 | <hr> |
|
8 | <b><%= flash[:notice] %></b> |
|
8 | <b><%= flash[:notice] %></b> |
|
9 | <hr> |
|
9 | <hr> |
|
10 | <% end %> |
|
10 | <% end %> |
|
11 |
|
11 | ||
|
12 | <div style="border: solid 1px gray; padding: 2px; background: #f0f0f0;"> |
|
12 | <div style="border: solid 1px gray; padding: 2px; background: #f0f0f0;"> |
|
13 | <% form_tag :controller => 'login', :action => 'login' do %> |
|
13 | <% form_tag :controller => 'login', :action => 'login' do %> |
|
14 | <table> |
|
14 | <table> |
|
15 | <tr> |
|
15 | <tr> |
@@ -1,19 +1,13 | |||||
|
1 | - .title |
|
1 | + = user_title_bar(@user) |
|
2 | - Hello |
|
||
|
3 | - =h @user.full_name |
|
||
|
4 | - |
|
||
|
5 | - Current time is |
|
||
|
6 | - = format_short_time(Time.new) |
|
||
|
7 | - %br/ |
|
||
|
8 |
|
2 | ||
|
9 | .task-menu |
|
3 | .task-menu |
|
10 | Task List |
|
4 | Task List |
|
11 | %br/ |
|
5 | %br/ |
|
12 | - @problems.each do |problem| |
|
6 | - @problems.each do |problem| |
|
13 | = link_to problem.name, :action => 'submission', :id => problem.name |
|
7 | = link_to problem.name, :action => 'submission', :id => problem.name |
|
14 |
|
8 | ||
|
15 | - if @problem!=nil |
|
9 | - if @problem!=nil |
|
16 | %h2= "Task: #{@problem.full_name} (#{@problem.name})" |
|
10 | %h2= "Task: #{@problem.full_name} (#{@problem.name})" |
|
17 |
|
11 | ||
|
18 | - if @submissions!=nil |
|
12 | - if @submissions!=nil |
|
19 | - if @submissions.length>0 |
|
13 | - if @submissions.length>0 |
@@ -1,12 +1,14 | |||||
|
|
1 | + <%= user_title_bar(@user) %> | ||
|
|
2 | + | ||
|
1 | <h2>Test Interface</h2> |
|
3 | <h2>Test Interface</h2> |
|
2 |
|
4 | ||
|
3 | <% if @problems.length==0 %> |
|
5 | <% if @problems.length==0 %> |
|
4 | There is no submission |
|
6 | There is no submission |
|
5 | <% else %> |
|
7 | <% else %> |
|
6 |
|
8 | ||
|
7 | <script type="text/javascript"> |
|
9 | <script type="text/javascript"> |
|
8 | var submissionCount = new Array(); |
|
10 | var submissionCount = new Array(); |
|
9 | <% @submissions.each do |submission| %> |
|
11 | <% @submissions.each do |submission| %> |
|
10 | submissionCount[<%= submission.problem_id %>]=<%= submission.number %>; |
|
12 | submissionCount[<%= submission.problem_id %>]=<%= submission.number %>; |
|
11 | <% end %> |
|
13 | <% end %> |
|
12 |
|
14 |
@@ -1,16 +1,17 | |||||
|
1 | - |
|
||
|
2 |
|
|
1 | - content_for :head do |
|
3 | = javascript_include_tag :defaults |
|
2 | = javascript_include_tag :defaults |
|
4 |
|
3 | ||
|
|
4 | + = user_title_bar(@user) | ||
|
|
5 | + | ||
|
5 | %h1 Your account settings |
|
6 | %h1 Your account settings |
|
6 |
|
7 | ||
|
7 | %p |
|
8 | %p |
|
8 | You can edit your alias and e-mails. Just click on the text and edit it. |
|
9 | You can edit your alias and e-mails. Just click on the text and edit it. |
|
9 |
|
10 | ||
|
10 |
|
11 | ||
|
11 | %table.uinfo |
|
12 | %table.uinfo |
|
12 | %tr |
|
13 | %tr |
|
13 | %th.uinfo Login |
|
14 | %th.uinfo Login |
|
14 | %td.uinfo= @user.login |
|
15 | %td.uinfo= @user.login |
|
15 | %tr |
|
16 | %tr |
|
16 | %th.uinfo Full name |
|
17 | %th.uinfo Full name |
@@ -4,28 +4,44 | |||||
|
4 | } |
|
4 | } |
|
5 |
|
5 | ||
|
6 | /* This is the main menu bad*/ |
|
6 | /* This is the main menu bad*/ |
|
7 | div.userbar { |
|
7 | div.userbar { |
|
8 | border-top: thin solid grey; |
|
8 | border-top: thin solid grey; |
|
9 | border-bottom: thin solid grey; |
|
9 | border-bottom: thin solid grey; |
|
10 | text-align: right; |
|
10 | text-align: right; |
|
11 | font-size: 12px; |
|
11 | font-size: 12px; |
|
12 | } |
|
12 | } |
|
13 |
|
13 | ||
|
14 | /* This is the top bar, displaying user's full name */ |
|
14 | /* This is the top bar, displaying user's full name */ |
|
15 | div.title { |
|
15 | div.title { |
|
16 |
- font-size: 2 |
|
16 | + font-size: 12px; |
|
17 | - font-weight: bold; |
|
17 | + background: #ddffdd; |
|
18 | - background: lightgreen; |
|
18 | + border: 1px solid black; |
|
19 | padding: 2px; |
|
19 | padding: 2px; |
|
|
20 | + margin-top: 3px; | ||
|
|
21 | + margin-bottom: 5px; | ||
|
|
22 | + } | ||
|
|
23 | + | ||
|
|
24 | + div.title table { | ||
|
|
25 | + width: 100%; | ||
|
|
26 | + } | ||
|
|
27 | + | ||
|
|
28 | + div.title td.left-col { | ||
|
|
29 | + text-align: left; | ||
|
|
30 | + vertical-align: top; | ||
|
|
31 | + } | ||
|
|
32 | + | ||
|
|
33 | + div.title td.right-col { | ||
|
|
34 | + text-align: right; | ||
|
|
35 | + vertical-align: top; | ||
|
20 | } |
|
36 | } |
|
21 |
|
37 | ||
|
22 | /* Standard table with header and rows with alternating background */ |
|
38 | /* Standard table with header and rows with alternating background */ |
|
23 | table.info { |
|
39 | table.info { |
|
24 | border: 1px solid black; |
|
40 | border: 1px solid black; |
|
25 | border-collapse: collapse; |
|
41 | border-collapse: collapse; |
|
26 | font-size: 12px; |
|
42 | font-size: 12px; |
|
27 | } |
|
43 | } |
|
28 |
|
44 | ||
|
29 | table.info th { |
|
45 | table.info th { |
|
30 | border: 1px solid black; |
|
46 | border: 1px solid black; |
|
31 | } |
|
47 | } |
deleted file |
You need to be logged in to leave comments.
Login now