Merge branch 'misc'

This commit is contained in:
Sebastian Serth
2021-07-07 21:05:54 +02:00
5 changed files with 27 additions and 6 deletions

View File

@ -14,11 +14,11 @@ $(document).on('turbolinks:load', function() {
var alternative_input = parent.find('.alternative-input');
if (alternative_input.attr('disabled')) {
$(this).text($(event.target).data('text-toggled'));
$(this).text($(event.target).first().data('text_toggled'));
original_input.attr('disabled', true).hide();
alternative_input.attr('disabled', false).show();
} else {
$(this).text($(event.target).data('text-initial'));
$(this).text($(event.target).first().data('text_initial'));
alternative_input.attr('disabled', true).hide();
original_input.attr('disabled', false).show();
}

View File

@ -22,7 +22,10 @@ class ExecutionEnvironmentsController < ApplicationController
destroy_and_respond(object: @execution_environment)
end
def edit; end
def edit
# Add the current execution_environment if not already present in the list
@docker_images |= [@execution_environment.docker_image]
end
def execute_command
@docker_client = DockerClient.new(execution_environment: @execution_environment)

View File

@ -37,8 +37,11 @@ class SubmissionsController < ApplicationController
end
def command_substitutions(filename)
{class_name: File.basename(filename, File.extname(filename)).camelize, filename: filename,
module_name: File.basename(filename, File.extname(filename)).underscore}
{
class_name: File.basename(filename, File.extname(filename)).upcase_first,
filename: filename,
module_name: File.basename(filename, File.extname(filename)).underscore,
}
end
private :command_substitutions