Commit 09fb7352 authored by Axel Dürkop's avatar Axel Dürkop
Browse files

Add click on collection opens Zotero in new tab

parent b9bc0e4a
......@@ -128,6 +128,10 @@ svg.motivation-logo {
color: #fff;
}
.collection-header a {
color: #fff;
}
.collection-key {
color: #555;
font-size: 16px;
......
<template>
<div class="mt-3">
<h4 class="collection-header">{{ title }} <span class="collection-key">&nbsp;{{ collectionKey }}</span></h4>
<h4 class="collection-header"><a target="_blank" :href="collectionURL">{{ title }}</a> <span class="collection-key">&nbsp;{{ collectionKey }}</span></h4>
<Item v-for="item in items" :key="item.index" :item="item" />
</div>
</template>
......@@ -11,7 +11,7 @@ import { mapActions, mapGetters } from "vuex";
export default {
name: "Collection",
props: ["title", "collectionKey"],
props: ["title", "collectionKey", "groupURL"],
components: {
Item
},
......@@ -24,7 +24,10 @@ export default {
...mapActions(["fetch_single_collection", "map_items"])
},
computed: {
...mapGetters(["zotero_items", "collections", "meta_data"])
...mapGetters(["zotero_items", "collections", "meta_data"]),
collectionURL: function() {
return `${this.groupURL}/items/collectionKey/${this.collectionKey}`
}
},
created() {
// This method get a collection key from the parent
......
......@@ -8,13 +8,13 @@
<!-- Multiple collections -->
<div v-if="list_collections && !get_init">
<div v-for="collection in collections" :key="collection.index">
<Collection :title="collection.name" :collectionKey="collection.key" />
<Collection :title="collection.name" :collectionKey="collection.key" :groupURL="meta_data.groupURL"/>
</div>
</div>
<!-- Single collection -->
<div v-if="list_collections && collectionKey != null && !get_init">
<Collection :title="collectionKey" :collectionKey="collectionKey" />
<Collection :title="collectionKey" :collectionKey="collectionKey" :groupURL="meta_data.groupURL"/>
</div>
<!-- Complete library -->
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment