Skip to content

Commit

Permalink
Lint views/autograders, fix help-block gap from input (#1963)
Browse files Browse the repository at this point in the history
* lint views/autograders, fix help block gap from input

* update form path
  • Loading branch information
20wildmanj authored Oct 6, 2023
1 parent f96e759 commit f978e88
Showing 1 changed file with 36 additions and 36 deletions.
72 changes: 36 additions & 36 deletions app/views/autograders/_form.html.erb
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 %>

0 comments on commit f978e88

Please sign in to comment.