-
+
@@ -44,36 +44,69 @@
/>
-
-
+
+
+
+ mdi-close
+
+
+ {{ selected.length }} selected
+
-
+
+
+ mdi-pencil
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+ :selected="active"
+ :select="toggle"
+ :showEdit="selected.length === 0"
+ :edit="singleEdit"
+ />
+
+
+
-
-
-
-
-
- Clear filter
-
-
-
+
+
+
+ Clear filter
+
+
+
+
@@ -81,6 +114,7 @@
import Badge from '@/components/Badge.vue'
import CardSeries from '@/components/CardSeries.vue'
import EmptyState from '@/components/EmptyState.vue'
+import EditSeriesDialog from '@/components/EditSeriesDialog.vue'
import LibraryActionsMenu from '@/components/LibraryActionsMenu.vue'
import SortMenuButton from '@/components/SortMenuButton.vue'
import ToolbarSticky from '@/components/ToolbarSticky.vue'
@@ -92,11 +126,13 @@ import mixins from 'vue-typed-mixins'
export default mixins(VisibleElements).extend({
name: 'BrowseLibraries',
- components: { LibraryActionsMenu, CardSeries, EmptyState, ToolbarSticky, SortMenuButton, Badge },
+ components: { LibraryActionsMenu, CardSeries, EmptyState, ToolbarSticky, SortMenuButton, Badge, EditSeriesDialog },
data: () => {
return {
library: undefined as LibraryDto | undefined,
series: [] as SeriesDto[],
+ selectedSeries: [] as SeriesDto[],
+ editSeriesSingle: [] as SeriesDto[],
pagesState: [] as LoadState[],
pageSize: 20,
totalElements: null as number | null,
@@ -111,7 +147,10 @@ export default mixins(VisibleElements).extend({
SeriesStatus,
cardWidth: 150,
sortUnwatch: null as any,
- filterUnwatch: null as any
+ filterUnwatch: null as any,
+ selected: [],
+ dialogEdit: false,
+ dialogEditSingle: false
}
},
props: {
@@ -135,6 +174,26 @@ export default mixins(VisibleElements).extend({
if (this.$route.params.index !== index) {
this.updateRoute(index)
}
+ },
+ selected (val: number[]) {
+ this.selectedSeries = val.map(id => this.series.find(s => s.id === id))
+ .filter(x => x !== undefined) as SeriesDto[]
+ },
+ selectedSeries (val: SeriesDto[]) {
+ val.forEach(s => {
+ const index = this.series.findIndex(x => x.id === s.id)
+ if (index !== -1) {
+ this.series[index] = s
+ }
+ })
+ },
+ editSeriesSingle (val: SeriesDto[]) {
+ val.forEach(s => {
+ const index = this.series.findIndex(x => x.id === s.id)
+ if (index !== -1) {
+ this.series[index] = s
+ }
+ })
}
},
async created () {
@@ -178,6 +237,11 @@ export default mixins(VisibleElements).extend({
next()
},
+ computed: {
+ isAdmin (): boolean {
+ return this.$store.getters.meAdmin
+ }
+ },
methods: {
setWatches () {
this.sortUnwatch = this.$watch('sortActive', this.updateRouteAndReload)
@@ -255,6 +319,10 @@ export default mixins(VisibleElements).extend({
} else {
return undefined
}
+ },
+ singleEdit (series: SeriesDto) {
+ this.editSeriesSingle = [series]
+ this.dialogEditSingle = true
}
}
})
diff --git a/komga-webui/src/views/BrowseSeries.vue b/komga-webui/src/views/BrowseSeries.vue
index 49997b5f7..68ae39994 100644
--- a/komga-webui/src/views/BrowseSeries.vue
+++ b/komga-webui/src/views/BrowseSeries.vue
@@ -89,7 +89,7 @@