Show More
Commit Description:
Update README.rdoc...
Commit Description:
Update README.rdoc Fix some typo about database name. add number to each step
File last commit:
Show/Diff file:
Action:
app/views/problems/manage.html.haml | 118 lines | 4.0 KiB | text/x-haml | HamlLexer |
jittat
added problem date_added bulk update...
r201 - content_for :head do
= stylesheet_link_tag 'problems'
add jquery to manage problem, now we can select a range of problem
r456 = javascript_include_tag 'local_jquery'
:javascript
$(document).ready( function() {
function shiftclick(start,stop,value) {
$('tr input').each( function(id,input) {
var $input=$(input);
var iid=parseInt($input.attr('id').split('-')[2]);
if(iid>=start&&iid<=stop){
$input.prop('checked',value)
}
});
}
$('tr input').click( function(e) {
if (e.shiftKey) {
stop = parseInt($(this).attr('id').split('-')[2]);
var orig_stop = stop
if (typeof start !== 'undefined') {
if (start > stop) {
var tmp = start;
start = stop;
stop = tmp;
}
shiftclick(start,stop,$(this).is(':checked') )
}
start = orig_stop
} else {
start = parseInt($(this).attr('id').split('-')[2]);
}
});
});
jittat
added problem date_added bulk update...
r201
%h1 Manage problems
make group_user and group_problem unique
r678 %p= link_to '[Back to problem list]', problems_path
jittat
added problem date_added bulk update...
r201
Jittat Fakcharoenphol
fixed form_tag/form_for, disabled attributes whitelist
r321 = form_tag :action=>'do_manage' do
make group_user and group_problem unique
r678 .panel.panel-primary
.panel-heading
Action
.panel-body
.submit-box
What do you want to do to the selected problem?
%br/
(You can shift-click to select a range of problems)
change datetime picker widget
r692 %ul.form-inline
make group_user and group_problem unique
r678 %li
add tags
r700 Change "Date added" to
change datetime picker widget
r692 .input-group.date
= text_field_tag :date_added, class: 'form-control'
%span.input-group-addon
%span.glyphicon.glyphicon-calendar
-# = select_date Date.current, :prefix => 'date_added'
make group_user and group_problem unique
r678 &nbsp;&nbsp;&nbsp;
change datetime picker widget
r692 = submit_tag 'Change', :name => 'change_date_added', class: 'btn btn-primary btn-sm'
make group_user and group_problem unique
r678 %li
add tags
r700 Set "Available" to
change datetime picker widget
r692 = submit_tag 'True', :name => 'enable_problem', class: 'btn btn-primary btn-sm'
= submit_tag 'False', :name => 'disable_problem', class: 'btn btn-primary btn-sm'
Jittat Fakcharoenphol
manages problems in contests
r279
make group_user and group_problem unique
r678 - if GraderConfiguration.multicontests?
%li
add tags
r700 Add selected problems to contest
make group_user and group_problem unique
r678 = select("contest","id",Contest.all.collect {|c| [c.title, c.id]})
change datetime picker widget
r692 = submit_tag 'Add', :name => 'add_to_contest', class: 'btn btn-primary btn-sm'
make group_user and group_problem unique
r678 %li
add tags
r700 Add selected problems to user group
make group_user and group_problem unique
r678 = select_tag "group_id", options_from_collection_for_select( Group.all, 'id','name',params[:group_name]), id: 'group_name',class: 'select2'
add tags
r700 = 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'
Jittat Fakcharoenphol
manages problems in contests
r279
add tags
r700 %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
jittat
added problem date_added bulk update...
r201
add tags
r700 %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
Jittat Fakcharoenphol
manages problems in contests
r279 %td
add tags
r700 - 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 }])"
change datetime picker widget
r692
:javascript
$('.input-group.date').datetimepicker({
format: 'DD/MMM/YYYY',
showTodayButton: true,
widgetPositioning: {horizontal: 'auto', vertical: 'bottom'},
});
add tags
r700 $('.datatable').DataTable({
paging: false
});