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

<form method="post" action="admin/product/update" class="mainForm api-form save" data-api-msg="Settings updated">
<fieldset>
    <div class="rowElem noborder">
        <label>{% trans 'Enable stock control' %}:</label>
        <div class="formRight">
            <input type="radio" name="stock_control" value="1"{% if product.stock_control %} checked="checked"{% endif %}/><label>Yes</label>
            <input type="radio" name="stock_control" value="0"{% if not product.stock_control %} checked="checked"{% endif %} /><label>No</label>
        </div>
        <div class="fix"></div>
    </div>
    
    <div class="rowElem">
        <label>{% trans 'Allow quantity select on order form' %}:</label>
        <div class="formRight">
            <input type="radio" name="allow_quantity_select" value="1"{% if product.allow_quantity_select %} checked="checked"{% endif %}/><label>Yes</label>
            <input type="radio" name="allow_quantity_select" value="0"{% if not product.allow_quantity_select %} checked="checked"{% endif %} /><label>No</label>
        </div>
        <div class="fix"></div>
    </div>

    <div class="rowElem">
        <label>{% trans 'Quantity in stock' %}:</label>
        <div class="formRight">
            <input type="text" name="quantity_in_stock" value="{{ product.quantity_in_stock }}">
        </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 'Plugin' %}</h5>
</div>

<form method="post" action="admin/product/update" class="mainForm api-form save" data-api-msg="Settings updated">
<fieldset>
    <div class="rowElem noborder">
        <label>{% trans 'Plugin name' %}:</label>
        <div class="formRight">
            <input type="text" name="plugin" value="{{ product.plugin }}"/>
        </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>

<form method="post" action="admin/product/update_config" class="mainForm save api-form" data-api-reload="1">
    <fieldset>
        <legend>Custom parameters</legend>
        {% for k,v in product.config %}
        <div class="rowElem">
            <label>{{k}}:</label>
            <div class="formRight">
                <input type="text" name="config[{{k}}]" value="{{v}}">
            </div>
            <div class="fix"></div>
        </div>
        {% endfor %}
    </fieldset>
    
    <fieldset>
        <legend>Add custom parameter</legend>
        <div class="rowElem">
            <label>Parameter name:</label>
            <div class="formRight">
                <input type="text" name="new_config_name">
            </div>
            <div class="fix"></div>
        </div>

        <div class="rowElem">
            <label>Parameter value:</label>
            <div class="formRight noborder">
                <textarea rows="7" cols="" name="new_config_value"></textarea>
            </div>
            <div class="fix"></div>
        </div>
        <input type="submit" value="{% trans 'Update configuration fields' %}" class="greyishBtn submitForm" />
        <div class="fix"></div>
        <input type="hidden" name="id" value="{{ product.id }}"/>
    </fieldset>
</form>