[% USE Math -%]
<div class="plan-container">
    <div class="plan">
        <div class="plan-header">
            <div class="plan-title">[% c.loc('Registered Devices') %]</div>
            <div class="plan-price">
                <span>[% reg_count %]</span>
                <span class="term">[% reg_count == 1 ? c.loc('Registered Device') : c.loc('Registered Devices') %]</span>
            </div>
        </div>
        <div class="plan-features large">
            <ul>
                [% IF reg_count == 0 -%]
                <li>[% c.loc('No devices registered') %]</li>
                [% ELSE -%]
                    [% FOR reg IN regs.all -%]
                    <li>
                        <div class="row-fluid">
                            <div>
                                [% IF reg.user_agent.length > 48 -%]
                                    [% ua = reg.user_agent.substr(45, reg.user_agent.length - 45, '...'); ua %]
                                [% ELSE -%]
                                    [% reg.user_agent %]
                                [% END -%]
                            </div>
                        </div>
                    </li>
                    [% END -%]
                [% END -%]
            </ul>
        </div>
        <div class="plan-actions">
            <a href="[% c.uri_for_action('/subscriber/reglist', [subscriber.id]) %]" class="btn">[% c.loc('View All Registered Devices') %]</a>
        </div>
    </div>
</div>
[% # vim: set tabstop=4 syntax=html expandtab: -%]
