Skip to content

Commit

Permalink
Merge pull request #473 from qor5/feat-ui-reborn
Browse files Browse the repository at this point in the history
Feat UI reborn
  • Loading branch information
danni-cool authored Aug 14, 2024
2 parents 5848405 + a1df267 commit 004b236
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 25 deletions.
28 changes: 8 additions & 20 deletions presets/icons.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,27 +54,15 @@ const (
</svg>
`
ZhLanguageIcon = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_2047_84604)">
<g clip-path="url(#clip1_2047_84604)">
<rect x="2" y="2" width="20" height="20" rx="10" fill="#F93939"/>
<path d="M27.3333 2H4.66667C3.19391 2 2 3.19391 2 4.66667V19.3333C2 20.8061 3.19391 22 4.66667 22H27.3333C28.8061 22 30 20.8061 30 19.3333V4.66667C30 3.19391 28.8061 2 27.3333 2Z" fill="#F93939"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M9.33086 11.64L7.37086 12.6707L7.74419 10.488L6.16019 8.94132L8.35086 8.62532L9.33086 6.63865L10.3095 8.62532L12.5002 8.94132L10.9135 10.488L11.2895 12.6693L9.33086 11.64ZM14.0002 5.99999H15.3335V7.33332H14.0002V5.99999ZM15.3335 8.66665H16.6669V9.99999H15.3335V8.66665ZM15.3335 11.3333H16.6669V12.6667H15.3335V11.3333ZM14.0002 14H15.3335V15.3333H14.0002V14Z" fill="#FFDA2C"/>
</g>
<rect x="2.5" y="2.5" width="19" height="19" rx="9.5" stroke="#EEEEEE"/>
</g>
<defs>
<clipPath id="clip0_2047_84604">
<rect width="20" height="20" fill="white" transform="translate(2 2)"/>
</clipPath>
<clipPath id="clip1_2047_84604">
<rect x="2" y="2" width="20" height="20" rx="10" fill="white"/>
</clipPath>
</defs>
<rect width="24" height="24" rx="12" fill="#F93939"/>
<path d="M14 6h1.333v1.333H14V6zm1.333 2.667h1.334V10H15.333V8.667zm0 2.666h1.334V12.667H15.333v-1.334zm-1.333 2.667h1.333v1.333H14v-1.333z" fill="#FFDA2C"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M9.331 11.64l-1.96 1.031.373-2.183-1.584-1.547 2.191-.316.98-1.986.979 1.986 2.191.316-1.587 1.547.376 2.181-1.958-1.029z" fill="#FFDA2C"/>
<rect x="0.5" y="0.5" width="23" height="23" rx="11.5" stroke="#EEEEEE"/>
</svg>`
JPIcon = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="2.5" y="2.5" width="19" height="19" rx="9.5" fill="white"/>
<rect x="2.5" y="2.5" width="19" height="19" rx="9.5" stroke="#EEEEEE"/>
<path d="M11.9997 16.6663C14.577 16.6663 16.6663 14.577 16.6663 11.9997C16.6663 9.42235 14.577 7.33301 11.9997 7.33301C9.42235 7.33301 7.33301 9.42235 7.33301 11.9997C7.33301 14.577 9.42235 16.6663 11.9997 16.6663Z" fill="#F93939"/>
JPIcon = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="0.5" y="0.5" width="23" height="23" rx="9.5" stroke="#EEEEEE"/>
<rect x="1" y="1" width="22" height="22" rx="10.5" stroke="black" stroke-opacity="0.1"/>
<circle cx="12" cy="12" r="4.333" fill="#F93939"/>
</svg>
`
)
Expand Down
4 changes: 2 additions & 2 deletions presets/listing_compo.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func (c *ListingCompo) MarshalHTML(ctx context.Context) (r []byte, err error) {
h.Tag("Teleport").Attr("to", "#"+c.ActionsComponentTeleportToID()).Children(
c.actionsComponent(ctx),
),
VCard().Elevation(0).Children(
h.Div(VCard().Elevation(0).Children(
h.Div(
c.tabsFilter(ctx),
).Class("px-2"),
Expand All @@ -143,7 +143,7 @@ func (c *ListingCompo) MarshalHTML(ctx context.Context) (r []byte, err error) {
h.Div(
c.cardActionsFooter(ctx),
).Class(("px-4 pb-2")),
),
)).Class("listing-compo-wrap"),
).MarshalHTML(ctx)
}

Expand Down
6 changes: 3 additions & 3 deletions presets/section.go
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ func (b *SectionBuilder) viewComponent(obj interface{}, field *FieldContext, ctx
}

disableEditBtn := b.father.mb.Info().Verifier().Do(PermUpdate).ObjectOn(obj).WithReq(ctx.R).IsAllowed() != nil
btn := VBtn(i18n.T(ctx.R, CoreI18nModuleKey, "Edit")).Size(SizeXSmall).Variant("text").
btn := VBtn(i18n.T(ctx.R, CoreI18nModuleKey, "Edit")).Variant("text").
PrependIcon("mdi-pencil-outline").
Attr("v-show", fmt.Sprintf("%t&&%t", b.componentEditBtnFunc(obj, ctx), !disableEditBtn)).
Attr("@click", web.Plaid().
Expand Down Expand Up @@ -430,7 +430,7 @@ func (b *SectionBuilder) viewComponent(obj interface{}, field *FieldContext, ctx
),
).Variant(VariantFlat).
Attr("v-bind", "props"),
).Class("section-body border-b"),
).Class("section-body"),
)
}

Expand Down Expand Up @@ -503,7 +503,7 @@ func (b *SectionBuilder) editComponent(obj interface{}, field *FieldContext, ctx
).Class("d-flex flex-column"),
),
).Variant(VariantOutlined),
).Class("section-body border-b"),
).Class("section-body"),
)
}

Expand Down

0 comments on commit 004b236

Please sign in to comment.