2023-01-04 23:13:59 -08:00
< form action = "{{webPath " manage / boardsections " } } " method = "POST" id = "sectionform" >
2022-08-08 15:43:05 -07:00
{{with .edit_section}}< input type = "hidden" name = "updatesection" value = "{{.ID}}" / > {{end}}
< h2 > {{with .edit_section}}Edit{{else}}New{{end}} section< / h2 >
2022-08-07 22:02:06 -07:00
< table >
2022-08-08 15:43:05 -07:00
< tr > < td > Name:< / td > < td > < input type = "text" name = "sectionname" { { with . edit_section } } value = "{{.Name}}" { { end } } required > < / td > < / tr >
< tr > < td > Abbreviation:< / td > < td > < input type = "text" name = "sectionabbr" { { with . edit_section } } value = "{{.Abbreviation}}" { { end } } required > < / td > < / tr >
2022-12-05 16:40:56 -08:00
< tr > < td > Navbar position< / td > < td > < input type = "number" name = "sectionpos" { { with . edit_section } } value = "{{.Position}}" { { end } } value = "0" / > < / td > < / tr >
2022-08-08 15:43:05 -07:00
< tr > < td > Hidden:< / td > < td > < input type = "checkbox" name = "sectionhidden" { { with . edit_section } } { { if . Hidden } } checked { { end } } { { end } } / > < / td > < / tr >
2022-08-07 22:02:06 -07:00
< / table >
2022-08-08 15:43:05 -07:00
< input type = "submit" name = "save_section" value = "{{with .edit_section}}Save{{else}}Create{{end}} section" >
{{with .edit_section}}
2023-01-04 23:13:59 -08:00
< input type = "button" onclick = "window.location='{{webPath " manage / boardsections " } } ' " value = "Cancel" >
2022-08-08 15:43:05 -07:00
{{else}}
< input type = "button" onclick = "document.getElementById('sectionform').reset()" value = "Reset" / >
{{end}}
2022-08-07 22:02:06 -07:00
< / form >
< br / > < hr / >
< h2 > Current sections< / h2 >
2024-03-08 14:50:28 -08:00
< table id = "sections" class = "mgmt-table" >
2022-12-05 16:40:56 -08:00
< tr > < th > Name< / th > < th > Abbreviation< / th > < th > Navbar position< / th > < th > Hidden< / th > < th > Action< / th > < / tr >
2022-08-23 12:03:21 -07:00
{{range $s, $section := .sections}}< tr id = "section{{$section.ID}}" class = "sectionrow" >
2022-08-08 15:43:05 -07:00
< td > {{$section.Name}}< / td >
< td > {{$section.Abbreviation}}< / td >
2022-12-05 16:40:56 -08:00
< td > {{$section.Position}}< / td >
2022-08-08 15:43:05 -07:00
< td > {{if eq $section.Hidden true}}Yes{{else}}No{{end}}< / td >
2023-01-04 23:13:59 -08:00
< td > < a href = "{{webPath " manage / boardsections " } } ? edit = {{$section.ID}}" > Edit< / a > |
< a href = "{{webPath " manage / boardsections " } } ? delete = {{$section.ID}}" onclick = "return confirm('Are you sure you want to delete this section?')" > Delete< / a > < / td >
2022-08-08 15:43:05 -07:00
< / tr >
2022-08-07 22:02:06 -07:00
{{end}}
< / table >