{{ define "title"}}{{ t "page.edit_category.title" .category.Title }}{{ end }}

{{ define "page_header"}}
<section class="page-header" aria-labelledby="page-header-title">
    <h1 id="page-header-title">{{ t "page.edit_category.title" .category.Title }}</h1>
    <nav aria-label="{{ t "page.edit_category.title" .category.Title }} {{ t "menu.title" }}">
        <ul>
            <li>
                <a href="{{ routePath "/categories" }}">{{ icon "categories" }}{{ t "menu.categories" }}</a>
            </li>
            <li>
                <a href="{{ routePath "/category/%d/feeds" .category.ID }}">{{ icon "feeds" }}{{ t "menu.feeds" }}</a>
            </li>
            <li>
                <a href="{{ routePath "/category/create" }}">{{ icon "add-category" }}{{ t "menu.create_category" }}</a>
            </li>
        </ul>
    </nav>
</section>
{{ end }}

{{ define "content"}}
<form action="{{ routePath "/category/%d/update" .category.ID }}" method="post" autocomplete="off">
    <input type="hidden" name="csrf" value="{{ .csrf }}">

    {{ if .errorMessage }}
        <div role="alert" class="alert alert-error">{{ .errorMessage }}</div>
    {{ end }}

    <label for="form-title">{{ t "form.category.label.title" }}</label>
    <input type="text" name="title" id="form-title" value="{{ .form.Title }}" required autofocus>

    <label>
        <input type="checkbox" name="hide_globally" {{ if .form.HideGlobally }}checked{{ end }} value="1">
        {{ t "form.category.hide_globally" }}
    </label>

    <div class="buttons">
        <button type="submit" class="button button-primary" data-label-loading="{{ t "form.submit.saving" }}">{{ t "action.update" }}</button>
    </div>
</form>
{{ end }}
