mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-18 07:30:12 +01:00
🎨 Database gallery view https://github.com/siyuan-note/siyuan/issues/10414
This commit is contained in:
parent
8d100bfae7
commit
1426d17c5b
2 changed files with 15 additions and 2 deletions
|
|
@ -81,6 +81,13 @@ type ViewGalleryCardField struct {
|
||||||
type Gallery struct {
|
type Gallery struct {
|
||||||
*BaseInstance
|
*BaseInstance
|
||||||
|
|
||||||
|
CoverFrom CoverFrom `json:"coverFrom"` // 封面来源
|
||||||
|
CoverFromAssetKeyID string `json:"coverFromAssetKeyId,omitempty"` // 资源字段 ID,CoverFrom 为 CoverFromAssetField 时有效
|
||||||
|
CardSize CardSize `json:"cardSize"` // 卡片大小
|
||||||
|
FitImage bool `json:"fitImage"` // 是否适应封面图片大小
|
||||||
|
ShowIcon bool `json:"showIcon"` // 是否显示字段图标
|
||||||
|
WrapField bool `json:"wrapField"` // 是否换行字段内容
|
||||||
|
|
||||||
Fields []*GalleryField `json:"fields"` // 画廊字段
|
Fields []*GalleryField `json:"fields"` // 画廊字段
|
||||||
Cards []*GalleryCard `json:"cards"` // 画廊卡片
|
Cards []*GalleryCard `json:"cards"` // 画廊卡片
|
||||||
CardCount int `json:"cardCount"` // 画廊总卡片数
|
CardCount int `json:"cardCount"` // 画廊总卡片数
|
||||||
|
|
|
||||||
|
|
@ -26,8 +26,14 @@ func RenderAttributeViewGallery(attrView *av.AttributeView, view *av.View, query
|
||||||
Filters: view.Gallery.Filters,
|
Filters: view.Gallery.Filters,
|
||||||
Sorts: view.Gallery.Sorts,
|
Sorts: view.Gallery.Sorts,
|
||||||
},
|
},
|
||||||
Fields: []*av.GalleryField{},
|
CoverFrom: view.Gallery.CoverFrom,
|
||||||
Cards: []*av.GalleryCard{},
|
CoverFromAssetKeyID: view.Gallery.CoverFromAssetKeyID,
|
||||||
|
CardSize: view.Gallery.CardSize,
|
||||||
|
FitImage: view.Gallery.FitImage,
|
||||||
|
ShowIcon: view.Gallery.ShowIcon,
|
||||||
|
WrapField: view.Gallery.WrapField,
|
||||||
|
Fields: []*av.GalleryField{},
|
||||||
|
Cards: []*av.GalleryCard{},
|
||||||
}
|
}
|
||||||
|
|
||||||
// 组装字段
|
// 组装字段
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue