mirror of
https://github.com/gotson/komga.git
synced 2026-05-09 05:10:19 +02:00
parent
87c1432984
commit
6090e3f0c5
4 changed files with 66 additions and 8 deletions
|
|
@ -217,6 +217,31 @@
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
|
|
||||||
|
<v-row v-if="single">
|
||||||
|
<!-- Total book count -->
|
||||||
|
<v-col cols="6">
|
||||||
|
<v-text-field v-model="form.totalBookCount"
|
||||||
|
:label="$t('dialog.edit_series.field_total_book_count')"
|
||||||
|
clearable
|
||||||
|
filled
|
||||||
|
dense
|
||||||
|
type="number"
|
||||||
|
:error-messages="totalBookCountErrors"
|
||||||
|
@input="$v.form.totalBookCount.$touch()"
|
||||||
|
@blur="$v.form.totalBookCount.$touch()"
|
||||||
|
@change="form.totalBookCountLock = true"
|
||||||
|
>
|
||||||
|
<template v-slot:prepend>
|
||||||
|
<v-icon :color="form.totalBookCountLock ? 'secondary' : ''"
|
||||||
|
@click="form.totalBookCountLock = !form.totalBookCountLock"
|
||||||
|
>
|
||||||
|
{{ form.totalBookCountLock ? 'mdi-lock' : 'mdi-lock-open' }}
|
||||||
|
</v-icon>
|
||||||
|
</template>
|
||||||
|
</v-text-field>
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
|
|
||||||
</v-container>
|
</v-container>
|
||||||
</v-card>
|
</v-card>
|
||||||
</v-tab-item>
|
</v-tab-item>
|
||||||
|
|
@ -329,7 +354,7 @@ export default Vue.extend({
|
||||||
readingDirectionLock: false,
|
readingDirectionLock: false,
|
||||||
publisher: '',
|
publisher: '',
|
||||||
publisherLock: false,
|
publisherLock: false,
|
||||||
ageRating: undefined as unknown as number,
|
ageRating: undefined as number | undefined,
|
||||||
ageRatingLock: false,
|
ageRatingLock: false,
|
||||||
language: '',
|
language: '',
|
||||||
languageLock: false,
|
languageLock: false,
|
||||||
|
|
@ -337,6 +362,8 @@ export default Vue.extend({
|
||||||
genresLock: false,
|
genresLock: false,
|
||||||
tags: [],
|
tags: [],
|
||||||
tagsLock: false,
|
tagsLock: false,
|
||||||
|
totalBookCount: undefined as number | undefined,
|
||||||
|
totalBookCountLock: false,
|
||||||
},
|
},
|
||||||
mixed: {
|
mixed: {
|
||||||
status: false,
|
status: false,
|
||||||
|
|
@ -393,6 +420,7 @@ export default Vue.extend({
|
||||||
ageRating: {minValue: minValue(0)},
|
ageRating: {minValue: minValue(0)},
|
||||||
readingDirection: {},
|
readingDirection: {},
|
||||||
publisher: {},
|
publisher: {},
|
||||||
|
totalBookCount: {minValue: minValue(1)},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
async created() {
|
async created() {
|
||||||
|
|
@ -423,6 +451,12 @@ export default Vue.extend({
|
||||||
!this.$v?.form?.ageRating?.minValue && errors.push(this.$t('dialog.edit_series.field_age_rating_error').toString())
|
!this.$v?.form?.ageRating?.minValue && errors.push(this.$t('dialog.edit_series.field_age_rating_error').toString())
|
||||||
return errors
|
return errors
|
||||||
},
|
},
|
||||||
|
totalBookCountErrors(): string[] {
|
||||||
|
const errors = [] as string[]
|
||||||
|
if (!this.$v.form?.totalBookCount?.$dirty) return errors
|
||||||
|
!this.$v?.form?.totalBookCount?.minValue && errors.push(this.$t('dialog.edit_series.field_total_book_count_error').toString())
|
||||||
|
return errors
|
||||||
|
},
|
||||||
languageErrors(): string[] {
|
languageErrors(): string[] {
|
||||||
if (!this.$v.form?.language?.$dirty) return []
|
if (!this.$v.form?.language?.$dirty) return []
|
||||||
if (!this.$v?.form?.language?.validLanguage) return tags(this.form.language).errors().map((x: any) => x.message)
|
if (!this.$v?.form?.language?.validLanguage) return tags(this.form.language).errors().map((x: any) => x.message)
|
||||||
|
|
@ -462,7 +496,7 @@ export default Vue.extend({
|
||||||
this.form.readingDirectionLock = readingDirectionLock.length > 1 ? false : readingDirectionLock[0]
|
this.form.readingDirectionLock = readingDirectionLock.length > 1 ? false : readingDirectionLock[0]
|
||||||
|
|
||||||
const ageRating = this.$_.uniq(series.map(x => x.metadata.ageRating))
|
const ageRating = this.$_.uniq(series.map(x => x.metadata.ageRating))
|
||||||
this.form.ageRating = ageRating.length > 1 ? undefined as unknown as number : ageRating[0]
|
this.form.ageRating = ageRating.length > 1 ? undefined : ageRating[0]
|
||||||
this.mixed.ageRating = ageRating.length > 1
|
this.mixed.ageRating = ageRating.length > 1
|
||||||
|
|
||||||
const ageRatingLock = this.$_.uniq(series.map(x => x.metadata.ageRatingLock))
|
const ageRatingLock = this.$_.uniq(series.map(x => x.metadata.ageRatingLock))
|
||||||
|
|
@ -516,6 +550,7 @@ export default Vue.extend({
|
||||||
languageLock: this.form.languageLock,
|
languageLock: this.form.languageLock,
|
||||||
genresLock: this.form.genresLock,
|
genresLock: this.form.genresLock,
|
||||||
tagsLock: this.form.tagsLock,
|
tagsLock: this.form.tagsLock,
|
||||||
|
totalBookCountLock: this.form.totalBookCountLock,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.$v.form?.status?.$dirty) {
|
if (this.$v.form?.status?.$dirty) {
|
||||||
|
|
@ -551,6 +586,7 @@ export default Vue.extend({
|
||||||
titleLock: this.form.titleLock,
|
titleLock: this.form.titleLock,
|
||||||
titleSortLock: this.form.titleSortLock,
|
titleSortLock: this.form.titleSortLock,
|
||||||
summaryLock: this.form.summaryLock,
|
summaryLock: this.form.summaryLock,
|
||||||
|
totalBookCountLock: this.form.totalBookCountLock,
|
||||||
})
|
})
|
||||||
|
|
||||||
if (this.$v.form?.title?.$dirty) {
|
if (this.$v.form?.title?.$dirty) {
|
||||||
|
|
@ -564,6 +600,10 @@ export default Vue.extend({
|
||||||
if (this.$v.form?.summary?.$dirty) {
|
if (this.$v.form?.summary?.$dirty) {
|
||||||
this.$_.merge(metadata, {summary: this.form.summary})
|
this.$_.merge(metadata, {summary: this.form.summary})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.$v.form?.totalBookCount?.$dirty) {
|
||||||
|
this.$_.merge(metadata, {totalBookCount: this.form.totalBookCount})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return metadata
|
return metadata
|
||||||
|
|
|
||||||
|
|
@ -174,6 +174,7 @@
|
||||||
"all_libraries": "All Libraries",
|
"all_libraries": "All Libraries",
|
||||||
"books": "Books",
|
"books": "Books",
|
||||||
"books_n": "No book | 1 book | {count} books",
|
"books_n": "No book | 1 book | {count} books",
|
||||||
|
"books_total": "{count} / {total} books",
|
||||||
"cancel": "Cancel",
|
"cancel": "Cancel",
|
||||||
"close": "Close",
|
"close": "Close",
|
||||||
"collections": "Collections",
|
"collections": "Collections",
|
||||||
|
|
@ -373,6 +374,8 @@
|
||||||
"dialog_title_single": "Edit {series}",
|
"dialog_title_single": "Edit {series}",
|
||||||
"field_age_rating": "Age Rating",
|
"field_age_rating": "Age Rating",
|
||||||
"field_age_rating_error": "Age rating must be 0 or more",
|
"field_age_rating_error": "Age rating must be 0 or more",
|
||||||
|
"field_total_book_count": "Total Book Count",
|
||||||
|
"field_total_book_count_error": "Total book count must be 1 or more",
|
||||||
"field_genres": "Genres",
|
"field_genres": "Genres",
|
||||||
"field_language": "Language",
|
"field_language": "Language",
|
||||||
"field_language_hint": "IETF BCP 47 language tag",
|
"field_language_hint": "IETF BCP 47 language tag",
|
||||||
|
|
|
||||||
|
|
@ -30,14 +30,16 @@ export interface SeriesMetadataDto {
|
||||||
readingDirectionLock: boolean,
|
readingDirectionLock: boolean,
|
||||||
publisher: string,
|
publisher: string,
|
||||||
publisherLock: boolean,
|
publisherLock: boolean,
|
||||||
ageRating: number,
|
ageRating?: number,
|
||||||
ageRatingLock: boolean,
|
ageRatingLock: boolean,
|
||||||
language: string,
|
language: string,
|
||||||
languageLock: boolean,
|
languageLock: boolean,
|
||||||
genres: string[],
|
genres: string[],
|
||||||
genresLock: boolean,
|
genresLock: boolean,
|
||||||
tags: String[],
|
tags: string[],
|
||||||
tagsLock: boolean
|
tagsLock: boolean,
|
||||||
|
totalBookCount?: number,
|
||||||
|
totalBookCountLock: boolean,
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface SeriesBooksMetadataDto {
|
export interface SeriesBooksMetadataDto {
|
||||||
|
|
@ -68,8 +70,10 @@ export interface SeriesMetadataUpdateDto {
|
||||||
languageLock?: boolean,
|
languageLock?: boolean,
|
||||||
genres?: string[],
|
genres?: string[],
|
||||||
genresLock?: boolean,
|
genresLock?: boolean,
|
||||||
tags?: String[],
|
tags?: string[],
|
||||||
tagsLock?: boolean
|
tagsLock?: boolean,
|
||||||
|
totalBookCount?: number,
|
||||||
|
totalBookCountLock: boolean,
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface GroupCountDto {
|
export interface GroupCountDto {
|
||||||
|
|
|
||||||
|
|
@ -133,7 +133,8 @@
|
||||||
{{ languageDisplay }}
|
{{ languageDisplay }}
|
||||||
</v-chip>
|
</v-chip>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col :class="'py-1 ' + ($vuetify.rtl ? 'pl-0' : 'pr-0')" cols="auto" v-if="series.metadata.readingDirection">
|
<v-col :class="'py-1 ' + ($vuetify.rtl ? 'pl-0' : 'pr-0')" cols="auto"
|
||||||
|
v-if="series.metadata.readingDirection">
|
||||||
<v-chip label small>
|
<v-chip label small>
|
||||||
{{ $t(`enums.reading_direction.${series.metadata.readingDirection}`) }}
|
{{ $t(`enums.reading_direction.${series.metadata.readingDirection}`) }}
|
||||||
</v-chip>
|
</v-chip>
|
||||||
|
|
@ -145,6 +146,16 @@
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
|
|
||||||
|
<v-row class="text-caption" align="center">
|
||||||
|
<v-col cols="auto" v-if="series.metadata.totalBookCount">
|
||||||
|
{{ $t('common.books_total', {count: series.booksCount, total: series.metadata.totalBookCount}) }}
|
||||||
|
</v-col>
|
||||||
|
|
||||||
|
<v-col cols="auto" v-else>
|
||||||
|
{{ $tc('common.books_n', series.booksCount) }}
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
|
|
||||||
<template v-if="$vuetify.breakpoint.smAndUp">
|
<template v-if="$vuetify.breakpoint.smAndUp">
|
||||||
<v-row class="align-center">
|
<v-row class="align-center">
|
||||||
<v-col cols="auto">
|
<v-col cols="auto">
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue