[% USE Math -%]
<div class="plan-container">
    <div class="plan">
        <div class="plan-header">
            <div class="plan-title">[% c.loc('Call List') %]</div>
            <div class="plan-price">
                <span>[% calls.size %]</span>
                <span class="term">[% calls.size != 1 ? c.loc('Recent Calls') : c.loc('Recent Call') %]</span>
            </div>
        </div>
        <div class="plan-features large">
            <ul>
                [% IF calls.size == 0 -%]
                <li>[% c.loc('No calls yet') %]</li>
                [% ELSE -%]
                    [% FOR call IN calls -%]
                    <li>
                        <div class="row-fluid">
                        [% IF call.source_user_id == c.user.uuid -%]
                            <div class="span1">
                            [% IF call.call_status == "ok" -%]
                                <i class="icon-circle-arrow-right" style="color:green"></i>
                            [% ELSE -%]
                                <i class="icon-circle-arrow-up" style="color:red"></i>
                            [% END -%]
                            </div>
                            <div class="span8">[% call.destination_user_in | uri_unescape %]</div>
                        [% ELSE -%]
                            <div class="span1">
                            [% IF call.call_status == "ok" -%]
                                <i class="icon-circle-arrow-left" style="color:green"></i>
                            [% ELSE -%]
                                <i class="icon-circle-arrow-down" style="color:red"></i>
                            [% END -%]
                            </div>
                            <div class="span8">[% call.clir ? "anonymous" : call.source_cli | uri_unescape %]</div>
                        [% END -%]
                        </div>
                        <div class="row-fluid">
                            <div class="offset1 span8">[% call.start_time -%]</div>
                            <div class="span1">[% Math.int(call.duration) -%]s</div>
                        </div>
                    </li>
                    [% END -%]
                [% END -%]
            </ul>
        </div>
        <div class="plan-actions">
            <a href="[% c.uri_for_action('/subscriber/calllist', [subscriber.id]) %]" class="btn">[% c.loc('View Call List') %]</a>
        </div>
    </div>
</div>
[% # vim: set tabstop=4 syntax=html expandtab: -%]
