diff --git a/app/controllers/problems_controller.rb b/app/controllers/problems_controller.rb --- a/app/controllers/problems_controller.rb +++ b/app/controllers/problems_controller.rb @@ -2,6 +2,10 @@ before_filter :authenticate, :authorization + in_place_edit_for :problem, :name + in_place_edit_for :problem, :full_name + in_place_edit_for :problem, :full_score + def index list render :action => 'list' diff --git a/app/helpers/main_helper.rb b/app/helpers/main_helper.rb --- a/app/helpers/main_helper.rb +++ b/app/helpers/main_helper.rb @@ -5,7 +5,7 @@ st = '' if (time.yday != now.yday) or (time.year != now.year) - st = time.strftime("%x") + st = time.strftime("%x ") end st + time.strftime("%X") end @@ -26,13 +26,13 @@ end def format_submission(sub, count) - msg = "#{count} submission(s)
" + msg = "#{count} submission(s)." if count>0 msg = msg + "Last on " + format_short_time(sub.submitted_at) + ' ' + - link_to('[source]',{:action => 'get_source', :id => sub.id}) + - "
" + link_to('[source]',{:action => 'get_source', :id => sub.id}) end + msg += "
" if sub!=nil and sub.graded_at!=nil msg = msg + 'Graded at ' + format_short_time(sub.graded_at) + ', score: '+ sub.points.to_s + diff --git a/app/views/layouts/problems.rhtml b/app/views/layouts/problems.rhtml --- a/app/views/layouts/problems.rhtml +++ b/app/views/layouts/problems.rhtml @@ -6,6 +6,7 @@ Problems: <%= controller.action_name %> <%= stylesheet_link_tag 'scaffold' %> + <%= javascript_include_tag :defaults %> diff --git a/app/views/main/list.rhtml b/app/views/main/list.rhtml --- a/app/views/main/list.rhtml +++ b/app/views/main/list.rhtml @@ -1,5 +1,5 @@ -

Hello <%=h @user.full_name %>

-(<%= Time.new %>) +
Hello <%=h @user.full_name %>
+Current time is <%= format_short_time(Time.new) %>.
<% form_tag({:action => 'submit'}, :multipart => true) do %> @@ -22,7 +22,7 @@
<%= "#{i+1}: #{p.full_name} (#{p.name})" %> - <%= link_to '[task description]', p.url if p.url!=nil %> + <%= link_to '[task description]', p.url if (p.url!=nil) and (p.url!='') %>
<%= format_submission(@prob_submissions[i][1], @@ -33,18 +33,5 @@ <% end %>
-

-
-
-<% form_tag({:action => 'submit'}, :multipart => true) do %> -Problem: <%= select 'submission', 'problem_id', - [['Specified in header','-1']] + - @problems.collect {|p| [p.full_name, p.id]}, - :selected => '-1' %> -File: <%= file_field_tag 'file' %> -<%= submit_tag 'Submit' %> -<% end %> -
- diff --git a/app/views/problems/list.rhtml b/app/views/problems/list.rhtml --- a/app/views/problems/list.rhtml +++ b/app/views/problems/list.rhtml @@ -6,16 +6,22 @@ - <% for column in Problem.content_columns %> - - <% end %> + + + + + <% for problem in @problems %> - <% for column in Problem.content_columns %> - - <% end %> + <% @problem=problem %> + diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -2,6 +2,13 @@ font-size: 12px; } +div.title { + font-size: 20px; + font-weight: bold; + background: lightgreen; + padding: 2px; +} + div.problist-each { margin-top: 2px; margin-bottom: 2px @@ -10,7 +17,8 @@ div.usermenu { border-top: thin solid grey; border-bottom: thin solid grey; - text-align: right + text-align: right; + font-size: 12px; } div.probname { @@ -24,7 +32,8 @@ margin-left: 20px; margin-top: 2px; border-bottom: thin solid grey; - border-left: thin solid grey + border-left: thin solid grey; + font-size: 12px; } div.compilermsgbody { @@ -36,6 +45,7 @@ padding: 5px; color: white; background-color: #777777; + font-weight: bold; }
<%= column.human_name %>NameFull nameFull scoreDate addedAvailable
<%=h problem.send(column.name) %><%= in_place_editor_field :problem, :name, {}, :rows=>1 %> + <%= in_place_editor_field :problem, :full_name, {}, :rows=>1 %> + <%= in_place_editor_field :problem, :full_score, {}, :rows=>1 %> + <%= problem.date_added %> + <%= problem.available %> + <%= link_to '[Toggle]', :action => 'toggle_avail', :id => problem.id %> <%= link_to '[Stat]', :action => 'stat', :id => problem.id %> <%= link_to '[Show]', :action => 'show', :id => problem %>