Fix adding files to exercises (as admin)
Prevent hidden selection field from being removed after cloning the dummy. Also ensure the caret looks nice and add the file extension if possible
This commit is contained in:
@ -66,7 +66,6 @@ $(document).on('turbolinks:load', function() {
|
||||
$('#files').append(html);
|
||||
$('#files li:last select[name*="file_type_id"]').val(getSelectedExecutionEnvironment().file_type_id);
|
||||
$('#files li:last select').chosen(window.CodeOcean.CHOSEN_OPTIONS);
|
||||
$('#files li:last select').remove();
|
||||
$('#files li:last>div:last').removeClass('in').addClass('show')
|
||||
$('body, html').scrollTo('#add-file');
|
||||
|
||||
|
@ -2,13 +2,18 @@
|
||||
|
||||
li.card.mt-2
|
||||
.card-header role="tab" id="heading"
|
||||
a.file-heading.collapsed data-toggle="collapse" href="#collapse#{id}"
|
||||
- collapsed_class = f.index != 'index' ? 'collapsed' : nil
|
||||
- aria_expanded = f.index != 'index' ? 'false' : 'true'
|
||||
a class=['file-heading', collapsed_class] data-toggle="collapse" href="#collapse#{f.index}" aria-expanded="#{aria_expanded}"
|
||||
div.clearfix role="button"
|
||||
i class="fa" aria-hidden="true"
|
||||
span = f.object.name
|
||||
.card-collapse.collapse class=('in' if f.object.name.nil?) id="collapse#{id}" role="tabpanel"
|
||||
- if f.object.name.present? && f.object.file_type.present?
|
||||
span = f.object.name_with_extension
|
||||
- else
|
||||
span = f.object.name
|
||||
.card-collapse.collapse class=('in' if f.object.name.nil?) id="collapse#{f.index}" role="tabpanel"
|
||||
.card-body
|
||||
- if policy(f.object).destroy?
|
||||
- if policy(f.object).destroy? && id.present?
|
||||
.clearfix
|
||||
.btn.btn-warning.btn-sm.float-right.delete-file data-file-url=code_ocean_file_path(id) = t('shared.destroy')
|
||||
.form-group
|
||||
|
Reference in New Issue
Block a user