Skip to content

Commit

Permalink
fix: add citation banner to public samples wherever missing
Browse files Browse the repository at this point in the history
fixes  #1156
  • Loading branch information
NRayya committed Aug 1, 2024
1 parent 6077ac6 commit 73ae4aa
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/Http/Resources/StudyResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public function toArray($request)
'identifier' => $this->identifier,
'doi' => $this->doi,
'created_at' => $this->created_at,
'release_date' => $this->release_date,
'is_public' => $this->is_public,
'public_url' => $this->public_url ? $this->public_url : null,
'updated_at' => $this->updated_at,
Expand Down
18 changes: 18 additions & 0 deletions resources/js/Pages/Public/Project/Study.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,20 @@
<div
class="pb-10 mb-10 max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-6"
>
<div
class="-mx-4"
v-if="study.data.is_public && study.data.doi != null"
>
<Citation
:model="'sample'"
:doi="study.data.doi"
></Citation>
<ShowProjectDates
class="ml-5"
:release_date="study.data.release_date"
:created_at="study.data.created_at"
/>
</div>
<h1 class="mt-2 text-2xl font-bold break-words text-gray-900">
<div class="text-blue-500">
{{ study.data.name }}
Expand Down Expand Up @@ -446,6 +460,8 @@ import SpectraViewer from "@/Shared/SpectraViewer.vue";
import Depictor2D from "@/Shared/Depictor2D.vue";
import DOIBadge from "@/Shared/DOIBadge.vue";
import { Head } from "@inertiajs/vue3";
import Citation from "@/Shared/Citation.vue";
import ShowProjectDates from "@/Shared/ShowProjectDates.vue";
export default {
components: {
Expand All @@ -460,6 +476,8 @@ export default {
Depictor2D,
DOIBadge,
Head,
Citation,
ShowProjectDates,
},
props: ["project", "tab", "study"],
data() {
Expand Down
19 changes: 19 additions & 0 deletions resources/js/Pages/Public/Sample/Show.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@
<div
class="pb-10 mb-10 max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-6"
>
<div
class="-mx-4"
v-if="study.data.is_public && study.data.doi != null"
>
<Citation
:model="'sample'"
:doi="study.data.doi"
></Citation>
<ShowProjectDates
class="ml-5"
:release_date="study.data.release_date"
:created_at="study.data.created_at"
/>
</div>

<div class="border-b border-gray-200 pb-5">
<div class="sm:flex sm:items-baseline sm:justify-between">
<div class="sm:w-0 sm:flex-1">
Expand Down Expand Up @@ -498,6 +513,8 @@ import SpectraViewer from "@/Shared/SpectraViewer.vue";
import Depictor2D from "@/Shared/Depictor2D.vue";
import DOIBadge from "@/Shared/DOIBadge.vue";
import { Head } from "@inertiajs/vue3";
import Citation from "@/Shared/Citation.vue";
import ShowProjectDates from "@/Shared/ShowProjectDates.vue";
export default {
components: {
Expand All @@ -512,6 +529,8 @@ export default {
Depictor2D,
DOIBadge,
Head,
Citation,
ShowProjectDates,
},
props: ["project", "tab", "study"],
data() {
Expand Down

0 comments on commit 73ae4aa

Please sign in to comment.