forked from autolab/Autolab
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Lint views/autograders, fix help-block gap from input (autolab#1963)
* lint views/autograders, fix help block gap from input * update form path
- Loading branch information
1 parent
f96e759
commit f978e88
Showing
1 changed file
with
36 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,47 @@ | ||
<% content_for :javascripts do %> | ||
<script> | ||
$(function() { | ||
$(document).on('change', ':file', function() { | ||
var input = $(this), | ||
numFiles = input.get(0).files ? input.get(0).files.length : 1, | ||
label = input.val().replace(/\\/g, '/').replace(/.*\//, ''); | ||
input.trigger('fileselect', [numFiles, label]); | ||
}); | ||
<script> | ||
$(function() { | ||
$(document).on('change', ':file', function() { | ||
var input = $(this), | ||
numFiles = input.get(0).files ? input.get(0).files.length : 1, | ||
label = input.val().replace(/\\/g, '/').replace(/.*\//, ''); | ||
input.trigger('fileselect', [numFiles, label]); | ||
}); | ||
|
||
$(document).ready( function() { | ||
$('#autograder_makefile:file').on('fileselect', function(event, numFiles, label) { | ||
$('#makefile_name').val(label); | ||
}); | ||
$('#autograder_tar:file').on('fileselect', function(event, numFiles, label) { | ||
$('#tar_name').val(label); | ||
}); | ||
}); | ||
}); | ||
</script> | ||
$(document).ready( function() { | ||
$('#autograder_makefile:file').on('fileselect', function(event, numFiles, label) { | ||
$('#makefile_name').val(label); | ||
}); | ||
$('#autograder_tar:file').on('fileselect', function(event, numFiles, label) { | ||
$('#tar_name').val(label); | ||
}); | ||
}); | ||
}); | ||
</script> | ||
<% end %> | ||
|
||
<%= form_for [@course, @assessment, @autograder], | ||
builder: FormBuilderWithDateTimeInput, | ||
html: { multipart: true } do |f| %> | ||
<%= form_for @autograder, url: course_assessment_autograder_path(@course, @assessment, @autograder), | ||
builder: FormBuilderWithDateTimeInput, | ||
html: { multipart: true } do |f| %> | ||
<%= f.error_messages %> | ||
<%= f.text_field :autograde_image, display_name: "VM Image", | ||
help_text: "VM image for autograding (e.g. <kbd>rhel.img</kbd>). #{link_to 'Click here', tango_status_course_jobs_path} to view the list of VM images and pools currently being used.".html_safe %> | ||
|
||
<%= f.text_field :autograde_image, display_name: "VM Image" %> | ||
<p class="help-block"> | ||
VM image for autograding (e.g., "<kbd>rhel.img</kbd>"). <%= link_to "Click here", tango_status_course_jobs_path %> to view the list of VM images and pools currently being used. | ||
</p> | ||
<%= f.text_field :autograde_timeout, display_name: "Timeout", | ||
help_text: "Timeout for autograding jobs (secs)" %> | ||
<%= f.check_box :release_score, display_name: "Release Scores?", | ||
help_text: "Check to release autograded scores to students immediately after autograding (strongly recommended)." %> | ||
help_text: "Timeout for autograding jobs (secs)" %> | ||
<%= f.check_box :release_score, | ||
display_name: "Release Scores?", | ||
help_text: "Check to release autograded scores to students immediately after autograding (strongly recommended)." %> | ||
|
||
<%= f.file_field :makefile, label_text: "Autograder Makefile", action: :upload %> | ||
<%= f.file_field :tar, label_text: "Autograder Tar", action: :upload %> | ||
<p class="help-block"> | ||
Both of the above files will be renamed upon upload. | ||
</p> | ||
<%= f.file_field :makefile, label_text: "Autograder Makefile", action: :upload %> | ||
<%= f.file_field :tar, label_text: "Autograder Tar", action: :upload %> | ||
<p class="help-block"> | ||
Both of the above files will be renamed upon upload. | ||
</p> | ||
|
||
<%= f.submit "Save Settings" %> | ||
|
||
<%= link_to "Delete Autograder", [@course, @assessment, :autograder], method: :delete, class: "btn danger", | ||
data: {confirm: "Are you sure you want to delete the Autograder for this assesssment?"} %> | ||
|
||
<%= link_to "Delete Autograder", course_assessment_autograder_path(@course, @assessment), | ||
method: :delete, class: "btn danger", | ||
data: { confirm: "Are you sure you want to delete the Autograder for this assesssment?" } %> | ||
<% end %> |