aboutsummaryrefslogtreecommitdiff
path: root/src/site/components/grid/Grid.vue
diff options
context:
space:
mode:
authorZephyrrus <[email protected]>2020-07-02 02:48:21 +0300
committerZephyrrus <[email protected]>2020-07-02 02:48:21 +0300
commit6688587eb6bdf118687c630378d40e36a3700a52 (patch)
tree58d9e58db9f10dd897760577614166d0743cf3ac /src/site/components/grid/Grid.vue
parentfeat: backend pagination for albums (diff)
downloadhost.fuwn.me-6688587eb6bdf118687c630378d40e36a3700a52.tar.xz
host.fuwn.me-6688587eb6bdf118687c630378d40e36a3700a52.zip
feat: move toolbar into a level and add slot for pagination on grid
Diffstat (limited to 'src/site/components/grid/Grid.vue')
-rw-r--r--src/site/components/grid/Grid.vue57
1 files changed, 30 insertions, 27 deletions
diff --git a/src/site/components/grid/Grid.vue b/src/site/components/grid/Grid.vue
index b6615be..279472c 100644
--- a/src/site/components/grid/Grid.vue
+++ b/src/site/components/grid/Grid.vue
@@ -1,37 +1,40 @@
<template>
<div>
- <div v-if="enableToolbar"
- class="toolbar">
- <div class="block">
- <b-radio v-model="showList"
- name="name"
- :native-value="true">
- List
- </b-radio>
- <b-radio v-model="showList"
- name="name"
- :native-value="false">
- Grid
- </b-radio>
+ <nav class="level">
+ <div class="level-left">
+ <div class="level-item">
+ <slot name="pagination" />
+ </div>
</div>
- </div>
+ <div v-if="enableToolbar"
+ class="level-right toolbar">
+ <div class="level-item">
+ <div class="block">
+ <b-radio v-model="showList"
+ name="name"
+ :native-value="true">
+ List
+ </b-radio>
+ <b-radio v-model="showList"
+ name="name"
+ :native-value="false">
+ Grid
+ </b-radio>
+ </div>
+ </div>
+ </div>
+ </nav>
<template v-if="!showList">
<Waterfall v-if="showWaterfall"
:gutterWidth="10"
:gutterHeight="4">
- <!--
- TODO: Implement search based on originalName, albumName and tags
- <input v-if="enableSearch"
- v-model="searchTerm"
- type="text"
- placeholder="Search..."
- @input="search()"
- @keyup.enter="search()">
- -->
-
- <!-- TODO: Implement pagination -->
-
+ <input v-if="enableSearch"
+ v-model="searchTerm"
+ type="text"
+ placeholder="Search..."
+ @input="search()"
+ @keyup.enter="search()">
<WaterfallItem v-for="(item, index) in gridFiles"
:key="item.id"
:width="width"
@@ -289,7 +292,7 @@ export default {
isAlbumSelected(id) {
if (!this.showingModalForFile) return;
const found = this.showingModalForFile.albums.find(el => el.id === id);
- return found ? found.id ? true : false : false;
+ return found && found.id ? true : false;
},
async openAlbumModal(file) {
this.showingModalForFile = file;