configcontext.html 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  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="mdi mdi-magnify" 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="mdi mdi-pencil" aria-hidden="true"></span>
  29. Edit this config context
  30. </a>
  31. {% endif %}
  32. </div>
  33. <ul class="nav nav-tabs">
  34. <li role="presentation"{% if not active_tab %} class="active"{% endif %}>
  35. <a href="{{ configcontext.get_absolute_url }}">Config Context</a>
  36. </li>
  37. {% if perms.extras.view_objectchange %}
  38. <li role="presentation"{% if active_tab == 'changelog' %} class="active"{% endif %}>
  39. <a href="{% url 'extras:configcontext_changelog' pk=configcontext.pk %}">Change Log</a>
  40. </li>
  41. {% endif %}
  42. </ul>
  43. <h1>{% block title %}{{ configcontext }}{% endblock %}</h1>
  44. {% endblock %}
  45. {% block content %}
  46. <div class="row">
  47. <div class="col-md-5">
  48. <div class="panel panel-default">
  49. <div class="panel-heading">
  50. <strong>Config Context</strong>
  51. </div>
  52. <table class="table table-hover panel-body attr-table">
  53. <tr>
  54. <td>Name</td>
  55. <td>
  56. {{ configcontext.name }}
  57. </td>
  58. </tr>
  59. <tr>
  60. <td>Weight</td>
  61. <td>
  62. {{ configcontext.weight }}
  63. </td>
  64. </tr>
  65. <tr>
  66. <td>Description</td>
  67. <td>{{ configcontext.description|placeholder }}</td>
  68. </tr>
  69. <tr>
  70. <td>Active</td>
  71. <td>
  72. {% if configcontext.is_active %}
  73. <span class="text-success">
  74. <i class="mdi mdi-check-bold"></i>
  75. </span>
  76. {% else %}
  77. <span class="text-danger">
  78. <i class="mdi mdi-close"></i>
  79. </span>
  80. {% endif %}
  81. </td>
  82. </tr>
  83. </table>
  84. </div>
  85. <div class="panel panel-default">
  86. <div class="panel-heading">
  87. <strong>Assignment</strong>
  88. </div>
  89. <table class="table table-hover panel-body attr-table">
  90. <tr>
  91. <td>Regions</td>
  92. <td>
  93. {% if configcontext.regions.all %}
  94. <ul>
  95. {% for region in configcontext.regions.all %}
  96. <li><a href="{{ region.get_absolute_url }}">{{ region }}</a></li>
  97. {% endfor %}
  98. </ul>
  99. {% else %}
  100. <span class="text-muted">None</span>
  101. {% endif %}
  102. </td>
  103. </tr>
  104. <tr>
  105. <td>Sites</td>
  106. <td>
  107. {% if configcontext.sites.all %}
  108. <ul>
  109. {% for site in configcontext.sites.all %}
  110. <li><a href="{{ site.get_absolute_url }}">{{ site }}</a></li>
  111. {% endfor %}
  112. </ul>
  113. {% else %}
  114. <span class="text-muted">None</span>
  115. {% endif %}
  116. </td>
  117. </tr>
  118. <tr>
  119. <td>Roles</td>
  120. <td>
  121. {% if configcontext.roles.all %}
  122. <ul>
  123. {% for role in configcontext.roles.all %}
  124. <li><a href="{% url 'dcim:device_list' %}?role={{ role.slug }}">{{ role }}</a></li>
  125. {% endfor %}
  126. </ul>
  127. {% else %}
  128. <span class="text-muted">None</span>
  129. {% endif %}
  130. </td>
  131. </tr>
  132. <tr>
  133. <td>Platforms</td>
  134. <td>
  135. {% if configcontext.platforms.all %}
  136. <ul>
  137. {% for platform in configcontext.platforms.all %}
  138. <li><a href="{{ platform.get_absolute_url }}">{{ platform }}</a></li>
  139. {% endfor %}
  140. </ul>
  141. {% else %}
  142. <span class="text-muted">None</span>
  143. {% endif %}
  144. </td>
  145. </tr>
  146. <tr>
  147. <td>Cluster Groups</td>
  148. <td>
  149. {% if configcontext.cluster_groups.all %}
  150. <ul>
  151. {% for cluster_group in configcontext.cluster_groups.all %}
  152. <li><a href="{{ cluster_group.get_absolute_url }}">{{ cluster_group }}</a></li>
  153. {% endfor %}
  154. </ul>
  155. {% else %}
  156. <span class="text-muted">None</span>
  157. {% endif %}
  158. </td>
  159. </tr>
  160. <tr>
  161. <td>Clusters</td>
  162. <td>
  163. {% if configcontext.clusters.all %}
  164. <ul>
  165. {% for cluster in configcontext.clusters.all %}
  166. <li><a href="{{ cluster.get_absolute_url }}">{{ cluster }}</a></li>
  167. {% endfor %}
  168. </ul>
  169. {% else %}
  170. <span class="text-muted">None</span>
  171. {% endif %}
  172. </td>
  173. </tr>
  174. <tr>
  175. <td>Tenant Groups</td>
  176. <td>
  177. {% if configcontext.tenant_groups.all %}
  178. <ul>
  179. {% for tenant_group in configcontext.tenant_groups.all %}
  180. <li><a href="{{ tenant_group.get_absolute_url }}">{{ tenant_group }}</a></li>
  181. {% endfor %}
  182. </ul>
  183. {% else %}
  184. <span class="text-muted">None</span>
  185. {% endif %}
  186. </td>
  187. </tr>
  188. <tr>
  189. <td>Tenants</td>
  190. <td>
  191. {% if configcontext.tenants.all %}
  192. <ul>
  193. {% for tenant in configcontext.tenants.all %}
  194. <li><a href="{{ tenant.get_absolute_url }}">{{ tenant }}</a></li>
  195. {% endfor %}
  196. </ul>
  197. {% else %}
  198. <span class="text-muted">None</span>
  199. {% endif %}
  200. </td>
  201. </tr>
  202. <tr>
  203. <td>Tags</td>
  204. <td>
  205. {% if configcontext.tags.all %}
  206. <ul>
  207. {% for tag in configcontext.tags.all %}
  208. <li><a href="{{ tag.get_absolute_url }}">{{ tag }}</a></li>
  209. {% endfor %}
  210. </ul>
  211. {% else %}
  212. <span class="text-muted">None</span>
  213. {% endif %}
  214. </td>
  215. </tr>
  216. </table>
  217. </div>
  218. </div>
  219. <div class="col-md-7">
  220. <div class="panel panel-default">
  221. <div class="panel-heading">
  222. <strong>Data</strong>
  223. {% include 'extras/inc/configcontext_format.html' %}
  224. </div>
  225. <div class="panel-body">
  226. {% include 'extras/inc/configcontext_data.html' with data=configcontext.data format=format %}
  227. </div>
  228. </div>
  229. </div>
  230. </div>
  231. {% endblock %}