Temporary fix for the keywords section when accessing from DOI
This commit is contained in:
parent
5dd8821667
commit
7e6aa2da62
|
@ -1,9 +1,4 @@
|
|||
<template>
|
||||
<div class="container-fluid">
|
||||
<div class="development-notice">
|
||||
DEVELOPMENT SITE <br> >> Only for development purposes <<
|
||||
</div>
|
||||
</div>
|
||||
<!-- <HelloWorld msg="Welcome to Your Vue.js plus TypeScript App" /> -->
|
||||
<nav class="navbar navbar-light border-bottom" role="navigation" aria-label="main navigation">
|
||||
<div class="navbar-brand">
|
||||
|
|
|
@ -233,5 +233,17 @@ export default class DatasetDetailComponent extends Vue {
|
|||
return citation;
|
||||
}
|
||||
|
||||
accessNotFromDoi(): boolean {
|
||||
const host = window.location.host;
|
||||
const parts = host.split(".");
|
||||
if (parts[0] === "doi") {
|
||||
console.log("From DOI");
|
||||
// If in DOI subdomain, open external search in a new window
|
||||
return false;
|
||||
} else {
|
||||
console.log("Not From DOI");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -183,6 +183,7 @@
|
|||
<h3 class="label uppercase">Schlüsselwörter/Keywords</h3>
|
||||
<p v-if="dataset.hasOwnProperty('subjects')">
|
||||
<!-- Iterate through subjects and display them as router links -->
|
||||
<span v-if="accessNotFromDoi()">
|
||||
<span v-for="(subject, index) in dataset.subjects" :key="subject.value">
|
||||
<router-link
|
||||
:to="{ name: 'Search', params: { display: subject.value, type: 'subjects' } }"
|
||||
|
@ -193,6 +194,11 @@
|
|||
<!-- Add a comma and space after each keyword except the last one -->
|
||||
<span v-if="index < dataset.subjects.length - 1">, </span>
|
||||
</span>
|
||||
</span>
|
||||
|
||||
<span v-else>
|
||||
{{ dataset.subjects.map((u) => u.value).join(", ") }}
|
||||
</span>
|
||||
</p>
|
||||
<p v-else>-</p>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue
Block a user