{{ define "title" }}Delete User {{ .Form.User.Name }}{{ end }}

{{ define "main" }}
    {{ $form := .Form }}
    {{ $user := .User }}
    <div class="ui form segment">
        <div class="ui negative message">
            <div class="header">
                Delete user?
            </div>
            <p>Do you want to delete user <strong>{{ .Form.User.Name }}</strong>?</p>
        </div>
        <form action="/users/{{ .Form.User.ID }}/delete" method="post">
            <input type="hidden" name="csrf_token" value="{{ .CSRFToken }}">
            <div class="ui form{{ if .Form.FieldErrors }} error{{ end }}">
                <div class="required field{{ if .Form.FieldErrors.reasoning }} error{{ end }}">
                    <label for="reasoning">Reasoning for the deletion</label>
                    <textarea id="reasoning" name="reasoning" rows="2">{{ .Form.Reasoning }}</textarea>
                    {{ if .Form.FieldErrors.reasoning }}
                        <span class="ui small error text">{{ .Form.FieldErrors.reasoning }}</span>
                    {{ end }}
                </div>
                <button class="ui negative labeled icon button" type="submit">
                    <i class="trash icon"></i> Delete user
                </button>
                <a href="/users/" class="ui button">Cancel</a>
            </div>
        </form>
    </div>
{{ end }}