This commit is contained in:
@@ -19,6 +19,7 @@ const (
|
||||
ShortEdge PrintOption = "-o Binding=TopBinding"
|
||||
CreateBooklet PrintOption = "-o Combination=Booklet -o PageSize=A5"
|
||||
TriFold PrintOption = "-o Fold=TriFold -o Binding=TopBinding"
|
||||
FitToPage PrintOption = "-o fit-to-page"
|
||||
)
|
||||
|
||||
type OldPrintJob struct {
|
||||
@@ -101,7 +102,12 @@ func (p *PrintJob) GeneratePrintOptions() []PrintOption {
|
||||
result = append(result, CoverPage)
|
||||
}
|
||||
|
||||
if p.ShopItem.FitToPage {
|
||||
result = append(result, FitToPage)
|
||||
}
|
||||
|
||||
result = append(result, GetPrintMode(p.ShopItem.PrintMode))
|
||||
result = append(result, PrintOption(p.ShopItem.CustomPrintOptions))
|
||||
return result
|
||||
}
|
||||
|
||||
|
||||
+14
-12
@@ -42,16 +42,18 @@ type ItemVariant struct {
|
||||
|
||||
type ShopItem struct {
|
||||
gorm.Model
|
||||
Name string `json:"name" binding:"required" gorm:"unique;not null"`
|
||||
Abstract string `json:"abstract" binding:"required"`
|
||||
Description string `json:"description" binding:"required"`
|
||||
Category Category `json:"category"`
|
||||
Variants []ItemVariant `json:"variant"`
|
||||
BasePrice float64 `json:"basePrice"`
|
||||
IsPublic bool `json:"isPublic" gorm:"default:true"`
|
||||
Tags []Tag `gorm:"many2many:item_tags;"`
|
||||
Image string
|
||||
Pdf string
|
||||
PrintMode string `json:"printMode" gorm:"default:CreateBooklet"`
|
||||
WasPrinted bool `gorm:"default:false"`
|
||||
Name string `json:"name" binding:"required" gorm:"unique;not null"`
|
||||
Abstract string `json:"abstract" binding:"required"`
|
||||
Description string `json:"description" binding:"required"`
|
||||
Category Category `json:"category"`
|
||||
Variants []ItemVariant `json:"variant"`
|
||||
BasePrice float64 `json:"basePrice"`
|
||||
IsPublic bool `json:"isPublic" gorm:"default:true"`
|
||||
Tags []Tag `gorm:"many2many:item_tags;"`
|
||||
Image string
|
||||
Pdf string
|
||||
PrintMode string `json:"printMode" gorm:"default:CreateBooklet"`
|
||||
CustomPrintOptions string `gorm:"default:''"`
|
||||
FitToPage bool `gorm:"default:false"`
|
||||
WasPrinted bool `gorm:"default:false"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user