Skip to content

Commit

Permalink
wip: comment
Browse files Browse the repository at this point in the history
  • Loading branch information
katallaxie authored Jul 21, 2024
1 parent 5e8cc49 commit d31683d
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 5 deletions.
5 changes: 0 additions & 5 deletions internal/controllers/designs/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ func NewListDesignsController(store seed.Database[ports.ReadTx, ports.ReadWriteT

// Prepare ...
func (l *ListDesignsControllerImpl) Prepare() error {
err := l.BindBody(&l.results)
if err != nil {
return err
}

return l.store.ReadTx(l.Context(), func(ctx context.Context, tx ports.ReadTx) error {
return tx.ListDesigns(ctx, &l.results)
})
Expand Down
44 changes: 44 additions & 0 deletions internal/controllers/designs/show.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ import (
"github.com/zeiss/service-lens/internal/ports"

htmx "github.com/zeiss/fiber-htmx"
"github.com/zeiss/fiber-htmx/components/buttons"
"github.com/zeiss/fiber-htmx/components/cards"
"github.com/zeiss/fiber-htmx/components/forms"
)

// ShowDesignControllerImpl ...
Expand Down Expand Up @@ -102,6 +104,48 @@ func (l *ShowDesignControllerImpl) Get() error {
),
),
),
htmx.FormElement(
htmx.HxPost("/designs/new"),
cards.CardBordered(
cards.CardProps{},
cards.Body(
cards.BodyProps{},
forms.FormControl(
forms.FormControlProps{
ClassNames: htmx.ClassNames{},
},
forms.TextareaBordered(
forms.TextareaProps{
ClassNames: htmx.ClassNames{
"h-32": true,
},
Name: "body",
Placeholder: "Start typing...",
},
),
forms.FormControlLabel(
forms.FormControlLabelProps{},
forms.FormControlLabelText(
forms.FormControlLabelTextProps{
ClassNames: htmx.ClassNames{
"text-neutral-500": true,
},
},
htmx.Text("Supports Markdown."),
),
),
),
cards.Actions(
cards.ActionsProps{},
buttons.Outline(
buttons.ButtonProps{},
htmx.Attribute("type", "submit"),
htmx.Text("Comment"),
),
),
),
),
),
),
),
)
Expand Down

0 comments on commit d31683d

Please sign in to comment.