{% extends "layout_default.phtml" %}
{% set active_menu = 'products' %}
{% block meta_title %}Product addon management{% endblock %}

{% block breadcrumbs %}
<ul>
    <li class="firstB"><a href="{{ '/'|alink }}">{{ 'Home'|trans }}</a></li>
    <li><a href="{{ 'product'|alink }}">{{ 'Products'|trans }}</a></li>
    <li><a href="{{ 'product/addons'|alink }}">{{ 'Addons'|trans }}</a></li>
    <li class="lastB">{{product.title}}</li>
</ul>
{% endblock %}

{% block content %}
<div class="widget">

    <div class="head">
        <h5>{{ 'Edit product addon'|trans }}</h5>
    </div>

<form method="post" action="{{ 'api/admin/product/addon_update'|link }}" class="mainForm api-form save" data-api-msg="Addon updated">
    <fieldset>
        <div class="rowElem">
            <label>{{ 'Status'|trans }}:</label>
            <div class="formRight">
                <input type="radio" name="status" value="enabled"{% if product.status == 'enabled' %} checked="checked"{% endif %}/><label>Enabled</label>
                <input type="radio" name="status" value="disabled"{% if product.status == 'disabled' %} checked="checked"{% endif %} /><label>Disabled</label>
            </div>
            <div class="fix"></div>
        </div>
        <div class="rowElem">
            <label>{{ 'Activation'|trans }}:</label>
            <div class="formRight">
                <input type="radio" name="setup" value="after_order"{% if product.setup == 'after_order' %} checked="checked"{% endif %}/><label>After order is placed</label>
                <input type="radio" name="setup" value="after_payment"{% if product.setup == 'after_payment' %} checked="checked"{% endif %} /><label>After payment is received</label>
                <input type="radio" name="setup" value="manual"{% if product.setup == 'manual' %} checked="checked"{% endif %} /><label>Manual activation</label>
            </div>
            <div class="fix"></div>
        </div>

        <div class="rowElem">
            <label>{{ 'Icon'|trans }}:</label>
            <div class="formRight">
                <input type="text" name="icon_url" value="{{product.icon_url}}" placeholder=""/>
            </div>
            <div class="fix"></div>
        </div>
        <div class="rowElem">
            <label>{{ 'Title'|trans }}:</label>
            <div class="formRight">
                <input type="text" name="title" value="{{product.title}}" required="required" placeholder=""/>
            </div>
            <div class="fix"></div>
        </div>
        <div class="rowElem">
            <label>{{ 'Description'|trans }}:</label>
            <div class="formRight">
                <textarea name="description" cols="5" rows="5">{{product.description}}</textarea>
            </div>
            <div class="fix"></div>
        </div>

        {% include "partial_pricing.phtml" with {'product': product} %}

        <input type="submit" value="{{ 'Update'|trans }}" class="greyishBtn submitForm" />
    </fieldset>

    <input type="hidden" name="id" value="{{ product.id }}" />
</form>
</div>



{% endblock %}