From 6c54dae8f59cf52eca2214fabdddc11786b5568d Mon Sep 17 00:00:00 2001 From: Arno Kaimbacher Date: Wed, 11 Mar 2020 11:48:09 +0100 Subject: [PATCH] - landing page -> detail page of dataset Dataset.php and show.blade.php --- app/Models/Dataset.php | 4 + .../views/frontend/dataset/show.blade.php | 197 +++++++++++++----- 2 files changed, 150 insertions(+), 51 deletions(-) diff --git a/app/Models/Dataset.php b/app/Models/Dataset.php index 39057e3..63f13b1 100644 --- a/app/Models/Dataset.php +++ b/app/Models/Dataset.php @@ -227,6 +227,10 @@ class Dataset extends Model { return $this->belongsToMany(License::class, 'link_documents_licences', 'document_id', 'licence_id'); } + public function license() + { + return $this->belongsToMany(License::class, 'link_documents_licences', 'document_id', 'licence_id')->first(); + } public function files() { diff --git a/resources/views/frontend/dataset/show.blade.php b/resources/views/frontend/dataset/show.blade.php index 9c3a77d..ef45b40 100644 --- a/resources/views/frontend/dataset/show.blade.php +++ b/resources/views/frontend/dataset/show.blade.php @@ -17,60 +17,99 @@

{{ $dataset->id }}

-

{{ $dataset->mainAbstract()->value }}

- @if($dataset->authors()->exists()) -

- Ersteller/Autor: {{ $dataset->authors->implode('full_name', ', ') }} -

- @endif + + {{-- + --}} - @if($dataset->contributors()->exists()) -

- Beitragende: {{ $dataset->contributors->implode('full_name', ', ') }} -

- @endif +
+ +
+ - @if($dataset->subjects()->exists()) -

- Schlüsselwörter: {{ $dataset->subjects->implode('value', ', ') }} -

- @endif + +
-

Erstellungsjahr: {{ $dataset->server_date_published->year }}

-

Sprache: {{ $dataset->language }}

-

Objekttyp: {{ $dataset->type }}

+ + +
+ @if($dataset->hasEmbargoPassed() == true) + + + + + + + + @foreach($dataset->files as $key => $file) + + + + @endforeach + +
Path Name
+ @if($file->exists() === true) + {{ $file->label }} + @else + missing file: {{ $file->path_name }} + @endif +
+ @else + Datensatz hat noch ein gültiges Embargo-Datum. + @endif +
+ + + +
+
+
+ @@ -83,14 +122,48 @@ @stop @section('head') +