|
|
<% content_for :head do %>
|
|
|
<%= stylesheet_link_tag 'scaffold' %>
|
|
|
<%= stylesheet_link_tag 'problems' %>
|
|
|
<%= javascript_include_tag :defaults %>
|
|
|
<% end %>
|
|
|
|
|
|
<h1>Listing problems</h1>
|
|
|
|
|
|
<p>
|
|
|
<%= link_to 'New problem', :action => 'new' %>
|
|
|
<%= link_to 'Turn off all problems', :action => 'turn_all_off' %>
|
|
|
<%= link_to 'Turn on all problems', :action => 'turn_all_on' %>
|
|
|
</p>
|
|
|
|
|
|
<table>
|
|
|
<tr>
|
|
|
<th>Name</th>
|
|
|
<th>Full name</th>
|
|
|
<th>Full score</th>
|
|
|
<th>Date added</th>
|
|
|
<th>Avail?</th>
|
|
|
<th>Test?</th>
|
|
|
</tr>
|
|
|
|
|
|
<% for problem in @problems %>
|
|
|
<tr class="<%= (problem.available) ? "available" : "not-available" %>">
|
|
|
<% @problem=problem %>
|
|
|
<td><%= in_place_editor_field :problem, :name, {}, :rows=>1 %></td>
|
|
|
<td><%= in_place_editor_field :problem, :full_name, {}, :rows=>1 %></td>
|
|
|
<td><%= in_place_editor_field :problem, :full_score, {}, :rows=>1 %></td>
|
|
|
<td><%= problem.date_added %></td>
|
|
|
<td><%= problem.available %></td>
|
|
|
<td><%= problem.test_allowed %></td>
|
|
|
|
|
|
<td><%= link_to '[Toggle]', :action => 'toggle_avail', :id => problem.id %></td>
|
|
|
<td><%= link_to '[Stat]', :action => 'stat', :id => problem.id %></td>
|
|
|
<td><%= link_to '[Show]', :action => 'show', :id => problem %></td>
|
|
|
<td><%= link_to '[Edit]', :action => 'edit', :id => problem %></td>
|
|
|
<td><%= link_to '[Destroy]', { :action => 'destroy', :id => problem }, :confirm => 'Are you sure?', :method => :post %></td>
|
|
|
</tr>
|
|
|
<% end %>
|
|
|
</table>
|
|
|
|
|
|
|
|
|
<br />
|
|
|
|
|
|
<%= link_to 'New problem', :action => 'new' %>
|
|
|
|