virtualchassis_edit.html 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. {% extends 'utilities/obj_edit.html' %}
  2. {% load form_helpers %}
  3. {% block content %}
  4. {{ block.super }}
  5. <div class="row">
  6. <div class="col-md-6 col-md-offset-3">
  7. <h3>Memberships</h3>
  8. <div class="panel panel-default">
  9. <table class="table panel-body">
  10. <tr class="table-headings">
  11. <th>Device</th>
  12. <th>Position</th>
  13. <th>Master</th>
  14. <th>Priority</th>
  15. <th></th>
  16. </tr>
  17. {% for vcm in form.instance.memberships.all %}
  18. <tr>
  19. <td>
  20. <a href="{{ vcm.device.get_absolute_url }}">{{ vcm.device }}</a>
  21. </td>
  22. <td>{{ vcm.position }}</td>
  23. <td>{% if vcm.is_master %}<i class="fa fa-check"></i>{% endif %}</td>
  24. <td>{{ vcm.priority|default:"" }}</td>
  25. <td class="text-right">
  26. {% if perms.dcim.change_vcmembership %}
  27. <a href="{% url 'dcim:vcmembership_edit' pk=vcm.pk %}?return_url={% url 'dcim:virtualchassis_edit' pk=vcm.virtual_chassis.pk %}" class="btn btn-warning btn-xs">
  28. <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> Edit
  29. </a>
  30. {% endif %}
  31. {% if perms.dcim.delete_vcmembership %}
  32. <a href="{% url 'dcim:vcmembership_delete' pk=vcm.pk %}?return_url={% url 'dcim:virtualchassis_edit' pk=vcm.virtual_chassis.pk %}" class="btn btn-danger btn-xs">
  33. <span class="glyphicon glyphicon-trash" aria-hidden="true"></span> Delete
  34. </a>
  35. {% endif %}
  36. </td>
  37. </tr>
  38. {% endfor %}
  39. </table>
  40. </div>
  41. </div>
  42. </div>
  43. {% endblock %}