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

<div class="widget first">

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

    <form method="post" action="admin/servicedomain/tld_update" class="mainForm save api-form" data-api-msg="Top level domain settings updated">
        <fieldset>
            <div class="rowElem noborder">
                <label>{% trans 'Registrar' %}:</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>{% trans 'Registration price' %}:</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>{% trans 'Renewal price' %}:</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>{% trans 'Transfer price' %}:</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>{% trans 'Minimum years of registration' %}:</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>{% trans 'Allow registration' %}:</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>{% trans 'Allow transfer' %}:</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>{% trans 'Active' %}:</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="{% trans 'Update' %}" class="greyishBtn submitForm" />
        </fieldset>
    </form>

    <div class="body">
        <a href="{{ 'servicedomain'|alink }}"  title="" class="btnIconLeft mr10"><img src="images/icons/dark/arrowLeft.png" alt="" class="icon"><span>Go back</span></a>
    </div>
    
    <div class="fix"></div>
</div>

{% endblock %}