{{define "cp_commands"}} {{template "cp_head" .}} {{template "cp_alerts" .}}
...dust...
{{mTemplate "commands_channel_override" "ActiveGuild" .ActiveGuild "Commands" .SortedCommands "Override" .GlobalCommandSettings}}
{{$dot := .}} {{range .ChannelOverrides}}
{{mTemplate "commands_channel_override" "ActiveGuild" $dot.ActiveGuild "Commands" $dot.SortedCommands "Override" .}}
{{end}}
{{mTemplate "commands_channel_override" "ActiveGuild" .ActiveGuild "Commands" .SortedCommands}}
{{template "cp_footer" .}} {{end}} {{/*Expects: .Override (or nil) .ActiveGuild .Commands */}} {{define "commands_channel_override"}}
{{if not .Override.Global}}


{{end}}


{{$desc := "All commands enabled?"}} {{if .Override.Global}}{{$desc = `All commands enabled?
Warning: disabling this will disable all commands unless enabled in other overrides`}}{{end}} {{$commandsEnabled := true}} {{if .Override}}{{$commandsEnabled = .Override.CommandsEnabled}}{{end}} {{checkbox "CommandsEnabled" (joinStr "" "commands-enabled-" .Override.ID) $desc $commandsEnabled}}
{{if .Override}} {{if not .Override.Global}} {{end}} {{else}} {{end}}
{{if .Override}}
{{mTemplate "commands_command_override" "ActiveGuild" .ActiveGuild "Parent" .Override "Commands" .Commands}} {{$dot := .}} {{if .Override.R}}{{range $i, $v := .Override.R.CommandsCommandOverrides}} {{mTemplate "commands_command_override" "ActiveGuild" $dot.ActiveGuild "Parent" $dot.Override "Commands" $dot.Commands "Override" . "Index" $i}} {{end}}{{end}}
{{end}} {{end}} {{/*Expects: .Parent (ChannelOverride) .Override (or nil) .ActiveGuild .Commands .ID */}} {{define "commands_command_override"}}


{{$id := ""}} {{if .Override}}{{$id = joinStr "" "cmd-override-commands-enabled-" .Override.ID}}{{else}}{{$id = joinStr "" "cmd-override-commands-enabled-" .Parent.ID "-new"}}{{end}} {{$commandsEnabled := true}} {{if .Override}}{{$commandsEnabled = .Override.CommandsEnabled}}{{end}} {{checkbox "CommandsEnabled" $id "Enable the specified commands?" $commandsEnabled}}


{{if .Override}} {{else}} {{end}}
{{end}}