The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
[% SET user_can_port_control = user_has_role('port_control') %]
<table class="table table-condensed table-striped">
  </tbody>
    <tr>
      <td>System Name</td>
      <td>[% d.name %]</td>
    </tr>
    <tr>
      <td>Location
      [% IF user_can_port_control %]
      <i class="icon-edit nd_edit-icon nd_device-details-edit"></i>
      [% END %]
      </td>
      [% IF user_can_port_control %]
      <td class="nd_editable-cell" contenteditable="true"
        data-field="location" data-for-device="[% d.ip %]">
          [% d.location | html_entity %]
      </td>
      [% ELSE %]
      <td>
        <a rel="tooltip" data-placement="top" data-offset="5" data-title="Find Similar Devices"
        href="[% search_device %]&location=[% d.location | uri %]">[% d.location | html_entity %]</a>
      </td>
      [% END %]
    </tr>
    <tr>
      <td>Contact
      [% IF user_can_port_control %]
      <i class="icon-edit nd_edit-icon nd_device-details-edit"></i>
      [% END %]
      </td>
      [% IF user_can_port_control %]
      <td class="nd_editable-cell" contenteditable="true"
        data-field="contact" data-for-device="[% d.ip | html_entity %]">
          [% d.contact | html_entity %]
      </td>
      [% ELSE %]
      <td>[% d.contact | html_entity %]</td>
      [% END %]
    </tr>
    <tr>
      <td>Vendor / Model</td>
      <td>
        <a rel="tooltip" data-placement="top" data-offset="5" data-title="Find Similar Devices"
        href="[% search_device %]&vendor=[% d.vendor | uri %]">[% d.vendor | html_entity %]</a>
        /
        <a rel="tooltip" data-placement="top" data-offset="5" data-title="Find Similar Devices"
        href="[% search_device %]&model=[% d.model | uri %]">[% d.model | html_entity %]</a>
      </td>
    </tr>
    <tr>
      <td>OS / Version</td>
      <td>[% d.os | html_entity %] /
        <a rel="tooltip" data-placement="top" data-offset="5"
          data-title="Find Similar Devices"
          href="[% search_device %]&os_ver=[% d.os_ver | uri %]">[% d.os_ver | html_entity %]</a>
      </td>
    </tr>
    <tr>
      <td>Serial Number</td>
      <td>[% d.serial | html_entity %]</td>
    </tr>
    <tr>
      <td>Description</td>
      <td>[% d.description | html_entity | html_line_break %]</td>
    </tr>
    <tr>
      <td>Uptime</td>
      <td>[% d.uptime_age | html_entity %]</td>
    </tr>
    <tr>
      <td>Last Discover</td>
      <td>[% d.last_discover_stamp | html_entity %]</td>
    </tr>
    <tr>
      <td>Last Arpnip</td>
      <td>[% d.last_arpnip_stamp | html_entity %]</td>
    </tr>
    <tr>
      <td>Last Macsuck</td>
      <td>[% d.last_macsuck_stamp | html_entity %]</td>
    </tr>
    <tr>
      <td>Hardware Status</td>
      <td>Fan: [% d.fan | html_entity %]
        <br/>PS1 [[% d.ps1_type | html_entity %]]: [% d.ps1_status | html_entity %]
        <br/>PS2 [[% d.ps2_type | html_entity %]]: [% d.ps2_status | html_entity %]</td>
    </tr>
    <tr>
      <td>MAC Address</td>
      <td>[% d.mac | html_entity %]</td>
    </tr>
    <tr>
      <td>VTP Domain</td>
      <td>[% d.vtp_domain | html_entity %]</td>
    </tr>
    [% IF user_has_role('admin') %]
    <tr data-for-device="[% d.dns || d.ip %]">
      <td>Admin Tasks</td>
      <td>
        <input type="hidden" data-form="discover" value="[% d.ip %]" name="device" type="text"/>
        <button class="btn btn-info btn-small nd_adminbutton" name="discover" type="submit">Discover</button>
        <input type="hidden" data-form="arpnip" value="[% d.ip %]" name="device" type="text"/>
        <button class="btn btn-info btn-small nd_adminbutton" name="arpnip" type="submit">Arpnip</button>
        <input type="hidden" data-form="macsuck" value="[% d.ip %]" name="device" type="text"/>
        <button class="btn btn-info btn-small nd_adminbutton" name="macsuck" type="submit">Macsuck</button>
      </td>
    </tr>
    [% END %]
  </tbody>
</table>