Temporary fix for the keywords section when accessing from DOI
This commit is contained in:
parent
5dd8821667
commit
7e6aa2da62
|
@ -1,9 +1,4 @@
|
||||||
<template>
|
<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" /> -->
|
<!-- <HelloWorld msg="Welcome to Your Vue.js plus TypeScript App" /> -->
|
||||||
<nav class="navbar navbar-light border-bottom" role="navigation" aria-label="main navigation">
|
<nav class="navbar navbar-light border-bottom" role="navigation" aria-label="main navigation">
|
||||||
<div class="navbar-brand">
|
<div class="navbar-brand">
|
||||||
|
|
|
@ -233,5 +233,17 @@ export default class DatasetDetailComponent extends Vue {
|
||||||
return citation;
|
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>
|
<h3 class="label uppercase">Schlüsselwörter/Keywords</h3>
|
||||||
<p v-if="dataset.hasOwnProperty('subjects')">
|
<p v-if="dataset.hasOwnProperty('subjects')">
|
||||||
<!-- Iterate through subjects and display them as router links -->
|
<!-- Iterate through subjects and display them as router links -->
|
||||||
|
<span v-if="accessNotFromDoi()">
|
||||||
<span v-for="(subject, index) in dataset.subjects" :key="subject.value">
|
<span v-for="(subject, index) in dataset.subjects" :key="subject.value">
|
||||||
<router-link
|
<router-link
|
||||||
:to="{ name: 'Search', params: { display: subject.value, type: 'subjects' } }"
|
: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 -->
|
<!-- Add a comma and space after each keyword except the last one -->
|
||||||
<span v-if="index < dataset.subjects.length - 1">, </span>
|
<span v-if="index < dataset.subjects.length - 1">, </span>
|
||||||
</span>
|
</span>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<span v-else>
|
||||||
|
{{ dataset.subjects.map((u) => u.value).join(", ") }}
|
||||||
|
</span>
|
||||||
</p>
|
</p>
|
||||||
<p v-else>-</p>
|
<p v-else>-</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user