- ersistent Identifier: ID mit Url bei technischen Metadaten

- Embargo-Datum in den Tab "Inhalt"
- Filegröße in den Tab "Inhalt"
- Publisher und Herausgeber in den Tab "Technische Metadaten"
- usätzliche Titel,  Referenzen
- OAI Link unten bei Hilfe
- composer updates
This commit is contained in:
Arno Kaimbacher 2020-03-11 17:21:27 +01:00
parent 9ab92b5fa0
commit 27464d08f7
5 changed files with 85 additions and 35 deletions

View File

@ -187,6 +187,10 @@ class Dataset extends Model
{ {
return $this->hasMany(Title::class, 'document_id', 'id'); return $this->hasMany(Title::class, 'document_id', 'id');
} }
public function additionalTitles()
{
return $this->hasMany(Title::class, 'document_id', 'id')->where('type', '!=', 'Main');
}
public function mainTitle() public function mainTitle()
{ {

View File

@ -23,7 +23,7 @@ class File extends Model
return $this->hasMany(HashValue::class, 'file_id', 'id'); return $this->hasMany(HashValue::class, 'file_id', 'id');
} }
/** /**
* Create hash value model objects from original file. * Create hash value model objects from original file.
* *
* TODO throws Exception in case hash computation is not possible * TODO throws Exception in case hash computation is not possible
@ -34,7 +34,7 @@ class File extends Model
public function createHashValues() public function createHashValues()
{ {
$hashtypes = array('md5', 'sha512'); $hashtypes = array('md5', 'sha512');
foreach ($hashtypes as $type) { foreach ($hashtypes as $type) {
$hash = new HashValue(); $hash = new HashValue();
$hash->type = $type; $hash->type = $type;
@ -44,7 +44,7 @@ class File extends Model
} }
} }
/** /**
* Get the hash value of the file * Get the hash value of the file
* *
* @param string $type Type of the hash value, @see hash_file(); * @param string $type Type of the hash value, @see hash_file();
@ -65,11 +65,21 @@ class File extends Model
private function getPath() private function getPath()
{ {
//return storage_path('app/public/' . $this->path_name); //return storage_path('app/public/' . $this->path_name);
return public_path('storage/' . $this->path_name); return public_path('storage/' . $this->path_name);
} }
public function exists() public function exists()
{ {
return \Illuminate\Support\Facades\File::exists(public_path('storage/' . $this->path_name)); return \Illuminate\Support\Facades\File::exists(public_path('storage/' . $this->path_name));
} }
public function formatSize($precision = 1)
{
$size = $this->file_size;
$unit = ['Byte', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB'];
for ($i = 0; $size >= 1024 && $i < count($unit) - 1; $i++) {
$size /= 1024;
}
return round($size, $precision) . ' ' . $unit[$i];
}
} }

26
composer.lock generated
View File

@ -496,26 +496,26 @@
}, },
{ {
"name": "felixkiss/uniquewith-validator", "name": "felixkiss/uniquewith-validator",
"version": "3.3.1", "version": "3.4.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/felixkiss/uniquewith-validator.git", "url": "https://github.com/felixkiss/uniquewith-validator.git",
"reference": "c9d088543f93d3ebca6c1cc40ba8cbd6d855d79c" "reference": "7ce4ff83c9003718e8febe1d4670eb869a720c5c"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/felixkiss/uniquewith-validator/zipball/c9d088543f93d3ebca6c1cc40ba8cbd6d855d79c", "url": "https://api.github.com/repos/felixkiss/uniquewith-validator/zipball/7ce4ff83c9003718e8febe1d4670eb869a720c5c",
"reference": "c9d088543f93d3ebca6c1cc40ba8cbd6d855d79c", "reference": "7ce4ff83c9003718e8febe1d4670eb869a720c5c",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"illuminate/support": "5.*|^6.0", "illuminate/support": "^5.5|^6.0|^7.0",
"illuminate/validation": "5.*|^6.0", "illuminate/validation": "^5.5|^6.0|^7.0",
"php": "^7.1.3" "php": "^7.1.3"
}, },
"require-dev": { "require-dev": {
"bossa/phpspec2-expect": "^3.0", "bossa/phpspec2-expect": "^3.0",
"phpspec/phpspec": "^5.0" "phpspec/phpspec": "^5.0|^6.0"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
@ -545,7 +545,7 @@
"keywords": [ "keywords": [
"laravel" "laravel"
], ],
"time": "2019-09-10T07:24:13+00:00" "time": "2020-03-10T21:45:55+00:00"
}, },
{ {
"name": "fideloper/proxy", "name": "fideloper/proxy",
@ -970,16 +970,16 @@
}, },
{ {
"name": "league/flysystem", "name": "league/flysystem",
"version": "1.0.64", "version": "1.0.65",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/thephpleague/flysystem.git", "url": "https://github.com/thephpleague/flysystem.git",
"reference": "d13c43dbd4b791f815215959105a008515d1a2e0" "reference": "8f17b3ba67097aafb8318cd5c553b1acf7c891c8"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/thephpleague/flysystem/zipball/d13c43dbd4b791f815215959105a008515d1a2e0", "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/8f17b3ba67097aafb8318cd5c553b1acf7c891c8",
"reference": "d13c43dbd4b791f815215959105a008515d1a2e0", "reference": "8f17b3ba67097aafb8318cd5c553b1acf7c891c8",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1050,7 +1050,7 @@
"sftp", "sftp",
"storage" "storage"
], ],
"time": "2020-02-05T18:14:17+00:00" "time": "2020-03-08T18:53:20+00:00"
}, },
{ {
"name": "mcamara/laravel-localization", "name": "mcamara/laravel-localization",

View File

@ -26,15 +26,15 @@
<!-- HTML markup for the tab navigation: --> <!-- HTML markup for the tab navigation: -->
<div class="twelve columns"> <div class="twelve columns">
<ul class="tab-nav"> <ul class="tab-nav">
<li class="metadata-link"> <li class="metadata-link">
<span class="remove-check button active" name="#one">Metadaten</span> <span class="remove-check button active" name="#one">Metadaten</span>
</li> </li>
<li class="file-link"> <li class="file-link">
<span class="remove-check button" name="#two">Inhalt</span> <span class="remove-check button" name="#two">Inhalt</span>
</li>
<li class="file-link">
<span class="remove-check button" name="#three">Technische Metadaten</span>
</li> </li>
<li class="file-link">
<span class="remove-check button" name="#three">Technische Metadaten</span>
</li>
</ul> </ul>
<!-- HTML markup for tab content: Tab panes --> <!-- HTML markup for tab content: Tab panes -->
@ -42,6 +42,18 @@
<div class="tab-pane content-metadata active" id="one"> <div class="tab-pane content-metadata active" id="one">
@if($dataset->additionalTitles()->exists())
<p class="dataset__abstract">
Zusätzliche Titel:
<ul>
@foreach ($dataset->additionalTitles as $title)
<li>{{ $title->type }}: {{ $title->value }}</li>
<br />
@endforeach
</ul>
</p>
@endif
<p class="dataset__abstract">{{ $dataset->mainAbstract()->value }}</p> <p class="dataset__abstract">{{ $dataset->mainAbstract()->value }}</p>
@if($dataset->authors()->exists()) @if($dataset->authors()->exists())
@ -62,23 +74,40 @@
</p> </p>
@endif @endif
@if($dataset->references()->exists())
<p class="dataset__abstract">
Referenzen:
<ul>
@foreach ($dataset->references as $reference)
<li>{{ $reference->value }}</li>
<br />
@endforeach
</ul>
</p>
@endif
<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">Lizenz: {{ $dataset->license()->name_long }}</p>
<p class="dataset__abstract">Herausgeber: {{ $dataset->creating_corporation }}</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>
<div class="tab-pane content-file" id="two"> <div class="tab-pane content-file" id="two">
@if($dataset->embargo_date != null)
<p class="dataset__abstract">Ende des Embargo-Zeitraums:
{{ $dataset->embargo_date->toDateString() }}</p>
@else
<p class="dataset__abstract">Ende des Embargo-Zeitraums: - </p>
@endif
@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>
<tr> <tr>
<th>Path Name</th> <th>Path Name</th>
<th>File Size</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -91,6 +120,9 @@
<span class="alert">missing file: {{ $file->path_name }}</span> <span class="alert">missing file: {{ $file->path_name }}</span>
@endif @endif
</td> </td>
<td>
<span>{{ $file->formatSize(2) }}</span>
</td>
</tr> </tr>
@endforeach @endforeach
</tbody> </tbody>
@ -101,14 +133,14 @@
</div> </div>
<div class="tab-pane content-technical-metadata" id="three"> <div class="tab-pane content-technical-metadata" id="three">
<p class="dataset__abstract">Persistenter Identifikator:
{{ "http://www.tethys.at/" . $dataset->id }}</p>
<p class="dataset__abstract">Status: {{ $dataset->server_state }}</p> <p class="dataset__abstract">Status: {{ $dataset->server_state }}</p>
<p class="dataset__abstract">Eingestellt von: {{ $dataset->user->login }}</p> <p class="dataset__abstract">Eingestellt von: {{ $dataset->user->login }}</p>
<p class="dataset__abstract">Erstellt am: {{ $dataset->created_at->toDateString() }}</p> <p class="dataset__abstract">Erstellt am: {{ $dataset->created_at->toDateString() }}</p>
@if($dataset->embargo_date != null) <p class="dataset__abstract">Herausgeber: {{ $dataset->creating_corporation }}</p>
<p class="dataset__abstract">Ende des Embargo-Zeitraums: {{ $dataset->embargo_date->toDateString() }}</p> <p class="dataset__abstract">Publisher: {{ $dataset->publisher_name }}</p>
@else
<p class="dataset__abstract">Ende des Embargo-Zeitraums: - </p>
@endif
</div> </div>
</div> </div>
@ -150,6 +182,9 @@
ul.tab-nav li span.active.button { ul.tab-nav li span.active.button {
border-bottom: 0.175em solid #fff; border-bottom: 0.175em solid #fff;
border-bottom-color: #00bfffcc;
color: #00bfffcc;
/* background-color: #6c6e6b; */
} }
.tab-content .tab-pane { .tab-content .tab-pane {
@ -260,8 +295,8 @@
@section('after-scripts') @section('after-scripts')
<script type="text/javascript" > <script type="text/javascript">
(function() { (function() {
function main() { function main() {
var tabButtons = [].slice.call(document.querySelectorAll('ul.tab-nav li span.button')); var tabButtons = [].slice.call(document.querySelectorAll('ul.tab-nav li span.button'));

View File

@ -129,7 +129,8 @@
<!-- <h5>&copy 2015 Tuts+ Web Design.</h5> --> <!-- <h5>&copy 2015 Tuts+ Web Design.</h5> -->
<div class="block"> <div class="block">
<h3 class="block-title">About TETHYS</h3> <h3 class="block-title">About TETHYS</h3>
<ul> <ul>
<li class="first"><a href="{{ URL::route('oai') }}" target="_blank"> OAI</a></li>
<li class="last"><a <li class="last"><a
href="{!! URL::route('frontend.pages.show', ['page_slug'=>'about']) !!}">About href="{!! URL::route('frontend.pages.show', ['page_slug'=>'about']) !!}">About
Us</a></li> Us</a></li>