<script>
enqueLists.push([{
    res: 'cfs',
    widgetName: "SubscriberCFOverview",
    cb: function(data) {
        //console.log(data);
        var cfs = data.widget_data;
        var mcount = 0;
        for (var type in cfs) {
            var cf_mappings = cfs[type];
            $("#subscriber_cf_overview_lazy_items_list").append('<li>' +
                cf_mappings.desc + ' <strong style="color:' +
                (cf_mappings.mappings.length > 0 ?
                    'green">[% c.escape_js(c.loc('active')) %]'
                :
                    'grey">[% c.escape_js(c.loc('inactive')) %]'
                ) + '</strong>' +
                '</li>');
            mcount += cf_mappings.mappings.length;
        }
        $("#subscriber_cf_overview_lazy_loading").remove();
        $("#subscriber_cf_overview_lazy_items_header").append(
            '<div class="plan-price">' +
                '<span>' + mcount + '</span>' +
                '<span class="term">' + (mcount == 1 ? '[% c.escape_js(c.loc('Call Forward Configured')) %]' : '[% c.escape_js(c.loc('Call Forwards Configured')) %]') + '</span>' +
            '</div>');
    }
}]);
</script>
<div class="plan-container">
    <div class="plan">
        <div class="plan-header" id="subscriber_cf_overview_lazy_items_header">
            <div class="plan-title">[% c.loc('Call Forwards') %]</div>
            <div class="plan-price widget-loading" id="subscriber_cf_overview_lazy_loading"><span>0</span><span class="term">processing ...</span></div>
        </div>
        <div class="plan-features large">
            <ul id="subscriber_cf_overview_lazy_items_list">
            </ul>
        </div>
        <div class="plan-actions">
            <a href="[% c.uri_for_action('/subscriber/preferences', [c.user.voip_subscriber.id]) %]" class="btn">[% c.loc('Configure Preferences') %]</a>
        </div>
    </div>
</div>
[% # vim: set tabstop=4 syntax=html expandtab: -%]
