Organized admin files.
This commit is contained in:
parent
47ed381b64
commit
38b65878f8
5 changed files with 281 additions and 247 deletions
27
pkg/ui/forms/admin_entity_delete.go
Normal file
27
pkg/ui/forms/admin_entity_delete.go
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
package forms
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/mikestefanello/pagoda/pkg/routenames"
|
||||
"github.com/mikestefanello/pagoda/pkg/ui"
|
||||
. "github.com/mikestefanello/pagoda/pkg/ui/components"
|
||||
. "maragu.dev/gomponents"
|
||||
. "maragu.dev/gomponents/html"
|
||||
)
|
||||
|
||||
func AdminEntityDelete(r *ui.Request, entityTypeName string) Node {
|
||||
return Form(
|
||||
Method(http.MethodPost),
|
||||
P(Class("subtitle"), Textf("Are you sure you want to delete this %s?", entityTypeName)),
|
||||
ControlGroup(
|
||||
FormButton("is-link", "Delete"),
|
||||
ButtonLink(
|
||||
r.Path(routenames.AdminEntityList(entityTypeName)),
|
||||
"is-secondary",
|
||||
"Cancel",
|
||||
),
|
||||
),
|
||||
CSRF(r),
|
||||
)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue