module.html 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. {% extends 'generic/object.html' %}
  2. {% load helpers %}
  3. {% load plugins %}
  4. {% load tz %}
  5. {% load i18n %}
  6. {% block breadcrumbs %}
  7. {{ block.super }}
  8. <li class="breadcrumb-item">
  9. <a href="{% url 'dcim:module_list' %}?module_type_id={{ object.module_type.pk }}">{{ object.module_type }}</a>
  10. </li>
  11. {% endblock %}
  12. {% block extra_controls %}
  13. {% if perms.dcim.change_module %}
  14. <div class="dropdown">
  15. <button id="add-components" type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
  16. <i class="mdi mdi-plus-thick" aria-hidden="true"></i> {% trans "Add Components" %}
  17. </button>
  18. <ul class="dropdown-menu" aria-labeled-by="add-components">
  19. {% if perms.dcim.add_consoleport %}
  20. <li><a class="dropdown-item" href="{% url 'dcim:consoleport_add' %}?device={{ object.device.pk }}&module={{ object.pk }}&return_url={{ object.get_absolute_url }}">{% trans "Console Ports" %}</a></li>
  21. {% endif %}
  22. {% if perms.dcim.add_consoleserverport %}
  23. <li><a class="dropdown-item" href="{% url 'dcim:consoleserverport_add' %}?device={{ object.device.pk }}&module={{ object.pk }}&return_url={{ object.get_absolute_url }}">{% trans "Console Server Ports" %}</a></li>
  24. {% endif %}
  25. {% if perms.dcim.add_powerport %}
  26. <li><a class="dropdown-item" href="{% url 'dcim:powerport_add' %}?device={{ object.device.pk }}&module={{ object.pk }}&return_url={{ object.get_absolute_url }}">{% trans "Power Ports" %}</a></li>
  27. {% endif %}
  28. {% if perms.dcim.add_poweroutlet %}
  29. <li><a class="dropdown-item" href="{% url 'dcim:poweroutlet_add' %}?device={{ object.device.pk }}&module={{ object.pk }}&return_url={{ object.get_absolute_url }}">{% trans "Power Outlets" %}</a></li>
  30. {% endif %}
  31. {% if perms.dcim.add_interface %}
  32. <li><a class="dropdown-item" href="{% url 'dcim:interface_add' %}?device={{ object.device.pk }}&module={{ object.pk }}&return_url={{ object.get_absolute_url }}">{% trans "Interfaces" %}</a></li>
  33. {% endif %}
  34. {% if perms.dcim.add_frontport %}
  35. <li><a class="dropdown-item" href="{% url 'dcim:frontport_add' %}?device={{ object.device.pk }}&module={{ object.pk }}&return_url={{ object.get_absolute_url }}">{% trans "Front Ports" %}</a></li>
  36. {% endif %}
  37. {% if perms.dcim.add_rearport %}
  38. <li><a class="dropdown-item" href="{% url 'dcim:rearport_add' %}?device={{ object.device.pk }}&module={{ object.pk }}&return_url={{ object.get_absolute_url }}">{% trans "Rear Ports" %}</a></li>
  39. {% endif %}
  40. {% if perms.dcim.add_modulebay %}
  41. <li><a class="dropdown-item" href="{% url 'dcim:modulebay_add' %}?device={{ object.device.pk }}&module={{ object.pk }}&return_url={{ object.get_absolute_url }}">{% trans "Module Bays" %}</a></li>
  42. {% endif %}
  43. </ul>
  44. </div>
  45. {% endif %}
  46. {% endblock %}
  47. {% block content %}
  48. <div class="row">
  49. <div class="col col-12 col-md-6">
  50. <div class="card">
  51. <h2 class="card-header">{% trans "Module" %}</h2>
  52. <table class="table table-hover attr-table">
  53. <tr>
  54. <th scope="row">{% trans "Device" %}</th>
  55. <td>{{ object.device|linkify }}</td>
  56. </tr>
  57. <tr>
  58. <th scope="row">{% trans "Device Type" %}</th>
  59. <td>{{ object.device.device_type|linkify }}</td>
  60. </tr>
  61. <tr>
  62. <th scope="row">{% trans "Module Type" %}</th>
  63. <td>{{ object.module_type|linkify:"full_name" }}</td>
  64. </tr>
  65. <tr>
  66. <th scope="row">{% trans "Status" %}</th>
  67. <td>{% badge object.get_status_display bg_color=object.get_status_color %}</td>
  68. </tr>
  69. <tr>
  70. <th scope="row">{% trans "Description" %}</th>
  71. <td>{{ object.description|placeholder }}</td>
  72. </tr>
  73. <tr>
  74. <th scope="row">{% trans "Serial Number" %}</th>
  75. <td class="font-monospace">{{ object.serial|placeholder }}</td>
  76. </tr>
  77. <tr>
  78. <th scope="row">{% trans "Asset Tag" %}</th>
  79. <td class="font-monospace">{{ object.asset_tag|placeholder }}</td>
  80. </tr>
  81. </table>
  82. </div>
  83. {% include 'inc/panels/tags.html' %}
  84. {% include 'inc/panels/comments.html' %}
  85. {% plugin_left_page object %}
  86. </div>
  87. <div class="col col-12 col-md-6">
  88. {% include 'inc/panels/related_objects.html' %}
  89. {% include 'inc/panels/custom_fields.html' %}
  90. {% plugin_right_page object %}
  91. </div>
  92. </div>
  93. <div class="row">
  94. <div class="col col-md-12">
  95. {% plugin_full_width_page object %}
  96. </div>
  97. </div>
  98. {% endblock %}