diff options
| author | Zephyrrus <[email protected]> | 2020-11-12 22:58:34 +0200 |
|---|---|---|
| committer | Zephyrrus <[email protected]> | 2020-11-12 22:58:34 +0200 |
| commit | 4a3fef2b9931266d40c1d9e88748fd2aa623dc79 (patch) | |
| tree | d6212b2062fbc991b818734bd6acfc59c8d79767 /src/site/components/grid/Grid.vue | |
| parent | Merge pull request #3 from Zephyrrus/feature/custom_album_urls (diff) | |
| download | host.fuwn.me-4a3fef2b9931266d40c1d9e88748fd2aa623dc79.tar.xz host.fuwn.me-4a3fef2b9931266d40c1d9e88748fd2aa623dc79.zip | |
chore: update buefy to 0.9
Diffstat (limited to 'src/site/components/grid/Grid.vue')
| -rw-r--r-- | src/site/components/grid/Grid.vue | 77 |
1 files changed, 37 insertions, 40 deletions
diff --git a/src/site/components/grid/Grid.vue b/src/site/components/grid/Grid.vue index 7170709..1fa3167 100644 --- a/src/site/components/grid/Grid.vue +++ b/src/site/components/grid/Grid.vue @@ -92,48 +92,45 @@ </template> <div v-else> <b-table :data="gridFiles || []" :mobile-cards="true"> - <template slot-scope="props"> - <template v-if="!props.row.hideFromList"> - <b-table-column field="url" label="URL"> - <a :href="props.row.url" target="_blank">{{ props.row.url }}</a> - </b-table-column> - - <b-table-column field="albums" label="Albums" centered> - <template v-for="(album, index) in props.row.albums"> - <nuxt-link :key="index" :to="`/dashboard/albums/${album.id}`"> - {{ album.name }} - </nuxt-link> - <template v-if="index < props.row.albums.length - 1"> - , - </template> - </template> + <b-table-column v-slot="props" field="url" label="URL"> + <a :href="props.row.url" target="_blank">{{ props.row.url }}</a> + </b-table-column> + + <b-table-column v-slot="props" field="albums" label="Albums" centered> + <template v-for="(album, index) in props.row.albums"> + <nuxt-link :key="index" :to="`/dashboard/albums/${album.id}`"> + {{ album.name }} + </nuxt-link> + <template v-if="index < props.row.albums.length - 1"> + , + </template> + </template> - {{ props.row.username }} - </b-table-column> + {{ props.row.username }} + </b-table-column> - <b-table-column field="uploaded" label="Uploaded" centered> - <span><timeago :since="props.row.createdAt" /></span> - </b-table-column> + <b-table-column v-slot="props" field="uploaded" label="Uploaded" centered> + <span><timeago :since="props.row.createdAt" /></span> + </b-table-column> + + <b-table-column v-slot="props" field="purge" centered> + <b-tooltip label="Edit" position="is-top"> + <a class="btn" @click="handleFileModal(props.row)"> + <i class="mdi mdi-pencil" /> + </a> + </b-tooltip> + <b-tooltip label="Delete" position="is-top" class="is-danger"> + <a class="is-danger" @click="deleteFile(props.row)"> + <i class="mdi mdi-delete" /> + </a> + </b-tooltip> + <b-tooltip v-if="user && user.isAdmin" label="More info" position="is-top" class="more"> + <nuxt-link :to="`/dashboard/admin/file/${props.row.id}`"> + <i class="mdi mdi-dots-horizontal" /> + </nuxt-link> + </b-tooltip> + </b-table-column> - <b-table-column field="purge" centered> - <b-tooltip label="Edit" position="is-top"> - <a class="btn" @click="handleFileModal(props.row)"> - <i class="mdi mdi-pencil" /> - </a> - </b-tooltip> - <b-tooltip label="Delete" position="is-top" class="is-danger"> - <a class="is-danger" @click="deleteFile(props.row)"> - <i class="mdi mdi-delete" /> - </a> - </b-tooltip> - <b-tooltip v-if="user && user.isAdmin" label="More info" position="is-top" class="more"> - <nuxt-link :to="`/dashboard/admin/file/${props.row.id}`"> - <i class="mdi mdi-dots-horizontal" /> - </nuxt-link> - </b-tooltip> - </b-table-column> - </template> - </template> <template slot="empty"> <div class="has-text-centered"> <i class="icon-misc-mood-sad" /> @@ -226,7 +223,7 @@ export default { return require('@/assets/images/blank.png'); }, gridFiles() { - return this.files; + return (this.files || []).filter((v) => !v.hideFromList); }, }, created() { |