634 lines
13 KiB
Go
634 lines
13 KiB
Go
// Code generated by templ@(devel) DO NOT EDIT.
|
|
|
|
package deleterow
|
|
|
|
//lint:file-ignore SA4006 This context is only used if a nested component is present.
|
|
|
|
import "github.com/a-h/templ"
|
|
import "context"
|
|
import "io"
|
|
import "bytes"
|
|
|
|
// GoExpression
|
|
import "examples/shared"
|
|
|
|
func demo() templ.Component {
|
|
return templ.ComponentFunc(func(ctx context.Context, w io.Writer) (err error) {
|
|
templBuffer, templIsBuffer := w.(*bytes.Buffer)
|
|
if !templIsBuffer {
|
|
templBuffer = templ.GetBuffer()
|
|
defer templ.ReleaseBuffer(templBuffer)
|
|
}
|
|
ctx = templ.InitializeContext(ctx)
|
|
var_1 := templ.GetChildren(ctx)
|
|
if var_1 == nil {
|
|
var_1 = templ.NopComponent
|
|
}
|
|
ctx = templ.ClearChildren(ctx)
|
|
// RawElement
|
|
_, err = templBuffer.WriteString("<style>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Text
|
|
var_2 := `
|
|
tr.htmx-swapping td {
|
|
opacity: 0;
|
|
transition: opacity 1s ease-out;
|
|
}
|
|
`
|
|
_, err = templBuffer.WriteString(var_2)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_, err = templBuffer.WriteString("</style>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Element (standard)
|
|
_, err = templBuffer.WriteString("<table")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Element Attributes
|
|
_, err = templBuffer.WriteString(" class=\"table\"")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_, err = templBuffer.WriteString(">")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Element (standard)
|
|
_, err = templBuffer.WriteString("<thead>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Element (standard)
|
|
_, err = templBuffer.WriteString("<tr>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Element (standard)
|
|
_, err = templBuffer.WriteString("<th>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Text
|
|
var_3 := `Name`
|
|
_, err = templBuffer.WriteString(var_3)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_, err = templBuffer.WriteString("</th>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Element (standard)
|
|
_, err = templBuffer.WriteString("<th>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Text
|
|
var_4 := `Email`
|
|
_, err = templBuffer.WriteString(var_4)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_, err = templBuffer.WriteString("</th>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Element (standard)
|
|
_, err = templBuffer.WriteString("<th>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Text
|
|
var_5 := `Status`
|
|
_, err = templBuffer.WriteString(var_5)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_, err = templBuffer.WriteString("</th>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Element (standard)
|
|
_, err = templBuffer.WriteString("<th>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_, err = templBuffer.WriteString("</th>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_, err = templBuffer.WriteString("</tr>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_, err = templBuffer.WriteString("</thead>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Element (standard)
|
|
_, err = templBuffer.WriteString("<tbody")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Element Attributes
|
|
_, err = templBuffer.WriteString(" hx-confirm=\"Are you sure?\"")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_, err = templBuffer.WriteString(" hx-target=\"closest tr\"")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_, err = templBuffer.WriteString(" hx-swap=\"outerHTML swap:1s\"")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_, err = templBuffer.WriteString(">")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Element (standard)
|
|
_, err = templBuffer.WriteString("<tr>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Element (standard)
|
|
_, err = templBuffer.WriteString("<td>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Text
|
|
var_6 := `Joe Smith`
|
|
_, err = templBuffer.WriteString(var_6)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_, err = templBuffer.WriteString("</td>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Element (standard)
|
|
_, err = templBuffer.WriteString("<td>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Text
|
|
var_7 := `joe@smith.org`
|
|
_, err = templBuffer.WriteString(var_7)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_, err = templBuffer.WriteString("</td>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Element (standard)
|
|
_, err = templBuffer.WriteString("<td>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Text
|
|
var_8 := `Active`
|
|
_, err = templBuffer.WriteString(var_8)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_, err = templBuffer.WriteString("</td>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Element (standard)
|
|
_, err = templBuffer.WriteString("<td>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Element (standard)
|
|
_, err = templBuffer.WriteString("<button")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Element Attributes
|
|
_, err = templBuffer.WriteString(" class=\"button is-red\"")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_, err = templBuffer.WriteString(" hx-delete=\"/delete-row/contact/0\"")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_, err = templBuffer.WriteString(">")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Text
|
|
var_9 := `Delete`
|
|
_, err = templBuffer.WriteString(var_9)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_, err = templBuffer.WriteString("</button>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_, err = templBuffer.WriteString("</td>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_, err = templBuffer.WriteString("</tr>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Element (standard)
|
|
_, err = templBuffer.WriteString("<tr>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Element (standard)
|
|
_, err = templBuffer.WriteString("<td>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Text
|
|
var_10 := `Angie MacDowell`
|
|
_, err = templBuffer.WriteString(var_10)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_, err = templBuffer.WriteString("</td>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Element (standard)
|
|
_, err = templBuffer.WriteString("<td>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Text
|
|
var_11 := `angie@macdowell.org`
|
|
_, err = templBuffer.WriteString(var_11)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_, err = templBuffer.WriteString("</td>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Element (standard)
|
|
_, err = templBuffer.WriteString("<td>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Text
|
|
var_12 := `Active`
|
|
_, err = templBuffer.WriteString(var_12)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_, err = templBuffer.WriteString("</td>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Element (standard)
|
|
_, err = templBuffer.WriteString("<td>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Element (standard)
|
|
_, err = templBuffer.WriteString("<button")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Element Attributes
|
|
_, err = templBuffer.WriteString(" class=\"button is-red\"")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_, err = templBuffer.WriteString(" hx-delete=\"/delete-row/contact/1\"")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_, err = templBuffer.WriteString(">")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Text
|
|
var_13 := `Delete`
|
|
_, err = templBuffer.WriteString(var_13)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_, err = templBuffer.WriteString("</button>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_, err = templBuffer.WriteString("</td>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_, err = templBuffer.WriteString("</tr>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Element (standard)
|
|
_, err = templBuffer.WriteString("<tr>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Element (standard)
|
|
_, err = templBuffer.WriteString("<td>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Text
|
|
var_14 := `Fuqua Tarkenton`
|
|
_, err = templBuffer.WriteString(var_14)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_, err = templBuffer.WriteString("</td>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Element (standard)
|
|
_, err = templBuffer.WriteString("<td>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Text
|
|
var_15 := `fuqua@tarkenton.org`
|
|
_, err = templBuffer.WriteString(var_15)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_, err = templBuffer.WriteString("</td>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Element (standard)
|
|
_, err = templBuffer.WriteString("<td>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Text
|
|
var_16 := `Active`
|
|
_, err = templBuffer.WriteString(var_16)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_, err = templBuffer.WriteString("</td>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Element (standard)
|
|
_, err = templBuffer.WriteString("<td>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Element (standard)
|
|
_, err = templBuffer.WriteString("<button")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Element Attributes
|
|
_, err = templBuffer.WriteString(" class=\"button is-red\"")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_, err = templBuffer.WriteString(" hx-delete=\"/delete-row/contact/2\"")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_, err = templBuffer.WriteString(">")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Text
|
|
var_17 := `Delete`
|
|
_, err = templBuffer.WriteString(var_17)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_, err = templBuffer.WriteString("</button>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_, err = templBuffer.WriteString("</td>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_, err = templBuffer.WriteString("</tr>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Element (standard)
|
|
_, err = templBuffer.WriteString("<tr>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Element (standard)
|
|
_, err = templBuffer.WriteString("<td>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Text
|
|
var_18 := `Kim Yee`
|
|
_, err = templBuffer.WriteString(var_18)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_, err = templBuffer.WriteString("</td>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Element (standard)
|
|
_, err = templBuffer.WriteString("<td>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Text
|
|
var_19 := `kim@yee.org`
|
|
_, err = templBuffer.WriteString(var_19)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_, err = templBuffer.WriteString("</td>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Element (standard)
|
|
_, err = templBuffer.WriteString("<td>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Text
|
|
var_20 := `Inactive`
|
|
_, err = templBuffer.WriteString(var_20)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_, err = templBuffer.WriteString("</td>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Element (standard)
|
|
_, err = templBuffer.WriteString("<td>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Element (standard)
|
|
_, err = templBuffer.WriteString("<button")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Element Attributes
|
|
_, err = templBuffer.WriteString(" class=\"button is-red\"")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_, err = templBuffer.WriteString(" hx-delete=\"/delete-row/contact/3\"")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_, err = templBuffer.WriteString(">")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Text
|
|
var_21 := `Delete`
|
|
_, err = templBuffer.WriteString(var_21)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_, err = templBuffer.WriteString("</button>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_, err = templBuffer.WriteString("</td>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_, err = templBuffer.WriteString("</tr>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_, err = templBuffer.WriteString("</tbody>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_, err = templBuffer.WriteString("</table>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if !templIsBuffer {
|
|
_, err = io.Copy(w, templBuffer)
|
|
}
|
|
return err
|
|
})
|
|
}
|
|
|
|
func Index() templ.Component {
|
|
return templ.ComponentFunc(func(ctx context.Context, w io.Writer) (err error) {
|
|
templBuffer, templIsBuffer := w.(*bytes.Buffer)
|
|
if !templIsBuffer {
|
|
templBuffer = templ.GetBuffer()
|
|
defer templ.ReleaseBuffer(templBuffer)
|
|
}
|
|
ctx = templ.InitializeContext(ctx)
|
|
var_22 := templ.GetChildren(ctx)
|
|
if var_22 == nil {
|
|
var_22 = templ.NopComponent
|
|
}
|
|
ctx = templ.ClearChildren(ctx)
|
|
// TemplElement
|
|
var_23 := templ.ComponentFunc(func(ctx context.Context, w io.Writer) (err error) {
|
|
templBuffer, templIsBuffer := w.(*bytes.Buffer)
|
|
if !templIsBuffer {
|
|
templBuffer = templ.GetBuffer()
|
|
defer templ.ReleaseBuffer(templBuffer)
|
|
}
|
|
// Element (standard)
|
|
_, err = templBuffer.WriteString("<h2")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Element Attributes
|
|
_, err = templBuffer.WriteString(" class=\"title\"")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_, err = templBuffer.WriteString(">")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Text
|
|
var_24 := `Delete Row`
|
|
_, err = templBuffer.WriteString(var_24)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_, err = templBuffer.WriteString("</h2>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Whitespace (normalised)
|
|
_, err = templBuffer.WriteString(` `)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Element (standard)
|
|
_, err = templBuffer.WriteString("<h2")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Element Attributes
|
|
_, err = templBuffer.WriteString(" class=\"title\"")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_, err = templBuffer.WriteString(">")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Text
|
|
var_25 := `Demo`
|
|
_, err = templBuffer.WriteString(var_25)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_, err = templBuffer.WriteString("</h2>")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Whitespace (normalised)
|
|
_, err = templBuffer.WriteString(` `)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// TemplElement
|
|
err = demo().Render(ctx, templBuffer)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if !templIsBuffer {
|
|
_, err = io.Copy(w, templBuffer)
|
|
}
|
|
return err
|
|
})
|
|
err = shared.Layout("Delete Row").Render(templ.WithChildren(ctx, var_23), templBuffer)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if !templIsBuffer {
|
|
_, err = io.Copy(w, templBuffer)
|
|
}
|
|
return err
|
|
})
|
|
}
|
|
|