{% extends request.ajax ? "layout_blank.phtml" : "layout_default.phtml" %}
{% import "macro_functions.phtml" as mf %}
{% block meta_title %}{{ tld.tld }}{% endblock %}
{% set active_menu = 'system' %}

{% block breadcrumbs %}
<ul>
    <li class="firstB"><a href="{{ '/'|alink }}">{{ 'Home'|trans }}</a></li>
    <li><a href="{{ 'servicedomain'|alink }}">{{ 'Domain management'|trans }}</a></li>
    <li class="lastB">{{ tld.tld }}</li>
</ul>
{% endblock %}


{% block content %}

<div class="widget">

    <div class="head">
        <h5>{{ tld.tld }} {{ 'Top level domain management'|trans }}</h5>
    </div>

    <form method="post" action="{{ 'api/admin/servicedomain/tld_update'|link }}" class="mainForm save api-form" data-api-msg="Top level domain settings updated">
        <fieldset>
            <div class="rowElem noborder">
                <label>{{ 'Registrar'|trans }}:</label>
                <div class="formRight">
                    <select name="tld_registrar_id">
                        {% for id, title in admin.servicedomain_registrar_get_pairs %}
                        <option value="{{id}}" {% if id == tld.registrar.id %}selected="selected"{% endif %}>{{ title }}</option>
                        {% endfor %}
                    </select>
                </div>
                <div class="fix"></div>
            </div>

            <div class="rowElem">
                <label>{{ 'Registration price'|trans }}:</label>
                <div class="formRight">
                    <input type="text" name="price_registration" value="{{ tld.price_registration }}" required="required">
                </div>
                <div class="fix"></div>
            </div>

            <div class="rowElem">
                <label>{{ 'Renewal price'|trans }}:</label>
                <div class="formRight">
                    <input type="text" name="price_renew" value="{{ tld.price_renew }}" required="required">
                </div>
                <div class="fix"></div>
            </div>

            <div class="rowElem">
                <label>{{ 'Transfer price'|trans }}:</label>
                <div class="formRight">
                    <input type="text" name="price_transfer" value="{{ tld.price_transfer }}" required="required">
                </div>
                <div class="fix"></div>
            </div>

            <div class="rowElem">
                <label>{{ 'Minimum years of registration'|trans }}:</label>
                <div class="formRight">
                    <input type="text" name="min_years" value="{{ tld.min_years }}" required="required">
                </div>
                <div class="fix"></div>
            </div>

            <div class="rowElem">
                <label>{{ 'Allow registration'|trans }}:</label>
                <div class="formRight">
                    <input type="radio" name="allow_register" value="1"{% if tld.allow_register %} checked="checked"{% endif %}/><label>Yes</label>
                    <input type="radio" name="allow_register" value="0"{% if not tld.allow_register %} checked="checked"{% endif %} /><label>No</label>
                </div>
                <div class="fix"></div>
            </div>

            <div class="rowElem">
                <label>{{ 'Allow transfer'|trans }}:</label>
                <div class="formRight">
                    <input type="radio" name="allow_transfer" value="1"{% if tld.allow_transfer %} checked="checked"{% endif %}/><label>Yes</label>
                    <input type="radio" name="allow_transfer" value="0"{% if not tld.allow_transfer %} checked="checked"{% endif %} /><label>No</label>
                </div>
                <div class="fix"></div>
            </div>

            <div class="rowElem">
                <label>{{ 'Active'|trans }}:</label>
                <div class="formRight">
                    <input type="radio" name="active" value="1"{% if tld.active %} checked="checked"{% endif %}/><label>Yes</label>
                    <input type="radio" name="active" value="0"{% if not tld.active %} checked="checked"{% endif %} /><label>No</label>
                </div>
                <div class="fix"></div>
            </div>


            <input type="hidden" name="tld" value="{{ tld.tld }}" />
            <input type="submit" value="{{ 'Update'|trans }}" class="greyishBtn submitForm" />
        </fieldset>
    </form>
</div>

{% endblock %}