Show More
Commit Description:
live editor using cloud9 ace for problem
Commit Description:
live editor using cloud9 ace for problem
References:
File last commit:
Show/Diff file:
Action:
app/views/problems/index.html.haml
| 47 lines
| 2.5 KiB
| text/x-haml
| HamlLexer
|
r559 | - content_for :head do | |||
= stylesheet_link_tag 'problems' | ||||
%h1 Listing problems | ||||
%p | ||||
= link_to 'New problem', new_problem_path, class: 'btn btn-default btn-sm' | ||||
= link_to 'Manage problems', { action: 'manage'}, class: 'btn btn-default btn-sm' | ||||
= link_to 'Import problems', {:action => 'import'}, class: 'btn btn-default btn-sm' | ||||
= link_to 'Turn off all problems', {:action => 'turn_all_off'}, class: 'btn btn-default btn-sm' | ||||
= link_to 'Turn on all problems', {:action => 'turn_all_on'}, class: 'btn btn-default btn-sm' | ||||
.submitbox | ||||
= form_tag :action => 'quick_create' do | ||||
%b Quick New: | ||||
%label{:for => "problem_name"} Name | ||||
= text_field 'problem', 'name' | ||||
| | ||||
%label{:for => "problem_full_name"} Full name | ||||
= text_field 'problem', 'full_name' | ||||
= submit_tag "Create" | ||||
r562 | %table.table.table-condense.table-hover | |||
r559 | %thead | |||
%th Name | ||||
%th Full name | ||||
%th Full score | ||||
%th Date added | ||||
%th Avail? | ||||
%th Test? | ||||
- if GraderConfiguration.multicontests? | ||||
%th Contests | ||||
- for problem in @problems | ||||
%tr{:class => "#{(problem.available) ? "success" : "danger"}", :id => "prob-#{problem.id}", :name => "prob-#{problem.id}"} | ||||
- @problem=problem | ||||
%td= in_place_editor_field :problem, :name, {}, :rows=>1 | ||||
%td= in_place_editor_field :problem, :full_name, {}, :rows=>1 | ||||
%td= in_place_editor_field :problem, :full_score, {}, :rows=>1 | ||||
%td= problem.date_added | ||||
r562 | %td= toggle_button(@problem.available?, url_for(controller: :problems, action: :toggle, id: @problem), "problem-avail-#{@problem.id}") | |||
//%td{}= link_to (@problem.available? ? "Yes" : "No"), url_for(controller: :problems, action: :toggle, id: @problem), { class: "btn btn-block btn-sm btn-#{(@problem.available? ? 'success' : 'default')} ajax-toggle", id: "problem-avail-#{@problem.id}", data: {remote: true, method: 'post' } } | ||||
r559 | %td= problem.test_allowed | |||
- if GraderConfiguration.multicontests? | ||||
%td | ||||
= problem.contests.collect { |c| c.name }.join(', ') | ||||
r562 | %td= link_to 'Stat', {:action => 'stat', :id => problem.id}, class: 'btn btn-info btn-xs btn-block' | |||
%td= link_to 'Show', {:action => 'show', :id => problem}, class: 'btn btn-info btn-xs btn-block' | ||||
%td= link_to 'Edit', {:action => 'edit', :id => problem}, class: 'btn btn-info btn-xs btn-block' | ||||
%td= link_to 'Destroy', { :action => 'destroy', :id => problem }, :confirm => 'Are you sure?', :method => :post, class: 'btn btn-danger btn-xs btn-block' | ||||
r559 | %br/ | |||
= link_to '[New problem]', :action => 'new' | ||||