configcontext.html 7.7 KB

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