Newer
Older
<template>
<div class="col q-gutter-md">
<q-list dense>
<q-item>
<q-item-section side>
<q-item-label caption>
Uploaded by
</q-item-label>
<q-item-section avatar>
<div class="text-center">
<router-link :to="`/users/${project.owner.uid}`">
<q-img
basic
:src="project.owner.avatarURL"
/>
<br>
<div class="text-caption">
{{ project.owner.name }}
</div>
</div>
</q-item-section>
</q-item>
</q-list>
<q-list>
<q-item
clickable
@click="showDocumentation"
>
<q-icon
name="book"
color="teal-3"
/>
<q-item-label class="text-teal-6 text-weight-bold">
Documentation
</q-item-label>
<q-item
clickable
@click="showDownloads"
>
<q-icon
name="save"
color="teal-3"
/>
</q-item-section>
<q-item-section class="text-teal-6 text-weight-bold">
Download files
<q-item
clickable
@click="handleAddBookmark"
>
<q-item-section side>
<q-icon
name="bookmark"
color="teal-3"
/>
</q-item-section>
<q-item-section class="text-teal-6 text-weight-bold">
Add to collection
</q-item-section>
</q-item>
</q-list>
<q-list>
<q-item>
<q-item-section side>
<q-item-label caption>
Category
</q-item-label>
</q-item-section>
</q-item>
<q-item>
<q-item-section side>
<q-item-label caption>
Created
</q-item-label>
<q-item-label>{{ formatted_date }}</q-item-label>
<q-item v-if="project.tags && project.tags.length > 0">
<q-item-section side>
<q-item-label caption>
Tags
</q-item-label>
<q-item v-if="project.tags && project.tags.length > 0">
<q-chip
dense
v-for="tag,idx in project.tags"
:key="tag"
:label="tag"
/>
<q-card
flat
class="text-center"
>
<q-icon
size="64px"
name="star"
color="grey-3"
/>
<div class="text-center text-caption">
Stars
</div>
<div class="text-center text-h6 text-grey text-weight-bold">
0
</div>
<q-card
flat
class="text-center"
>
<q-icon
size="64px"
name="save"
color="grey-3"
/>
<div class="text-center text-caption">
Downloads
</div>
<div class="text-center text-h6 text-grey text-weight-bold">
{{ project.downloadsCount || 0 }}
</div>
<SelectCollectionDialog :show="showSelectCollectionDialog" />
import SelectCollectionDialog from 'src/components/collection/SelectCollectionDialog';
components: { SelectCollectionDialog },
return { showSelectCollectionDialog: false };
showDownloads () { },
handleAddBookmark (key) {
this.showSelectCollectionDialog = true;
},
saveBookmark (collection, project) {
this.addBookmark(null, null).then(() => {
this.$q.notify('Bookmark added')
}).catch((e) => {
console.log(e)
this.$q.notify('Some error occurred, please try again later')
})
}
category_label () {
if (!this.project) return '';
console.log(this.project.category);
const cat = this.getCategory(this.project.category);
formatted_date () {
if (!this.project) return '';
const createdDate = this.project.created.toDate();
console.log(createdDate);
return this.$niceTime(createdDate);
...mapGetters({ getCategory: 'categories/categoryByName' })