Use file name with file path as identifier

This commit is contained in:
Sebastian Serth
2021-12-15 00:43:42 +01:00
parent d543ac76ae
commit 0c1a10959c
11 changed files with 18 additions and 27 deletions

View File

@ -1,3 +1,3 @@
# frozen_string_literal: true
json.extract! @file, :id, :name_with_extension
json.extract! @file, :id, :filepath

View File

@ -1,4 +1,4 @@
div class=(defined?(own_solution) ? "own-frame" : "frame") data-executable=file.file_type.executable? data-filename=file.name_with_extension data-renderable=file.file_type.renderable? data-role=file.role data-binary=file.file_type.binary? data-context-type=file.context_type data-read-only=file.read_only
div class=(defined?(own_solution) ? "own-frame" : "frame") data-executable=file.file_type.executable? data-filename=file.filepath data-renderable=file.file_type.renderable? data-role=file.role data-binary=file.file_type.binary? data-context-type=file.context_type data-read-only=file.read_only
- if file.file_type.binary?
.binary-file data-file-id=file.ancestor_id
- if file.file_type.renderable?

View File

@ -7,10 +7,7 @@ li.card.mt-2
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"
- if f.object.name.present? && f.object.file_type.present?
span = f.object.name_with_extension
- else
span = f.object.name
span = f.object.filepath
.card-collapse.collapse class=('in' if f.object.name.nil?) id="collapse#{f.index}" role="tabpanel"
.card-body
- if policy(f.object).destroy? && id.present?

View File

@ -65,9 +65,9 @@ h1
td.align-middle
-this.testruns.includes(:file).order("files.name").each do |run|
- if run.passed
.unit-test-result.positive-result title=[run.file&.name_with_extension, run.output].join("\n").strip
.unit-test-result.positive-result title=[run.file&.filepath, run.output].join("\n").strip
- else
.unit-test-result.unknown-result title=[run.file&.name_with_extension, run.output].join("\n").strip
.unit-test-result.unknown-result title=[run.file&.filepath, run.output].join("\n").strip
td = @working_times_until[index] if index > 0 if policy(@exercise).detailed_statistics?
- elsif this.is_a? UserExerciseIntervention
td = this.created_at.strftime("%F %T")

View File

@ -49,7 +49,7 @@ ul.list-unstyled#files
a.file-heading.collapsed data-toggle="collapse" data-parent="#files" href=".collapse#{file.id}"
div.clearfix role="button"
i class="fa" aria-hidden="true"
span = file.name_with_extension
span = file.filepath
.card-collapse.collapse class="collapse#{file.id}" role="tabpanel"
.card-body
- if policy(file).destroy?