- landing page -> detail page of dataset

Dataset.php and show.blade.php
This commit is contained in:
Arno Kaimbacher 2020-03-11 11:48:09 +01:00
parent 43748471dc
commit 6c54dae8f5
2 changed files with 150 additions and 51 deletions

View File

@ -227,6 +227,10 @@ class Dataset extends Model
{ {
return $this->belongsToMany(License::class, 'link_documents_licences', 'document_id', 'licence_id'); 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() public function files()
{ {

View File

@ -17,6 +17,31 @@
<p class="dataset__id">{{ $dataset->id }}</p> <p class="dataset__id">{{ $dataset->id }}</p>
</div> </div>
<div class="dataset"> <div class="dataset">
<!-- Nav tabs -->
{{-- <input type="radio" id="metadata-option" name="nav-tab" type="hidden">
<input type="radio" id="file-option" name="nav-tab" type="hidden"> --}}
<div class="row">
<!-- HTML markup for the tab navigation: -->
<div class="twelve columns">
<ul class="tab-nav">
<li class="metadata-link">
<a class="remove-check button active" href="#one">Metadaten</a>
</li>
<li class="file-link">
<a class="remove-check button" href="#two">Inhalt</a>
</li>
<li class="file-link">
<a class="remove-check button" href="#three">Technische Metadaten</a>
</li>
</ul>
<!-- HTML markup for tab content: Tab panes -->
<div class="tab-content">
<div class="tab-pane content-metadata active" id="one">
<p class="dataset__abstract">{{ $dataset->mainAbstract()->value }}</p> <p class="dataset__abstract">{{ $dataset->mainAbstract()->value }}</p>
@if($dataset->authors()->exists()) @if($dataset->authors()->exists())
@ -40,11 +65,15 @@
<p class="dataset__abstract">Erstellungsjahr: {{ $dataset->server_date_published->year }}</p> <p class="dataset__abstract">Erstellungsjahr: {{ $dataset->server_date_published->year }}</p>
<p class="dataset__abstract">Sprache: {{ $dataset->language }}</p> <p class="dataset__abstract">Sprache: {{ $dataset->language }}</p>
<p class="dataset__abstract">Objekttyp: {{ $dataset->type }}</p> <p class="dataset__abstract">Objekttyp: {{ $dataset->type }}</p>
<p class="dataset__abstract">Lizenz: {{ $dataset->license()->name_long }}</p>
<p class="dataset__abstract">Herausgeber: {{ $dataset->creating_corporation }}</p> <p class="dataset__abstract">Herausgeber: {{ $dataset->creating_corporation }}</p>
<p class="dataset__abstract">Publisher: {{ $dataset->publisher_name }}</p> <p class="dataset__abstract">Publisher: {{ $dataset->publisher_name }}</p>
<p class="dataset__abstract">Coverage: {{ $dataset->geoLocation() }}</p> <p class="dataset__abstract">Coverage: {{ $dataset->geoLocation() }}</p>
</div>
<div class="tab-pane content-file" id="two">
@if($dataset->hasEmbargoPassed() == true) @if($dataset->hasEmbargoPassed() == true)
<table id="items" class="pure-table pure-table-horizontal"> <table id="items" class="pure-table pure-table-horizontal">
<thead> <thead>
@ -69,9 +98,19 @@
@else @else
<span>Datensatz hat noch ein gültiges Embargo-Datum.</span> <span>Datensatz hat noch ein gültiges Embargo-Datum.</span>
@endif @endif
</div>
<div class="tab-pane content-technical-metadata" id="three">
<p class="dataset__abstract">Status: {{ $dataset->server_state }}</p>
</div>
</div> </div>
</div> </div>
</div> <!-- end row -->
</div>
</div>
</div> </div>
</main> </main>
@ -83,14 +122,48 @@
@stop @stop
@section('head') @section('head')
<style> <style>
ul.tab-nav {
list-style: none;
border-bottom: 1px solid #bbb;
padding-left: 5px;
}
ul.tab-nav li {
display: inline;
}
ul.tab-nav li a.button {
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
margin-bottom: -1px;
border-bottom: none;
}
ul.tab-nav li a.active.button {
border-bottom: 0.175em solid #fff;
}
.tab-content .tab-pane {
display: none;
/* visibility: hidden; */
}
.tab-content .tab-pane.active {
display: block;
/* visibility: visible; */
}
/* body { /* body {
margin: 0; margin: 0;
padding: 0; padding: 0;
} */ } */
#app { #app {
font-family: "Avenir", Helvetica, Arial, sans-serif; /* font-family: "Avenir", Helvetica, Arial, sans-serif; */
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
color: #2c3e50; color: #2c3e50;
@ -122,8 +195,8 @@
} }
.content { .content {
// flex: 1 1 80%; /* // flex: 1 1 80%;
// display: flex; // display: flex; */
align-items: center; align-items: center;
justify-content: center; justify-content: center;
@ -132,18 +205,18 @@
.box { .box {
margin: 0 auto; margin: 0 auto;
padding: 100px 20px 70px; padding: 100px 20px 70px;
// background-color: salmon; /* // background-color: salmon; */
} }
.dataset_heaader { .dataset_heaader {
// background-color: lightgray; /* // background-color: lightgray; */
position: relative; position: relative;
} }
.dataset { .dataset {
// max-width: 500px; /* // max-width: 500px; */
} }
.dataset__title { .dataset__title {
@ -180,5 +253,27 @@
@section('after-scripts') @section('after-scripts')
<script type="text/javascript" >
(function() {
function main() {
var tabButtons = [].slice.call(document.querySelectorAll('ul.tab-nav li a.button'));
tabButtons.map(function(button) {
button.addEventListener('click', function() {
document.querySelector('li a.active.button').classList.remove('active');
button.classList.add('active');
document.querySelector('.tab-pane.active').classList.remove('active');
document.querySelector(button.getAttribute('href')).classList.add('active');
})
})
}
if (document.readyState !== 'loading') {
main();
} else {
document.addEventListener('DOMContentLoaded', main);
}
})();
</script>
@stop @stop