Files
codeocean/app/views/error_templates/show.html.slim
Sebastian Serth 9a9efd5caa Lint Slim files and fix offenses
The fixing was partially done manually and partially automatically.
2024-04-18 08:31:24 +02:00

45 lines
2.1 KiB
Plaintext

h1
= @error_template
= render('shared/edit_button', object: @error_template)
= row(label: 'error_template.name', value: @error_template.name)
= row(label: 'exercise.execution_environment', value: link_to_if(policy(@error_template.execution_environment).show?, @error_template.execution_environment))
= row(label: 'error_template.signature') do
code = @error_template.signature
- %i[description hint].each do |attribute|
= row(label: "error_template.#{attribute}", value: @error_template.send(attribute))
h2.mt-4
= t 'error_templates.attributes'
.table-responsive
table.table class=(@error_template.error_template_attributes.present? ? 'sortable' : '')
thead
tr
th
th = t('activerecord.attributes.error_template_attribute.key')
th = t('activerecord.attributes.error_template_attribute.description')
th = t('activerecord.attributes.error_template_attribute.regex')
th colspan=3 = t('shared.actions')
tbody
- @error_template.error_template_attributes.order('important DESC', :key).each do |attribute|
tr
td
- if attribute.important
span.fa-solid.fa-star aria-hidden='true'
- else
span.fa-regular.fa-star aria-hidden='true'
td = link_to_if(policy(attribute).show?, attribute.key, attribute)
td = attribute.description
td
code = attribute.regex
td = link_to(t('shared.show'), attribute) if policy(attribute).show?
td = link_to(t('shared.edit'), edit_error_template_attribute_path(attribute)) if policy(attribute).edit?
td = link_to(t('shared.destroy'), attribute_error_template_url(error_template_attribute_id: attribute.id), method: :delete) if policy(attribute).destroy?
#add-attribute
= collection_select({}, :error_template_attribute_id,
ErrorTemplateAttribute.where.not(id: @error_template.error_template_attributes.select(:id).to_a).order('important DESC', :key),
:id, :key, {include_blank: false}, class: '')
button.btn.btn-outline-primary data-template-id=@error_template.id = t('error_templates.add_attribute')