rearport.html 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <tr class="rearport{% if rearport.cable.status %} success{% elif rearport.cable %} info{% endif %}">
  2. {# Checkbox #}
  3. {% if perms.dcim.change_rearport or perms.dcim.delete_rearport %}
  4. <td class="pk">
  5. <input name="pk" type="checkbox" value="{{ rearport.pk }}" />
  6. </td>
  7. {% endif %}
  8. {# Name #}
  9. <td>
  10. <i class="fa fa-fw fa-square{% if not rearport.cable %}-o{% endif %}"></i> {{ rearport }}
  11. </td>
  12. {# Type #}
  13. <td>{{ rearport.get_type_display }}</td>
  14. {# Positions #}
  15. <td>{{ rearport.positions }}</td>
  16. {# Cable #}
  17. <td>
  18. {% if rearport.cable %}
  19. <a href="{{ rearport.cable.get_absolute_url }}">{{ rearport.cable }}</a>
  20. {% else %}
  21. <span class="text-muted">Not connected</span>
  22. {% endif %}
  23. </td>
  24. {# Actions #}
  25. <td class="text-right">
  26. {% if rearport.cable %}
  27. {% include 'dcim/inc/cable_toggle_buttons.html' with cable=rearport.cable %}
  28. {% elif perms.dcim.add_cable %}
  29. <a href="{% url 'dcim:rearport_connect' termination_a_id=rearport.pk %}?return_url={{ device.get_absolute_url }}" class="btn btn-success btn-xs" title="Connect">
  30. <i class="glyphicon glyphicon-resize-small" aria-hidden="true"></i>
  31. </a>
  32. {% endif %}
  33. {% if perms.dcim.change_rearport %}
  34. <a href="{% url 'dcim:rearport_edit' pk=rearport.pk %}?return_url={{ device.get_absolute_url }}" title="Edit port" class="btn btn-info btn-xs">
  35. <i class="glyphicon glyphicon-pencil" aria-hidden="true"></i>
  36. </a>
  37. {% endif %}
  38. {% if perms.dcim.delete_rearport %}
  39. <a href="{% url 'dcim:rearport_delete' pk=rearport.pk %}?return_url={{ device.get_absolute_url }}" title="Delete port" class="btn btn-danger btn-xs">
  40. <i class="glyphicon glyphicon-trash" aria-hidden="true"></i>
  41. </a>
  42. {% endif %}
  43. </td>
  44. </tr>