The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
[% USE Number.Format %]
<div class="accordion" id="accordion-radio-pwr">
[% count = 0 %]
[% FOREACH row IN results %]
  [% NEXT UNLESS row.power_modules.size %]
  [% count = count + 1 %]
  <div class="accordion-group">
      <div class="accordion-heading"> 
          <a class="accordion-toggle" data-toggle="collapse" data-target="#collapse-[% count %]" href="#collapse-[% count %]">
            <i class="icon-chevron-down"></i> &nbsp;
            [% row.dns || row.name %] &nbsp;
            ( [% row.model %] ) &nbsp;
            [% IF row.location %]
              Location: [% row.location %]
            [% END %]
          </a>
      </div>
      <div id="collapse-[% count %]" class="accordion-body collapse in">
        <div class="accordion-inner">
        <table class="table table-bordered table-condensed">
          <thead>
            <tr>
              <th>PoE<br>Module</th>            
              <th class="nd_center-cell">Power<br>(W)</th>
              <th class="nd_center-cell">Supply</th>
              <th class="nd_center-cell">Capable<br>Ports</th>
              <th class="nd_center-cell">Powered<br>Ports</th>
              <th class="nd_center-cell">Disabled<br>Ports</th>
              <th class="nd_center-cell">Errored<br>Ports</th>
              <th class="nd_center-cell">Committed<br>(W)</th>
              <th class="nd_center-cell">Delivering<br>(W)</th>
            </tr>
          </thead>
          <tbody>
          [% FOREACH m IN row.power_modules %]
            <tr>
              <td class="nd_center-cell">[% m.module %]</td>
              <td class="nd_center-cell">[% m.power | format_number %]</td>
              <td class="nd_center-cell">[% m.status %]</td>
              <td class="nd_center-cell">[% m.capable_ports %]</td>
              <td class="nd_center-cell">[% m.powered_ports %]</td>
              <td class="nd_center-cell">[% m.disabled_ports %]</td>
              <td class="nd_center-cell">[% m.errored_ports %]</td>
              <td class="nd_center-cell">[% m.pwr_committed | format_number %]</td>
              <td class="nd_center-cell">[% m.pwr_delivering | format_number %]</td>
            </tr>
          [% END %]
          </tbody>
        </table>
      </div>
    </div>
  </div>
[%END%]
</div>

<script>
$('.accordion').on('show hide', function (n) {
    $(n.target).siblings('.accordion-heading').find('.accordion-toggle i').toggleClass('icon-chevron-up icon-chevron-down');
});
</script>