[%
  cfs = [ { type = "cfu", desc = c.loc("Call Forward Unconditional") },
          { type = "cfb", desc = c.loc("Call Forward Busy") },
          { type = "cft", desc = c.loc("Call Forward Timeout") },
          { type = "cfna", desc = c.loc("Call Forward Unavailable") } ];
  cfcount = 0;
  FOR cf IN cfs;
    IF cf_destinations.${cf.type}.size;
      cfcount = cfcount + 1;
    END;
  END;
-%]

<div class="plan-container">
    <div class="plan">
        <div class="plan-header">
            <div class="plan-title">[% c.loc('Call Forwards') %]</div>
            <div class="plan-price">
                <span>[% cfcount %]</span>
                <span class="term">[% cfcount == 1 ? c.loc('Call Forward Configured') : c.loc('Call Forwards Configured') %]</span>
            </div>
        </div>
        <div class="plan-features large">
            <ul>
            [% FOR cf IN cfs -%]
                <li>
                    [% cf.desc %] [% cf_destinations.${cf.type}.size ? '<strong style="color:green">' _ c.loc('active') : '<strong color="grey">' _ c.loc('inactive') %]</strong>
                </li>

            [% END -%]
            </ul>
        </div>
        <div class="plan-actions">
            <a href="[% c.uri_for_action('/subscriber/preferences', [subscriber.id]) %]" class="btn">[% c.loc('Configure Preferences') %]</a>
        </div>
    </div>
</div>
[% # vim: set tabstop=4 syntax=html expandtab: -%]
