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
@@ -63,6 +63,15 @@
redirect_to :action => 'list'
end
+ def turn_all_off
+ Problem.find(:all,
+ :conditions => "available = 1").each do |problem|
+ problem.available = false
+ problem.save
+ end
+ redirect_to :action => 'list'
+ end
+
def stat
@problem = Problem.find(params[:id])
@submissions = Submission.find_all_last_by_problem(params[:id])
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
@@ -1,5 +1,6 @@
<% content_for :head do %>
<%= stylesheet_link_tag 'scaffold' %>
+ <%= stylesheet_link_tag 'problems' %>
<%= javascript_include_tag :defaults %>
<% end %>
@@ -9,7 +10,8 @@
<%= link_to 'Main', :controller => 'main', :action => 'list' %>
-<%= link_to 'New problem', :action => 'new' %>
+<%= link_to 'New problem', :action => 'new' %>
+<%= link_to 'Turn off all problems', :action => 'turn_all_off' %>
<%= in_place_editor_field :problem, :name, {}, :rows=>1 %> | <%= in_place_editor_field :problem, :full_name, {}, :rows=>1 %> diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -1,14 +1,9 @@ +/* Normal text */ p { font-size: 12px; } -div.title { - font-size: 20px; - font-weight: bold; - background: lightgreen; - padding: 2px; -} - +/* This is the main menu bad*/ div.userbar { border-top: thin solid grey; border-bottom: thin solid grey; @@ -16,39 +11,15 @@ font-size: 12px; } -div.compilermsgbody { - font-family: monospace; -} - -div.submitbox { - border: thin solid black; - padding: 5px; - color: white; - background-color: #777777; +/* This is the top bar, displaying user's full name */ +div.title { + font-size: 20px; font-weight: bold; - font-size: 13px; + background: lightgreen; + padding: 2px; } -table.uinfo { - border-collapse: collapse; - border: 1px solid black; - font-size: 13px; -} - -td.uinfo { - vertical-align: top; - border: 1px solid black; - padding: 5px; -} - -th.uinfo { - background: lightgreen; - vertical-align: top; - text-align: right; - border: 1px solid black; - padding: 5px; -} - +/* Standard table with header and rows with alternating background */ table.info { border: 1px solid black; border-collapse: collapse; @@ -77,6 +48,48 @@ background: #f0f0f0; } +/******************************* + [Main] +********************************/ +div.submitbox { + border: thin solid black; + padding: 5px; + color: white; + background-color: #777777; + font-weight: bold; + font-size: 13px; +} + +/******************************* + [Settings] +********************************/ +table.uinfo { + border-collapse: collapse; + border: 1px solid black; + font-size: 13px; +} + +td.uinfo { + vertical-align: top; + border: 1px solid black; + padding: 5px; +} + +th.uinfo { + background: lightgreen; + vertical-align: top; + text-align: right; + border: 1px solid black; + padding: 5px; +} + +/******************************* + [Submission] +********************************/ +div.compilermsgbody { + font-family: monospace; +} + div.task-menu { text-align: center; font-size: 13px; diff --git a/public/stylesheets/problems.css b/public/stylesheets/problems.css new file mode 100644 --- /dev/null +++ b/public/stylesheets/problems.css @@ -0,0 +1,8 @@ + +tr.available { + background: #c0ffc0; +} + +tr.not-available { + background: #ffc0c0; +} |