{% import 'colors_macro.html' as colors %}
{% extends "component_table.html" %}

{% block header_extra_col %}
{% endblock %}

{% block info_columns %}
  <td> {{ component.type.clean }} </td>
  {% if not component.subtype.is_empty() %} <td > {{ component.subtype.clean }} </td> {% endif %}
  {% if component.show_pincount %} <td > {{ component.pincount }}-pin </td> {% endif %}
  {% if component.color %}
      <td > {{ component.color }} </td>
      {{ colors.colorbar_cells(component.color, component.color.len) }}
  {% endif %}
{% endblock %}

{% block ports %}
  <table border="0" cellborder="1" cellpadding="3" cellspacing="0">
  {% for pin in component.pins_to_show()  %}
    <tr>
      {% if component.ports_left %}  <td port="p{{ pin.index + 1 }}l"> {{ pin.id }} </td> {% endif %}
      <td colspan="2"> {{ pin.label }} </td>
      {% if component.has_pincolors %}
      <td sides="TBL"> {{ pin.color }} </td>
      <td sides="TBR"> { colors.color_minitable(pin.color, pin.color.len) } </td>
      {% endif %}
      {% if component.ports_right %} <td port="p{{ pin.index + 1 }}r"> {{ pin.id }} </td> {% endif %}
    </tr>
  {% endfor %}
  </table>
{% endblock %}
