diff --git a/app/controllers/main_controller.rb b/app/controllers/main_controller.rb --- a/app/controllers/main_controller.rb +++ b/app/controllers/main_controller.rb @@ -15,9 +15,6 @@ reset_session flash[:notice] = saved_notice - @title = Configuration['ui.front.title'] - @welcome = Configuration['ui.front.welcome_message'] - render :action => 'login', :layout => 'empty' end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -43,4 +43,21 @@ st + time.strftime("%X") end + + def user_title_bar(user) + < + + + + + +
+#{user.full_name}
+Current time is #{format_short_time(Time.new)}
+
APIO'08
+ +TITLEBAR + end + end diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -14,7 +14,7 @@ <%= user_header %> -

<%= flash[:notice] %>

+<%= content_tag(:p,flash[:notice],:style => "color:green") if flash[:notice]!=nil %> <%= yield %> diff --git a/app/views/main/_submission.html.haml b/app/views/main/_submission.html.haml --- a/app/views/main/_submission.html.haml +++ b/app/views/main/_submission.html.haml @@ -9,7 +9,7 @@ - if submission.graded_at!=nil = "Graded at #{format_short_time(submission.graded_at)}." %br/ - = "Score: #{submission.points} " + = "Score: #{submission.points} " if Configuration['ui.show_score'] = " [" %tt = submission.grader_comment diff --git a/app/views/main/_submission_short.html.haml b/app/views/main/_submission_short.html.haml --- a/app/views/main/_submission_short.html.haml +++ b/app/views/main/_submission_short.html.haml @@ -7,7 +7,7 @@ = format_short_time(submission.submitted_at) - else = "Graded at #{format_short_time(submission.graded_at)}, " - = "score: #{submission.points} " + = "score: #{submission.points} " if Configuration['ui.show_score'] = " [" %tt = submission.grader_comment diff --git a/app/views/main/list.html.haml b/app/views/main/list.html.haml new file mode 100644 --- /dev/null +++ b/app/views/main/list.html.haml @@ -0,0 +1,22 @@ += user_title_bar(@user) + +.submitbox + = error_messages_for 'submission' + = render :partial => 'submission_box' + + +%hr/ + +%table.info + %tr.info-head + %th + %th Tasks + %th # of sub(s) + %th Results + = render :partial => 'problem', :collection => @problems + +%hr + +.submitbox + = render :partial => 'submission_box' + diff --git a/app/views/main/list.rhtml b/app/views/main/list.rhtml deleted file mode 100644 --- a/app/views/main/list.rhtml +++ /dev/null @@ -1,26 +0,0 @@ -
Hello <%=h @user.full_name %>
-Current time is <%= format_short_time(Time.new) %>. - -
- <%= error_messages_for 'submission' %> - <%= render :partial => 'submission_box' %> -
- -
- - - - - - - - - <%= render :partial => 'problem', :collection => @problems %> -
Tasks# of sub(s)Results
- -
- -
- <%= render :partial => 'submission_box' %> -
- diff --git a/app/views/main/login.rhtml b/app/views/main/login.rhtml --- a/app/views/main/login.rhtml +++ b/app/views/main/login.rhtml @@ -1,6 +1,6 @@ -

<%= @title %>

+

<%= Configuration['ui.front.title'] %>

-<%= @welcome %>
+<%= Configuration['ui.front.welcome_message'] %>
Please login to see the problem list.

<% if flash[:notice] %> diff --git a/app/views/main/submission.html.haml b/app/views/main/submission.html.haml --- a/app/views/main/submission.html.haml +++ b/app/views/main/submission.html.haml @@ -1,10 +1,4 @@ -.title - Hello - =h @user.full_name - -Current time is -= format_short_time(Time.new) -%br/ += user_title_bar(@user) .task-menu Task List diff --git a/app/views/test/index.html.erb b/app/views/test/index.html.erb --- a/app/views/test/index.html.erb +++ b/app/views/test/index.html.erb @@ -1,3 +1,5 @@ +<%= user_title_bar(@user) %> +

Test Interface

<% if @problems.length==0 %> diff --git a/app/views/users/index.html.haml b/app/views/users/index.html.haml --- a/app/views/users/index.html.haml +++ b/app/views/users/index.html.haml @@ -1,7 +1,8 @@ - - content_for :head do = javascript_include_tag :defaults += user_title_bar(@user) + %h1 Your account settings %p diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -13,10 +13,26 @@ /* This is the top bar, displaying user's full name */ div.title { - font-size: 20px; - font-weight: bold; - background: lightgreen; + font-size: 12px; + background: #ddffdd; + border: 1px solid black; padding: 2px; + margin-top: 3px; + margin-bottom: 5px; +} + +div.title table { + width: 100%; +} + +div.title td.left-col { + text-align: left; + vertical-align: top; +} + +div.title td.right-col { + text-align: right; + vertical-align: top; } /* Standard table with header and rows with alternating background */