
{style}
{literal}
    td.ow_action_price_td {
        padding: 5px;
    }
    
    input.price_input {
        width: 70px; 
        display: none;
    }
    tr td.ow_inprogress {
        background: url({/literal}{$imagesUrl}{literal}ajax_preloader_button.gif) no-repeat 7px 7px;
    }

    body .ow_disabled_state a { color: #bbaba2; }

    body .ow_disabled_state a, body .ow_enabled_state a { padding-right: 1px; }

    body .ow_disabled_state .lbutton_wrap, body .ow_enabled_state .lbutton_wrap {
        position:relative;
        float: right;
        width: 1px;
        height: 1px;
        margin-left: 1px;
    }

    body .ow_disabled_state .lbutton_wrap a, body .ow_enabled_state .lbutton_wrap a {
        position: absolute;
        display: none;
        top: 0;
        right: 0;
        padding-right: 3px;
    }

    tr.ow_disabled_state:hover a.action_enable, tr.ow_enabled_state:hover a.action_disable { display: block; }
{/literal}
{/style}

{$menu}

{block_decorator name='box' addClass='ow_std_margin'}{text key='usercredits+actions_description'}{/block_decorator}

{if $types && $showTypes}
<div class="ow_anno ow_center ow_stdmargin">
    {text key='usercredits+select_account_type'}: &nbsp;
    <select name="acc_type" onchange="location.href = '{$route}?type='+this.value;">
        {foreach from=$types item='type' key='name'}
        <option value="{$name}"{if $name == $accType} selected="selected"{/if}>{$type}</option>
        {/foreach}
    </select>
</div>
{/if}

<div class="ow_wide ow_automargin">
    {block_decorator name='box' langLabel='usercredits+earning_actions' iconClass='ow_ic_add' type='empty' addClass='ow_stdmargin'}
    {if $earning}
    <table class="ow_table_2 ow_smallmargin">
        <tr class="ow_alt2 ow_tr_first">
            <th><b>{text key='usercredits+actions'}</b></th>
            <th style="width: 130px"><b>{text key='usercredits+price_in_credits'}</b></th>
        </tr>
        {foreach from=$earning item='e' name='e'}
        <tr class="ow_alt1 {if $e.disabled}ow_disabled_state{else}ow_enabled_state{/if}{if $smarty.foreach.e.last} ow_tr_last{/if}">
            <td class="ow_txtleft">
                <div class="lbutton_wrap">
                    <a class="ow_lbutton ow_green action_enable" data-action="{$e.id}" href="javascript://">{text key='usercredits+enable'}</a>
                    <a class="ow_lbutton ow_red action_disable" data-action="{$e.id}" href="javascript://">{text key='usercredits+disable'}</a>
                </div>
                {text_edit key="`$e.pluginKey`+usercredits_action_`$e.actionKey`"}
            </td>
            <td class="ow_action_price_td">
            {if !empty($e.settingsRoute)}
                <a href="{url_for_route for=$e.settingsRoute}">{text key='admin+btn_label_edit'}</a>
            {else}
                <a class="ow_action_price" rel="{$e.id}" href="javascript://">{$e.amount}</a>
                <input class="price_input" type="text" id="price_input_{$e.id}" name="amount[{$e.id}]" value="{$e.amount}" /></td>
            {/if}
        </tr>
        {/foreach}
    </table>
    {else}
        <div class="ow_nocontent">{text key='usercredits+no_actions'}</div>
    {/if}
    {/block_decorator}

    {block_decorator name='box' langLabel='usercredits+spending_actions' iconClass='ow_ic_warning' type='empty' addClass='ow_stdmargin'}
    {if $losing}
    <table class="ow_table_2 ow_smallmargin">
        <tr class="ow_alt2 ow_tr_first">
            <td><b>{text key='usercredits+actions'}</b></td>
            <td style="width: 130px"><b>{text key='usercredits+price_in_credits'}</b></td>
        </tr>
        {foreach from=$losing item='l' name='l'}
        <tr class="ow_alt1 {if $l.disabled}ow_disabled_state{else}ow_enabled_state{/if}{if $smarty.foreach.l.last} ow_tr_last{/if}">
            <td class="ow_txtleft">
                <div class="lbutton_wrap">
                    <a class="ow_lbutton ow_green action_enable" data-action="{$l.id}" href="javascript://">{text key='usercredits+enable'}</a>
                    <a class="ow_lbutton ow_red action_disable" data-action="{$l.id}" href="javascript://">{text key='usercredits+disable'}</a>
                </div>
                {text_edit key="`$l.pluginKey`+usercredits_action_`$l.actionKey`"}
            </td>
            <td class="ow_action_price_td">
            {if !empty($l.settingsRoute)}
                <a href="{url_for_route for=$l.settingsRoute}">{text key='admin+btn_label_edit'}</a>
            {else}
                <a class="ow_action_price" rel="{$l.id}" href="javascript://">{$l.amount}</a>
                <input class="price_input" type="text" id="price_input_{$l.id}" name="amount[{$l.id}]" value="{$l.amount}" /></td>
            {/if}
        </tr>
        {/foreach}
    </table>
    {else}
        <div class="ow_nocontent">{text key='usercredits+no_actions'}</div>
    {/if}
    {/block_decorator}

    {if $unset}    
    {block_decorator name='box' langLabel='usercredits+unset_actions' iconClass='ow_ic_gear_wheel' type='empty' addClass='ow_stdmargin'}
    <table class="ow_table_2 ow_smallmargin">
        <tr class="ow_alt2 ow_tr_first">
            <td><b>{text key='usercredits+actions'}</b></td>
            <td style="width: 130px;"><b>{text key='usercredits+price'}</b></td>
        </tr>
        {foreach from=$unset item='u' name='u'}
        <tr class="ow_alt1 {if $u.disabled}ow_disabled_state{else}ow_enabled_state{/if}{if $smarty.foreach.u.last} ow_tr_last{/if}">
            <td class="ow_txtleft">
                <div class="lbutton_wrap">
                    <a class="ow_lbutton ow_green action_enable" data-action="{$u.id}" href="javascript://">{text key='usercredits+enable'}</a>
                    <a class="ow_lbutton ow_red action_disable" data-action="{$u.id}" href="javascript://">{text key='usercredits+disable'}</a>
                </div>
                {text_edit key="`$u.pluginKey`+usercredits_action_`$u.actionKey`"}
            </td>
            <td class="ow_action_price_td">
            {if !empty($u.settingsRoute)}
                <a href="{url_for_route for=$u.settingsRoute}">{text key='admin+btn_label_edit'}</a>
            {else}
                <a class="ow_action_price" rel="{$u.id}" href="javascript://">{$u.amount}</a>
                <input class="price_input" type="text" id="price_input_{$u.id}" name="amount[{$u.id}]" value="{$u.amount}" /></td>
            {/if}
        </tr>
        {/foreach}
    </table>
    {/block_decorator}
    {/if}
</div>