{% extends 'admin/layouts/default_sp.twig' %}
{% block title %}{{ _('I edit a category') }}{% endblock %}

{% block content %}
    <header><h1 class="in_menu sh_heading_main_b"><span class="h1_title">{{ _('I edit a category') }}</span></h1></header>

    <h2><span class="h2_inner">{{ _('Edit category') }}</span></h2>
    <form method="POST" class="admin-form">
        <input type="hidden" name="id" value="{{ req.get('id') }}"/>
        <input type="hidden" name="sig" value="{{ sig }}"/>
        <div class="form_area">
            <div class="form_contents">
                <h4>{{ _('Parent category') }}</h4>
                {{ input(req, 'category[parent_id]', 'select', {'options': category_parents}) }}
                {% if errors.parent_id %}<p class="error">{{ errors.parent_id }}</p>{% endif %}
            </div>
            <div class="form_contents">
                <h4>{{ _('Category name') }}</h4>
                <div class="common_input_text">{{ input(req, 'category[name]', 'text') }}</div>
                {% if errors.name %}<p class="error">{{ errors.name }}</p>{% endif %}
            </div>
            <div class="form_contents">
                <h4>{{ _('Sort by category') }}</h4>
                {{ input(req, 'category[category_order]', 'select', {'options': categories_model_order_list}) }}
                {% if errors.category_order %}<p class="error">{{ errors.category_order }}</p>{% endif %}
            </div>
            <div class="form_contents">
                <div class="btn">
                    <button type="submit" class="btn_contents positive touch"><i class="save_icon btn_icon"></i>{{ _('Update') }}</button>
                </div>
            </div>
        </div>
    </form>

    <div class="btn_area">
        <ul class="btn_area_inner">
            <li>
                <a class="btn_contents touch" href="{{ url(req, 'Categories', 'create') }}"><i class="return_icon btn_icon"></i>{{ _('I Back to List') }}</a>
            </li>
            {% if req.get('id') != 1 %}
                <li>
                    <a href="{{ url(req, 'Categories', 'delete', {id: req.get('id'), sig: sig}) }}" class="btn_contents touch"
                       onclick="return confirm('{{ _('If the child category exists\nRemove all along with the child category, but do you really want?') }}');"><i class="delete_icon btn_icon"></i>{{ _('Delete') }}</a>
                </li>
            {% endif %}
        </ul>
    </div>

{% endblock %}

Convert to Twig: SP's /admin/categories/edit
Convert to Twig: SP's /admin/categories/edit
