Show More
Commit Description:
add jquery to manage problem, now we can select a range of problem
Commit Description:
add jquery to manage problem, now we can select a range of problem
References:
File last commit:
Show/Diff file:
Action:
app/views/problems/list.html.erb
| 66 lines
| 2.2 KiB
| text/plain
| TextLexer
|
|
r320 | <% content_for :head do %> | ||
<%= stylesheet_link_tag 'problems' %> | ||||
<% end %> | ||||
<h1>Listing problems</h1> | ||||
<p> | ||||
<%= link_to '[New problem]', :action => 'new' %> | ||||
<%= link_to '[Manage problems]', :action => 'manage' %> | ||||
<%= link_to '[Import problems]', :action => 'import' %> | ||||
<%= link_to '[Turn off all problems]', :action => 'turn_all_off' %> | ||||
<%= link_to '[Turn on all problems]', :action => 'turn_all_on' %> | ||||
</p> | ||||
<div class="submitbox"> | ||||
<%= form_tag :action => 'quick_create' do %> | ||||
<b>Quick New:</b> | ||||
<label for="problem_name">Name</label> | ||||
<%= text_field 'problem', 'name' %> | | ||||
<label for="problem_full_name">Full name</label> | ||||
<%= text_field 'problem', 'full_name' %> | ||||
<%= submit_tag "Create" %> | ||||
<% end %> | ||||
</div> | ||||
<table> | ||||
<tr> | ||||
<th>Name</th> | ||||
<th>Full name</th> | ||||
<th>Full score</th> | ||||
<th>Date added</th> | ||||
<th>Avail?</th> | ||||
<th>Test?</th> | ||||
<% if GraderConfiguration.multicontests? %> | ||||
<th>Contests</th> | ||||
<% end %> | ||||
</tr> | ||||
<% for problem in @problems %> | ||||
<tr id="prob-<%= problem.id %>" name="prob-<%= problem.id %>" 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 id="prob-<%= problem.id %>-avail"><%= problem.available %></td> | ||||
<td><%= problem.test_allowed %></td> | ||||
<% if GraderConfiguration.multicontests? %> | ||||
<td> | ||||
<%= problem.contests.collect { |c| c.name }.join(', ') %> | ||||
</td> | ||||
<% end %> | ||||
|
r322 | <td><%= link_to '[Toggle]', {:action => 'toggle', :id => problem.id }, :remote => true %></td> | ||
|
r320 | <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' %> | ||||