<div class="help">
    <h5>{% trans 'Hosting settings' %}</h5>
</div>

<form method="post" action="admin/product/update_config" class="mainForm api-form save" data-api-msg="Hosting settings updated">
<fieldset>
    <div class="rowElem">
        <label>{% trans 'Server' %}:</label>
        <div class="formRight noborder">
            {{ mf.selectbox('config[server_id]', admin.servicehosting_server_get_pairs, product.config.server_id, 0, 'Select server') }}
        </div>
        <div class="fix"></div>
    </div>
    <div class="rowElem">
        <label>{% trans 'Hosting plan' %}:</label>
        <div class="formRight">
            {{ mf.selectbox('config[hosting_plan_id]', admin.servicehosting_hp_get_pairs, product.config.hosting_plan_id, 0, 'Select hosting plan') }}
        </div>
        <div class="fix"></div>
    </div>
    <div class="rowElem">
        <label>{% trans 'Reseller hosting' %}:</label>
        <div class="formRight">
            <input type="radio" name="config[reseller]" value="1"{% if product.config.reseller %} checked="checked"{% endif %}/><label>Yes</label>
            <input type="radio" name="config[reseller]" value="0"{% if not product.config.reseller %} checked="checked"{% endif %} /><label>No</label>
        </div>
        <div class="fix"></div>
    </div>
    <div class="rowElem">
        <label>{% trans 'Free domain registration' %}:</label>
        <div class="formRight">
            <input type="radio" name="config[free_domain]" value="1"{% if product.config.free_domain %} checked="checked"{% endif %}/><label>Yes</label>
            <input type="radio" name="config[free_domain]" value="0"{% if not product.config.free_domain %} checked="checked"{% endif %} /><label>No</label>
        </div>
        <div class="fix"></div>
    </div>
    <div class="rowElem">
        <label>{% trans 'Free domain transfer' %}:</label>
        <div class="formRight">
            <input type="radio" name="config[free_transfer]" value="1"{% if product.config.free_transfer %} checked="checked"{% endif %}/><label>Yes</label>
            <input type="radio" name="config[free_transfer]" value="0"{% if not product.config.free_transfer %} checked="checked"{% endif %} /><label>No</label>
        </div>
        <div class="fix"></div>
    </div>

    <input type="submit" value="{% trans 'Update' %}" class="greyishBtn submitForm" />
</fieldset>
        
<input type="hidden" name="id" value="{{ product.id }}" />
</form>

<div class="help">
    <h5>{% trans 'Hosting plans' %}</h5>
</div>

<table class="tableStatic wide">
    <thead>
        <tr>
            <td>Title</td>
            <td style="width:5%">&nbsp;</td>
        </tr>
    </thead>
    <tbody>
        {% for id, plan in admin.servicehosting_hp_get_pairs %}
        <tr>
            <td>{{plan}}</td>
            <td class="actions"><a class="bb-button btn14" href="{{ '/servicehosting/plan'|alink }}/{{id}}"><img src="images/icons/dark/pencil.png" alt=""></a></td>
        </tr>
        {% else %}
        <tr>
            <td colspan="2">{% trans 'The list is empty' %}</td>
        </tr>
        {% endfor %}
    </tbody>
    <tfoot>
        <tr>
            <td colspan="2">
                <a href="{{ 'servicehosting#tab-new-plan'|alink }}" title="" class="btnIconLeft mr10 mt5"><img src="images/icons/dark/settings2.png" alt="" class="icon"><span>New hosting plan</span></a>
            </td>
        </tr>
    </tfoot>
</table>

<div class="help">
    <h5>{% trans 'Servers' %}</h5>
</div>

<table class="tableStatic wide">
    <thead>
        <tr>
            <td>Title</td>
            <td style="width:5%">&nbsp;</td>
        </tr>
    </thead>
    <tbody>
        {% for id, server in admin.servicehosting_server_get_pairs %}
        <tr>
            <td>{{server}}</td>
            <td class="actions"><a class="bb-button btn14" href="{{ '/servicehosting/server'|alink }}/{{id}}"><img src="images/icons/dark/pencil.png" alt=""></a></td>
        </tr>
        {% else %}
        <tr>
            <td colspan="7">{% trans 'The list is empty' %}</td>
        </tr>
        {% endfor %}
    </tbody>
    <tfoot>
        <tr>
            <td colspan="2">
                <a href="{{ 'servicehosting#tab-new-server'|alink }}" title="" class="btnIconLeft mr10 mt5"><img src="images/icons/dark/computer.png" alt="" class="icon"><span>New server</span></a>
            </td>
        </tr>
    </tfoot>
</table>
