<div style="margin-bottom: 1em;">
    <h3>{$i.personalapp_ical_subscribe_username}</h3>
    <p style="margin-left: 1em;">
        <a class="dialog_make_text_btn ui-corner-all"
            href="{site_url url="/icalendar" webcal=1}">{$i.personalapp_icalendar_subscribe}
        </a>
    </p>
    
    <div style="margin: 1em 0 1em 1.1em;">
        {include file='r/view.tpl' name="login_data_username" title="auth_username" default=$login_data_username 
            main_style="padding: 2px; background: rgba(255, 255, 255, 0.8);"}
    </div>
</div>
<h3>{$i.personalapp_ical_my_tokens}</h3>
<div>
    {if !empty($my_tokens)}
        <table style="margin-left: 1em;">
            <thead>
                <tr>
                    <th scope="col">&nbsp;</th>
                    <th scope="col">{$i.personalapp_ical_calendar_of_staff}</th>
                    <th scope="col">{$i.personalapp_comment}</th>
                    <th scope="col">{$i.basic_url}</th>
                </tr>
            </thead>
            <tbody>
            {foreach from=$my_tokens item=my_token}
                <tr>
                    <td><span class="dialog_make_btn16 delete smallbtns ui-corner-all" onclick="personalapp.ical_token.delete({$my_token->id});" title="{$i.basic_delete}"></span></td>
                    <td>{$my_token->staff_name}</td>
                    <td>{$my_token->comment}</td>
                    <td>
                        {include file='r/input-only.tpl' name="ical_token_url_{$my_token->id}" default="{site_url()}icalendar/index/{$my_token->token}"
                            readonly=true class="t-midsmall"
                            main_style="background: rgba(255, 255, 255, 0.8);" labelclass="label1"}
                    </td>
                </tr>
            {/foreach}
            </tbody>
        </table>
    {else}
        <p style="margin-left: 1em;">
            {$i.personalapp_ical_no_tokens}
        </p>
    {/if}
    <div style="margin: 1em 0 1em 1.1em;">
        {include file='r/input-staff.tpl' name='ical_token_add_staff' data=$staff_list default=$staff_list_default
            add_iconsleft_file='basic_icon' 
            add_icons_class='dialog_make_btn16 add'
            add_icons_title=$i.personalapp_ical_add_token
            add_icons_onclick="personalapp.ical_token.add()"}
    </div>
</div>
<div style="margin-top: 1em;">
    {if !empty($others_tokens)}
        <h3>{$i.personalapp_ical_others_tokens}</h3>
        <table style="margin-left: 1em;">
            <thead>
                <tr>
                    <th scope="col">&nbsp;</th>
                    <th scope="col">{$i.basic_staff}</th>
                    <th scope="col">{$i.personalapp_ical_token}</th>
                </tr>
            </thead>
            <tbody>
            {foreach from=$others_tokens item=others_token}
                <tr>
                    <td><span class="dialog_make_btn16 delete smallbtns ui-corner-all" onclick="personalapp.ical_token.delete({$others_token->id});" title="{$i.basic_delete}"></span></td>
                    <td>{$others_token->created_by_name}</td>
                    <td>{str_pad(substr($others_token->token, 0, 10),  40, "*")}</td>
                </tr>
            {/foreach}
            </tbody>
        </table>
    {/if}
</div>