circuit.html 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. {% extends '_base.html' %}
  2. {% load helpers %}
  3. {% block title %}{{ circuit }}{% endblock %}
  4. {% block header %}
  5. <div class="row">
  6. <div class="col-sm-8 col-md-9">
  7. <ol class="breadcrumb">
  8. <li><a href="{% url 'circuits:circuit_list' %}">Circuits</a></li>
  9. <li><a href="{% url 'circuits:circuit_list' %}?provider={{ circuit.provider.slug }}">{{ circuit.provider }}</a></li>
  10. <li>{{ circuit.cid }}</li>
  11. </ol>
  12. </div>
  13. <div class="col-sm-4 col-md-3">
  14. <form action="{% url 'circuits:circuit_list' %}" method="get">
  15. <div class="input-group">
  16. <input type="text" name="q" class="form-control" />
  17. <span class="input-group-btn">
  18. <button type="submit" class="btn btn-primary">
  19. <span class="fa fa-search" aria-hidden="true"></span>
  20. </button>
  21. </span>
  22. </div>
  23. </form>
  24. </div>
  25. </div>
  26. <div class="pull-right">
  27. {% if perms.circuits.change_circuit %}
  28. <a href="{% url 'circuits:circuit_edit' pk=circuit.pk %}" class="btn btn-warning">
  29. <span class="fa fa-pencil" aria-hidden="true"></span>
  30. Edit this circuit
  31. </a>
  32. {% endif %}
  33. {% if perms.circuits.delete_circuit %}
  34. <a href="{% url 'circuits:circuit_delete' pk=circuit.pk %}" class="btn btn-danger">
  35. <span class="fa fa-trash" aria-hidden="true"></span>
  36. Delete this circuit
  37. </a>
  38. {% endif %}
  39. </div>
  40. <h1>{{ circuit }}</h1>
  41. {% include 'inc/created_updated.html' with obj=circuit %}
  42. <ul class="nav nav-tabs">
  43. <li role="presentation"{% if not active_tab %} class="active"{% endif %}>
  44. <a href="{{ circuit.get_absolute_url }}">Circuit</a>
  45. </li>
  46. <li role="presentation"{% if active_tab == 'changelog' %} class="active"{% endif %}>
  47. <a href="{% url 'circuits:circuit_changelog' pk=circuit.pk %}">Changelog</a>
  48. </li>
  49. </ul>
  50. {% endblock %}
  51. {% block content %}
  52. <div class="row">
  53. <div class="col-md-6">
  54. <div class="panel panel-default">
  55. <div class="panel-heading">
  56. <strong>Circuit</strong>
  57. </div>
  58. <table class="table table-hover panel-body attr-table">
  59. <tr>
  60. <td>Status</td>
  61. <td>
  62. <span class="label label-{{ circuit.get_status_class }}">{{ circuit.get_status_display }}</span>
  63. </td>
  64. </tr>
  65. <tr>
  66. <td>Provider</td>
  67. <td>
  68. <a href="{% url 'circuits:provider' slug=circuit.provider.slug %}">{{ circuit.provider }}</a>
  69. </td>
  70. </tr>
  71. <tr>
  72. <td>Circuit ID</td>
  73. <td>{{ circuit.cid }}</td>
  74. </tr>
  75. <tr>
  76. <td>Type</td>
  77. <td><a href="{{ circuit.type.get_absolute_url }}">{{ circuit.type }}</a></td>
  78. </tr>
  79. <tr>
  80. <td>Tenant</td>
  81. <td>
  82. {% if circuit.tenant %}
  83. {% if circuit.tenant.group %}
  84. <a href="{{ circuit.tenant.group.get_absolute_url }}">{{ circuit.tenant.group }}</a>
  85. <i class="fa fa-angle-right"></i>
  86. {% endif %}
  87. <a href="{{ circuit.tenant.get_absolute_url }}">{{ circuit.tenant }}</a>
  88. {% else %}
  89. <span class="text-muted">None</span>
  90. {% endif %}
  91. </td>
  92. </tr>
  93. <tr>
  94. <td>Install Date</td>
  95. <td>
  96. {% if circuit.install_date %}
  97. {{ circuit.install_date }}
  98. {% else %}
  99. <span class="text-muted">N/A</span>
  100. {% endif %}
  101. </td>
  102. </tr>
  103. <tr>
  104. <td>Commit Rate</td>
  105. <td>
  106. {% if circuit.commit_rate %}
  107. {{ circuit.commit_rate|humanize_speed }}
  108. {% else %}
  109. <span class="text-muted">N/A</span>
  110. {% endif %}
  111. </td>
  112. </tr>
  113. <tr>
  114. <td>Description</td>
  115. <td>
  116. {% if circuit.description %}
  117. {{ circuit.description }}
  118. {% else %}
  119. <span class="text-muted">N/A</span>
  120. {% endif %}
  121. </td>
  122. </tr>
  123. </table>
  124. </div>
  125. {% include 'inc/custom_fields_panel.html' with obj=circuit %}
  126. {% include 'extras/inc/tags_panel.html' with tags=circuit.tags.all url='circuits:circuit_list' %}
  127. <div class="panel panel-default">
  128. <div class="panel-heading">
  129. <strong>Comments</strong>
  130. </div>
  131. <div class="panel-body rendered-markdown">
  132. {% if circuit.comments %}
  133. {{ circuit.comments|gfm }}
  134. {% else %}
  135. <span class="text-muted">None</span>
  136. {% endif %}
  137. </div>
  138. </div>
  139. </div>
  140. <div class="col-md-6">
  141. {% include 'circuits/inc/circuit_termination.html' with termination=termination_a side='A' %}
  142. {% include 'circuits/inc/circuit_termination.html' with termination=termination_z side='Z' %}
  143. </div>
  144. </div>
  145. {% endblock %}