diff --git a/app/views/problems/index.html.haml b/app/views/problems/index.html.haml --- a/app/views/problems/index.html.haml +++ b/app/views/problems/index.html.haml @@ -1,10 +1,10 @@ - content_for :head do = stylesheet_link_tag 'problems' -%h1 Listing problems +%h1 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 'Import problems', {:action => 'import'}, class: 'btn btn-success btn-sm' + = link_to 'New problem', new_problem_path, class: 'btn btn-success btn-sm' + = link_to 'Bulk Manage', { action: 'manage'}, class: 'btn btn-info 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 @@ -21,11 +21,18 @@ %th Name %th Full name %th.text-right Full score + %th Tags + %th + Submit + %sup{class: 'text-primary',data: {toggle: 'tooltip'}, title: 'Admin can always submit to any problem' } [?] %th Date added %th.text-center Avail? %sup{class: 'text-primary',data: {toggle: 'tooltip'}, title: 'Let user submits to this problem?' } [?] %th.text-center + View Data? + %sup{class: 'text-primary',data: {toggle: 'tooltip'}, title: 'Let user view the testcase of this problem?' } [?] + %th.text-center Test? %sup{class: 'text-primary',data: {toggle: 'tooltip'}, title: 'Let user uses test interface on this problem?' } [?] - if GraderConfiguration.multicontests? @@ -33,18 +40,26 @@ - 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.text-right= in_place_editor_field :problem, :full_score, {}, :rows=>1 + %td= problem.name #in_place_editor_field :problem, :name, {}, :rows=>1 + %td + = problem.full_name #in_place_editor_field :problem, :full_name, {}, :rows=>1 + = link_to_description_if_any "[#{t 'main.problem_desc'}] ".html_safe, problem + %td.text-right= problem.full_score #in_place_editor_field :problem, :full_score, {}, :rows=>1 + %td + - problem.tags.each do |t| + - #%button.btn.btn-default.btn-xs= t.name + %span.label.label-default= t.name + %td= link_to "Submit", direct_edit_problem_submissions_path(problem,@current_user.id), class: 'btn btn-xs btn-primary' %td= problem.date_added - %td= toggle_button(@problem.available?, toggle_problem_url(@problem), "problem-avail-#{@problem.id}") - %td= toggle_button(@problem.test_allowed?, toggle_test_problem_url(@problem), "problem-test-#{@problem.id}") + %td= toggle_button(@problem.available?, toggle_problem_path(@problem), "problem-avail-#{@problem.id}") + %td= toggle_button(@problem.view_testcase?, toggle_view_testcase_problem_path(@problem), "problem-view-testcase-#{@problem.id}") + %td= toggle_button(@problem.test_allowed?, toggle_test_problem_path(@problem), "problem-test-#{@problem.id}") - if GraderConfiguration.multicontests? %td = problem.contests.collect { |c| c.name }.join(', ') %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' + %td= link_to 'Destroy', { :action => 'destroy', :id => problem }, :confirm => 'Are you sure?', :method => :delete, class: 'btn btn-danger btn-xs btn-block' %br/ = link_to '[New problem]', :action => 'new'