Skip to content

Commit f8e7a2e

Browse files
authored
Merge pull request #184 from UtrechtUniversity/feature/MSL-612_FrontendFixesForQ4Release
Feature/msl 612 frontend fixes for q4 release
2 parents 42274b6 + 75e308e commit f8e7a2e

File tree

7 files changed

+193
-226
lines changed

7 files changed

+193
-226
lines changed

app/Http/Controllers/FrontendController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ public function dataPublication($id)
624624
abort(404, 'ckan request failed');
625625
}
626626

627-
return view('frontend.data-publication-detail', ['data' => $result->getResult()]);
627+
return view('frontend.data-publication-detail', ['data' => $result->getResult(true)]);
628628
}
629629

630630
/**

app/Http/Controllers/HomeController.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
use App\CkanClient\Client;
66
use App\CkanClient\Request\OrganizationListRequest;
77
use App\CkanClient\Request\PackageSearchRequest;
8-
use App\Exports\MappingLogsExport;
98
use App\Exports\SurveyExport;
109
use App\Jobs\ProcessDatasetDelete;
1110
use App\Jobs\ProcessImport;
@@ -15,7 +14,6 @@
1514
use App\Models\DatasetDelete;
1615
use App\Models\Import;
1716
use App\Models\Importer;
18-
use App\Models\MappingLog;
1917
use App\Models\SourceDataset;
2018
use App\Models\SourceDatasetIdentifier;
2119
use App\Models\Surveys\Survey;

app/Models/Ckan/Contributor.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ public function getFullName(): string
3636
return $this->msl_contributor_given_name.' '.$this->msl_contributor_family_name;
3737
}
3838

39+
public function getAffilitationNames(): array
40+
{
41+
return array_column($this->affiliations, 'msl_creator_affiliation_name');
42+
}
43+
3944
public function addNameIdentifier(NameIdentifier $nameIdentifier): void
4045
{
4146
$this->nameIdentifiers[] = $nameIdentifier;

app/Models/Ckan/Creator.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ public function getFullName(): string
3333
return $this->msl_creator_given_name.' '.$this->msl_creator_family_name;
3434
}
3535

36+
public function getAffilitationNames(): array
37+
{
38+
return array_column($this->affiliations, 'msl_creator_affiliation_name');
39+
}
40+
3641
public function addNameIdentifier(NameIdentifier $nameIdentifier): void
3742
{
3843
$this->nameIdentifiers[] = $nameIdentifier;

resources/views/components/list-views/data-publication.blade.php

Lines changed: 34 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2,44 +2,39 @@
22
data = (array)
33
--}}
44

5-
<a class="self-center w-9/12 no-underline" href="{{ route('data-publication-detail', ['id' => $data['id']]) }}">
6-
7-
<div class="hover:bg-secondary-100 ">
8-
9-
10-
<div class="p-4">
11-
12-
@if (isset( $data['title']))
13-
<h4 class="text-left">{{ $data['title'] }}</h4>
14-
@endif
15-
16-
@if (isset($data['msl_authors']))
17-
<h5 class="text-left font-medium pt-4">
18-
@foreach ( $data['msl_authors'] as $authorKey => $author )
19-
{{ $author["msl_author_name"] }}
20-
{{-- a little divider between names --}}
21-
@if (sizeof($data['msl_authors']) -1 != $authorKey )
22-
|
23-
@endif
24-
@endforeach
25-
</h5>
26-
@endif
27-
28-
@if (isset($data['msl_publication_year']))
29-
<p>{{ $data['msl_publication_year'] }}</p>
30-
@endif
31-
32-
33-
@if (isset($data['notes']))
34-
{{-- https://laravel.com/docs/11.x/strings#method-str-limit --}}
35-
<p class="italic ">{{ Str::limit($data['notes'], 295, preserveWords: true) }}</p>
36-
@endif
37-
38-
39-
5+
<a class="self-center w-9/12 no-underline" href="{{ route('data-publication-detail', ['id' => $data->name]) }}">
6+
<div class="hover:bg-secondary-100 ">
7+
<div class="p-4">
8+
@if ($data->title != '')
9+
<h4 class="text-left">{{ $data->title }}</h4>
10+
@else
11+
<h4 class="text-left italic">- no title found -</h4>
12+
@endif
13+
14+
@if (sizeof($data->msl_creators) > 0)
15+
<h5 class="text-left font-medium pt-4">
16+
@foreach ( $data->msl_creators as $authorKey => $author )
17+
{{ $author->getFullName() }}
18+
@if (sizeof($data->msl_creators) -1 != $authorKey )
19+
|
20+
@endif
21+
@endforeach
22+
</h5>
23+
@else
24+
<h5 class="text-left font-medium pt-4">- no authors found -</h5>
25+
@endif
26+
27+
@if ($data->msl_publication_year != '')
28+
<p>{{ $data->msl_publication_year }}</p>
29+
@else
30+
<p>- no publication year found -</p>
31+
@endif
32+
33+
@if ($data->getMainDescription() != '')
34+
<p class="italic ">{{ Str::limit($data->getMainDescription(), 295, preserveWords: true) }}</p>
35+
@else
36+
<p class="italic ">- no description found -</p>
37+
@endif
38+
</div>
4039
</div>
41-
42-
43-
</div>
44-
4540
</a>

resources/views/frontend/data-access.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
<div class="listView">
3636

3737
{{-- loop list content --}}
38-
@foreach ($result->getResults() as $dataPublication)
38+
@foreach ($result->getResults(true) as $dataPublication)
3939

4040
@include('components.list-views.data-publication', [
4141
'data' => $dataPublication

0 commit comments

Comments
 (0)