configcontext.html 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. {% extends '_base.html' %}
  2. {% load helpers %}
  3. {% load static %}
  4. {% block header %}
  5. <div class="row noprint">
  6. <div class="col-sm-8 col-md-9">
  7. <ol class="breadcrumb">
  8. <li><a href="{% url 'extras:configcontext_list' %}">Config Contexts</a></li>
  9. <li>{{ configcontext }}</li>
  10. </ol>
  11. </div>
  12. <div class="col-sm-4 col-md-3">
  13. <form action="{% url 'extras:configcontext_list' %}" method="get">
  14. <div class="input-group">
  15. <input type="text" name="q" class="form-control" />
  16. <span class="input-group-btn">
  17. <button type="submit" class="btn btn-primary">
  18. <span class="fa fa-search" aria-hidden="true"></span>
  19. </button>
  20. </span>
  21. </div>
  22. </form>
  23. </div>
  24. </div>
  25. <div class="pull-right noprint">
  26. {% if perms.extras.change_configcontext %}
  27. <a href="{% url 'extras:configcontext_edit' pk=configcontext.pk %}" class="btn btn-warning">
  28. <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>
  29. Edit this config context
  30. </a>
  31. {% endif %}
  32. </div>
  33. <h1>{% block title %}{{ configcontext }}{% endblock %}</h1>
  34. {% endblock %}
  35. {% block content %}
  36. <div class="row">
  37. <div class="col-md-5">
  38. <div class="panel panel-default">
  39. <div class="panel-heading">
  40. <strong>Config Context</strong>
  41. </div>
  42. <table class="table table-hover panel-body attr-table">
  43. <tr>
  44. <td>Name</td>
  45. <td>
  46. {{ configcontext.name }}
  47. </td>
  48. </tr>
  49. <tr>
  50. <td>Weight</td>
  51. <td>
  52. {{ configcontext.weight }}
  53. </td>
  54. </tr>
  55. <tr>
  56. <td>Description</td>
  57. <td>{{ configcontext.description|placeholder }}</td>
  58. </tr>
  59. <tr>
  60. <td>Active</td>
  61. <td>
  62. {% if configcontext.is_active %}
  63. <span class="text-success">
  64. <i class="fa fa-check"></i>
  65. </span>
  66. {% else %}
  67. <span class="text-danger">
  68. <i class="fa fa-close"></i>
  69. </span>
  70. {% endif %}
  71. </td>
  72. </tr>
  73. </table>
  74. </div>
  75. <div class="panel panel-default">
  76. <div class="panel-heading">
  77. <strong>Assignment</strong>
  78. </div>
  79. <table class="table table-hover panel-body attr-table">
  80. <tr>
  81. <td>Regions</td>
  82. <td>
  83. {% if configcontext.regions.all %}
  84. <ul>
  85. {% for region in configcontext.regions.all %}
  86. <li><a href="{{ region.get_absolute_url }}">{{ region }}</a></li>
  87. {% endfor %}
  88. </ul>
  89. {% else %}
  90. <span class="text-muted">None</span>
  91. {% endif %}
  92. </td>
  93. </tr>
  94. <tr>
  95. <td>Sites</td>
  96. <td>
  97. {% if configcontext.sites.all %}
  98. <ul>
  99. {% for site in configcontext.sites.all %}
  100. <li><a href="{{ site.get_absolute_url }}">{{ site }}</a></li>
  101. {% endfor %}
  102. </ul>
  103. {% else %}
  104. <span class="text-muted">None</span>
  105. {% endif %}
  106. </td>
  107. </tr>
  108. <tr>
  109. <td>Roles</td>
  110. <td>
  111. {% if configcontext.roles.all %}
  112. <ul>
  113. {% for role in configcontext.roles.all %}
  114. <li><a href="{% url 'dcim:device_list' %}?role={{ role.slug }}">{{ role }}</a></li>
  115. {% endfor %}
  116. </ul>
  117. {% else %}
  118. <span class="text-muted">None</span>
  119. {% endif %}
  120. </td>
  121. </tr>
  122. <tr>
  123. <td>Platforms</td>
  124. <td>
  125. {% if configcontext.platforms.all %}
  126. <ul>
  127. {% for platform in configcontext.platforms.all %}
  128. <li><a href="{{ platform.get_absolute_url }}">{{ platform }}</a></li>
  129. {% endfor %}
  130. </ul>
  131. {% else %}
  132. <span class="text-muted">None</span>
  133. {% endif %}
  134. </td>
  135. </tr>
  136. <tr>
  137. <td>Cluster Groups</td>
  138. <td>
  139. {% if configcontext.cluster_groups.all %}
  140. <ul>
  141. {% for cluster_group in configcontext.cluster_groups.all %}
  142. <li><a href="{{ cluster_group.get_absolute_url }}">{{ cluster_group }}</a></li>
  143. {% endfor %}
  144. </ul>
  145. {% else %}
  146. <span class="text-muted">None</span>
  147. {% endif %}
  148. </td>
  149. </tr>
  150. <tr>
  151. <td>Clusters</td>
  152. <td>
  153. {% if configcontext.clusters.all %}
  154. <ul>
  155. {% for cluster in configcontext.clusters.all %}
  156. <li><a href="{{ cluster.get_absolute_url }}">{{ cluster }}</a></li>
  157. {% endfor %}
  158. </ul>
  159. {% else %}
  160. <span class="text-muted">None</span>
  161. {% endif %}
  162. </td>
  163. </tr>
  164. <tr>
  165. <td>Tenant Groups</td>
  166. <td>
  167. {% if configcontext.tenant_groups.all %}
  168. <ul>
  169. {% for tenant_group in configcontext.tenant_groups.all %}
  170. <li><a href="{{ tenant_group.get_absolute_url }}">{{ tenant_group }}</a></li>
  171. {% endfor %}
  172. </ul>
  173. {% else %}
  174. <span class="text-muted">None</span>
  175. {% endif %}
  176. </td>
  177. </tr>
  178. <tr>
  179. <td>Tenants</td>
  180. <td>
  181. {% if configcontext.tenants.all %}
  182. <ul>
  183. {% for tenant in configcontext.tenants.all %}
  184. <li><a href="{{ tenant.get_absolute_url }}">{{ tenant }}</a></li>
  185. {% endfor %}
  186. </ul>
  187. {% else %}
  188. <span class="text-muted">None</span>
  189. {% endif %}
  190. </td>
  191. </tr>
  192. <tr>
  193. <td>Tags</td>
  194. <td>
  195. {% if configcontext.tags.all %}
  196. <ul>
  197. {% for tag in configcontext.tags.all %}
  198. <li><a href="{{ tag.get_absolute_url }}">{{ tag }}</a></li>
  199. {% endfor %}
  200. </ul>
  201. {% else %}
  202. <span class="text-muted">None</span>
  203. {% endif %}
  204. </td>
  205. </tr>
  206. </table>
  207. </div>
  208. </div>
  209. <div class="col-md-7">
  210. <div class="panel panel-default">
  211. <div class="panel-heading">
  212. <strong>Data</strong>
  213. {% include 'extras/inc/configcontext_format.html' %}
  214. </div>
  215. <div class="panel-body">
  216. {% include 'extras/inc/configcontext_data.html' with data=configcontext.data %}
  217. </div>
  218. </div>
  219. </div>
  220. </div>
  221. {% endblock %}
  222. {% block javascript %}
  223. <script src="{% static 'js/configcontext.js' %}?v{{ settings.VERSION }}"></script>
  224. {% endblock %}