diff --git a/app/views/problems/manage.html.haml b/app/views/problems/manage.html.haml
--- a/app/views/problems/manage.html.haml
+++ b/app/views/problems/manage.html.haml
@@ -49,7 +49,7 @@
(You can shift-click to select a range of problems)
%ul.form-inline
%li
- Change date added to
+ Change "Date added" to
.input-group.date
= text_field_tag :date_added, class: 'form-control'
%span.input-group-addon
@@ -58,44 +58,53 @@
= submit_tag 'Change', :name => 'change_date_added', class: 'btn btn-primary btn-sm'
%li
- Set available to
+ Set "Available" to
= submit_tag 'True', :name => 'enable_problem', class: 'btn btn-primary btn-sm'
= submit_tag 'False', :name => 'disable_problem', class: 'btn btn-primary btn-sm'
- if GraderConfiguration.multicontests?
%li
- Add to
+ Add selected problems to contest
= select("contest","id",Contest.all.collect {|c| [c.title, c.id]})
= submit_tag 'Add', :name => 'add_to_contest', class: 'btn btn-primary btn-sm'
%li
- Add problems to group
+ Add selected problems to user group
= select_tag "group_id", options_from_collection_for_select( Group.all, 'id','name',params[:group_name]), id: 'group_name',class: 'select2'
- = submit_tag 'Add', name: 'add_group', class: 'btn btn-default'
-
+ = submit_tag 'Add', name: 'add_group', class: 'btn btn-primary'
+ %li
+ Add the following tags to the selected problems
+ = select_tag "tag_ids", options_from_collection_for_select( Tag.all, 'id','name'), id: 'tags_name',class: 'select2', multiple: true, data: {placeholder: 'Select tags by clicking', width: "200px"}
+ = submit_tag 'Add', name: 'add_tags', class: 'btn btn-primary'
- %table.table.table-hover
- %tr{style: "text-align: left;"}
- %th= check_box_tag 'select_all'
- %th Name
- %th Full name
- %th Available
- %th Date added
- - if GraderConfiguration.multicontests?
- %th Contests
+ %table.table.table-hover.datatable
+ %thead
+ %tr{style: "text-align: left;"}
+ %th= check_box_tag 'select_all'
+ %th Name
+ %th Full name
+ %th Tags
+ %th Available
+ %th Date added
+ - if GraderConfiguration.multicontests?
+ %th Contests
- - num = 0
- - for problem in @problems
- - num += 1
- %tr{:id => "row-prob-#{problem.id}", :name=> "prob-#{problem.id}"}
- %td= check_box_tag "prob-#{problem.id}-#{num}"
- %td= problem.name
- %td= problem.full_name
- %td= problem.available
- %td= problem.date_added
- - if GraderConfiguration.multicontests?
+ %tbody
+ - num = 0
+ - for problem in @problems
+ - num += 1
+ %tr{:id => "row-prob-#{problem.id}", :name=> "prob-#{problem.id}"}
+ %td= check_box_tag "prob-#{problem.id}-#{num}"
+ %td= problem.name
+ %td= problem.full_name
%td
- - problem.contests.each do |contest|
- = "(#{contest.name} [#{link_to 'x', :action => 'remove_contest', :id => problem.id, :contest_id => contest.id }])"
+ - problem.tags.each do |t|
+ %span.label.label-default= t.name
+ %td= problem.available
+ %td= problem.date_added
+ - if GraderConfiguration.multicontests?
+ %td
+ - problem.contests.each do |contest|
+ = "(#{contest.name} [#{link_to 'x', :action => 'remove_contest', :id => problem.id, :contest_id => contest.id }])"
:javascript
$('.input-group.date').datetimepicker({
@@ -104,4 +113,6 @@
widgetPositioning: {horizontal: 'auto', vertical: 'bottom'},
});
-
+ $('.datatable').DataTable({
+ paging: false
+ });