2022-08-08 15:43:05 -07:00
< form action = "{{.webroot}}manage?action=boardsections" method = "POST" id = "sectionform" >
{{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 >
< tr > < td > List order< / td > < td > < input type = "number" name = "sectionpos" { { with . edit_section } } value = "{{.ListOrder}}" { { end } } value = "0" / > < / td > < / tr >
< 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}}
< input type = "button" onclick = "window.location='{{$.webroot}}manage?action=boardsections'" value = "Cancel" >
{{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 >
2022-08-23 12:03:21 -07:00
< table id = "sections" border = "1" >
2022-08-08 15:43:05 -07:00
< tr > < th > Name< / th > < th > Abbreviation< / th > < th > List order< / 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 >
< td > {{$section.ListOrder}}< / td >
< td > {{if eq $section.Hidden true}}Yes{{else}}No{{end}}< / td >
< td > < a href = "{{$.webroot}}manage?action=boardsections&edit={{$section.ID}}" > Edit< / a > |
< a href = "{{$.webroot}}manage?action=boardsections&delete={{$section.ID}}" onclick = "return confirm('Are you sure you want to delete this section?')" > Delete< / a > < / td >
< / tr >
2022-08-07 22:02:06 -07:00
{{end}}
< / table >