Mache Medien, Übungen und Kurse in der Verwaltung bearbeitbar.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
4f2e5a5f3b
commit
3ee9f529ca
33 files changed
+1105
-284
No files matched your search
@@ -84,6 +84,7 @@ public function show(Request $request, LicenseArticle $article): View
|
||||
'release' => $release,
|
||||
'entries' => $entries,
|
||||
'title' => app(CourseOutline::class)->title($article),
|
||||
'kind' => app(CourseOutline::class)->kindLabel($article),
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Http;
|
||||
|
||||
use App\Domain\Catalog\CompositionKind;
|
||||
use App\Domain\Catalog\LicenseArticle;
|
||||
|
||||
class CourseOutline
|
||||
@@ -24,4 +25,18 @@ public function title(LicenseArticle $article): string
|
||||
?? $release->classification_note
|
||||
?? $article->code;
|
||||
}
|
||||
|
||||
public function kindLabel(LicenseArticle $article): ?string
|
||||
{
|
||||
$release = $article->currentRelease;
|
||||
|
||||
if ($release === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$release->loadMissing('rootCompositionVersion.composition');
|
||||
$kind = $release->rootCompositionVersion?->composition?->kind;
|
||||
|
||||
return $kind instanceof CompositionKind ? $kind->label() : null;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user