Labels: Show photo count #584 #1444

This commit is contained in:
Michael Mayer 2021-09-17 16:13:47 +02:00
parent 0f90258ef9
commit 6bcfb29fa2
5 changed files with 18 additions and 6 deletions

View file

@ -50,7 +50,7 @@ export class Subject extends RestModel {
Favorite: false,
Private: false,
Excluded: false,
Files: 0,
FileCount: 0,
Metadata: {},
CreatedAt: "",
UpdatedAt: "",

View file

@ -130,6 +130,18 @@
</template>
</v-edit-dialog>
</v-card-title>
<v-card-text primary-title class="pb-2 pt-0 card-details" style="user-select: none;"
@click.stop.prevent="">
<div class="caption mb-2">
<button v-if="label.PhotoCount === 1">
<translate>Contains one entry.</translate>
</button>
<button v-else-if="label.PhotoCount > 0">
<translate :translate-params="{n: label.PhotoCount}">Contains %{n} entries.</translate>
</button>
</div>
</v-card-text>
</v-card>
</v-flex>
</v-layout>

View file

@ -131,11 +131,11 @@
</div>
<div class="caption mb-2">
<button v-if="model.Files === 1">
<button v-if="model.FileCount === 1">
<translate>Contains one entry.</translate>
</button>
<button v-else-if="model.Files > 0">
<translate :translate-params="{n: model.Files}">Contains %{n} entries.</translate>
<button v-else-if="model.FileCount > 0">
<translate :translate-params="{n: model.FileCount}">Contains %{n} entries.</translate>
</button>
</div>
</v-card-text>

View file

@ -33,7 +33,7 @@ type Subject struct {
SubjFavorite bool `gorm:"default:false" json:"Favorite" yaml:"Favorite,omitempty"`
SubjPrivate bool `gorm:"default:false" json:"Private" yaml:"Private,omitempty"`
SubjExcluded bool `gorm:"default:false" json:"Excluded" yaml:"Excluded,omitempty"`
FileCount int `gorm:"default:0" json:"Files" yaml:"-"`
FileCount int `gorm:"default:0" json:"FileCount" yaml:"-"`
MetadataJSON json.RawMessage `gorm:"type:MEDIUMBLOB;" json:"Metadata,omitempty" yaml:"Metadata,omitempty"`
CreatedAt time.Time `json:"CreatedAt" yaml:"-"`
UpdatedAt time.Time `json:"UpdatedAt" yaml:"-"`

View file

@ -21,7 +21,7 @@ type SubjectResult struct {
SubjFavorite bool `json:"Favorite"`
SubjPrivate bool `json:"Private"`
SubjExcluded bool `json:"Excluded"`
FileCount int `json:"Files"`
FileCount int `json:"FileCount"`
Thumb string `json:"Thumb"`
}