Temporary fix for the keywords section when accessing from DOI
This commit is contained in:
parent
5dd8821667
commit
01e10d6f9d
|
@ -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,15 +183,21 @@
|
||||||
<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-for="(subject, index) in dataset.subjects" :key="subject.value">
|
<span v-if="accessNotFromDoi()">
|
||||||
<router-link
|
<span v-for="(subject, index) in dataset.subjects" :key="subject.value">
|
||||||
:to="{ name: 'Search', params: { display: subject.value, type: 'subjects' } }"
|
<router-link
|
||||||
class="link-label"
|
:to="{ name: 'Search', params: { display: subject.value, type: 'subjects' } }"
|
||||||
>
|
class="link-label"
|
||||||
{{ subject.value }}
|
>
|
||||||
</router-link>
|
{{ subject.value }}
|
||||||
<!-- Add a comma and space after each keyword except the last one -->
|
</router-link>
|
||||||
<span v-if="index < dataset.subjects.length - 1">, </span>
|
<!-- 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>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
<p v-else>-</p>
|
<p v-else>-</p>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user