- content_for :head do
  // Force a full page reload, see https://github.com/turbolinks/turbolinks/issues/326.
     Otherwise, code might not be highlighted correctly (race condition)
  meta name='turbolinks-visit-control' content='reload'
  = javascript_pack_tag('highlight', 'data-turbolinks-track': true)
  = stylesheet_pack_tag('highlight', media: 'all', 'data-turbolinks-track': true)

h1 = @submission

= row(label: 'submission.exercise', value: link_to_if(policy(@submission.exercise).show?, @submission.exercise, @submission.exercise))
= row(label: 'submission.user', value: link_to_if(policy(@submission.user).show?, @submission.user, @submission.user))
= row(label: 'submission.study_group', value: link_to_if(policy(@submission.study_group).show?, @submission.study_group, @submission.study_group))
= row(label: 'submission.cause', value: t("submissions.causes.#{@submission.cause}"))
= row(label: 'submission.score', value: @submission.score)

h2.mt-4 = t('activerecord.attributes.submission.files')

ul.list-unstyled
  - @files.each do |file|
    li.card.mt-2
      .card-body = render('shared/file', file: file)

- content_for :head do
  // Force a full page reload, see https://github.com/turbolinks/turbolinks/issues/326.
     Otherwise, code might not be highlighted correctly (race condition)
  meta name='turbolinks-visit-control' content='reload'
  = javascript_pack_tag('highlight', 'data-turbolinks-track': true)
  = stylesheet_pack_tag('highlight', media: 'all', 'data-turbolinks-track': true)

h1 = @submission

= row(label: 'submission.exercise', value: link_to_if(policy(@submission.exercise).show?, @submission.exercise, @submission.exercise))
= row(label: 'submission.user', value: link_to_if(policy(@submission.user).show?, @submission.user, @submission.user))
= row(label: 'submission.study_group', value: link_to_if(@submission.study_group.present? && policy(@submission.study_group).show?, @submission.study_group, @submission.study_group))
= row(label: 'submission.cause', value: t("submissions.causes.#{@submission.cause}"))
= row(label: 'submission.score', value: @submission.score)

h2.mt-4 = t('activerecord.attributes.submission.files')

ul.list-unstyled
  - @files.each do |file|
    li.card.mt-2
      .card-body = render('shared/file', file: file)

Check for study group before checking permission
Check for study group before checking permission

openHPI/codeocean,openHPI/codeocean,openHPI/codeocean,openHPI/codeocean,openHPI/codeocean,openHPI/codeocean