aboutsummaryrefslogtreecommitdiff
path: root/lava_scheduler_app/templates/lava_scheduler_app/_device_base.html
blob: a43194c88a575e54849197c0445f2597f8f78dac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
{% extends "layouts/content-bootstrap.html" %}

{% load django_tables2 %}

{% block styles %}
  <style>
    details, summary { display: block; padding: 0.2em; }
    summary { cursor: pointer; }
    summary:hover, summary:focus { background: #ddd; }
    .no-details details > * { display: none; }
    .no-details details.open > * { display: block; }
    .no-details details summary:before { width: 20px; content: '► '; }
    .no-details details.open summary:before { content: '▼ '; }
    .no-details details summary { display: block; }
    .ui-button { width: 250px }
    dd {padding-left: 1em; padding-right: 1em;}
    dt {padding-right: 1em;}
    .oneline { white-space: nowrap; }
  </style>
{% endblock %}

{% block content %}

{% if device.device_type.owners_only %}
<div class="alert alert-warning alert-dismissable">
  <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
  <p><strong><i>{{  device.device_type.name }}</i> is a hidden device type.</strong></p>
  Only owners of one or more devices of type <i>{{ device.device_type }}</i> can see this information.
</div>
{% endif %}

{% block device_heading %}{% endblock %}

<div class="row">
  <div class="col-md-4">
    <h4 class="modal-header">Device</h4>
    <dl class="dl-horizontal">
      <dt>Hostname</dt>
      <dd>{{ device.hostname }}</dd>
      <dt>Type</dt>
      <dd><a href="{{ device.device_type.get_absolute_url }}">{{ device.device_type }}</a></dd>
{% if device.is_pipeline %}
    <dt>Configuration</dt>
  <dd><a href="#" data-toggle="modal" id="devicedict-modal"
         data-target="#devicedictModal"> Device Dictionary</a>
    <div class="modal fade" id="devicedictModal" tabindex="-1" role="dialog" aria-labelledby="devicedictLabel" aria-hidden="true">
      <div class="modal-dialog modal-lg">
        <div class="modal-content">
          <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
            <h4 class="modal-title" id="devicedictLabel">Device Dictionary for {{ device.hostname }}</h4>
          </div>
          <div class="modal-body">
            <div id="devicedict-content">
            <pre>{{ device.device_dictionary_yaml }}</pre>
            </div>
          </div>
          <div class="modal-footer">
            <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
          </div>
        </div>
      </div>
    </div>
  </dd>
{% endif %}
      <dt>Description</dt>
      <dd>{{ device.get_description|default:"<i>None</i>"|truncatewords_html:200|wordwrap:80|linebreaksbr }}</dd>
      <dt>Tags</dt>
    {% for tag in device.tags.all %}
      <dd>{{ tag.name }}
      {% if tag.description %}
        <abbr title="{{ tag.description }}">(?)</abbr>
      {% endif %}
      </dd>
    {% empty %}
      <dd><i>None</i></dd>
    {% endfor %}
      <dt>Version</dt>
      <dd>{{ device.device_version|default:"<i>Unknown</i>" }}</dd>
    </dl>
  </div>
  <div class="col-md-4">
    <h4 class="modal-header">Owners and status</h4>
    <dl class="dl-horizontal">
      <dt>Owner <abbr title="If specified, submissions to {{ device.hostname }} are restricted to this user or group.">(?)</abbr></dt>
      <dd>
          {% if device.user %}
          <a href="mailto:{{ device.user.email }}">{{ device.user.email }}</a>
          {% elif device.group %}
          Group <em>{{ device.group }}</em>
          {% else %}
          <i>Unrestricted</i>
          {% endif %}
      </dd>
      <dt>Physical access <abbr title="If known, this is the user or group with physical access to {{ device.hostname }}.">(?)</abbr></dt>
      <dd>
          {% if device.physical_owner %}
          <a href="mailto:{{ device.physical_owner.email }}">{{ device.physical_owner.email }}</a>
          {% elif device.physical_group %}
          Group <em>{{ device.physical_group }}</em>
          {% else %}
          <i>Unknown</i>
          {% endif %}
      </dd>
{% if not device.temporarydevice %}
      <dt>Worker</dt>
      <dd>
        {% if device.too_long_since_last_heartbeat %}
          <span class="glyphicon glyphicon-thumbs-down text-danger"></span>
        {% else %}
          <span class="glyphicon glyphicon-thumbs-up text-success"></span>
        {% endif %}
        {% if device.worker_host.is_master %}
          <b><a href="{{ device.worker_host.get_absolute_url }}">{{ device.worker_host.hostname }}</a></b>
        {% else %}
          <a href="{{ device.worker_host.get_absolute_url }}">{{ device.worker_host.hostname }}</a>
        {% endif %}
      </dd>
{% endif %}
    {% if exclusive %}
        <dt>Exclusive</dt>
        <dd><b>pipeline jobs only</b>.</dd>
    {% elif pipeline %}
        <dt>Pipeline</dt>
        <dd>{{ device.hostname }} accepts both pipeline and JSON jobs.</dd>
    {% else %}
        <dt>Pipeline</dt>
        <dd><b>False</b>. JSON jobs only.</dd>
    {% endif %}
    </dl>
  </div>
  <div class="col-md-4">
    <h4 class="modal-header">Reports</h4>
    <dl class="dl-horizontal">
      <dt>Status</dt>
      <dd>
        {{ device.get_status_display }}
        {% if transition %}
        (reason: <i>{{ transition }}</i>)
        {% endif %}
        {% if device.current_job %}
        (<a href="{{ device.current_job.get_absolute_url }}">Job {{ device.current_job.pk }}</a>)
        {% endif %}
      </dd>
{% if device.device_type.name != 'dynamic-vm' %}
      <dt>Health</dt>
      <dd>{{ device.get_health_status_display }}</dd>
      <dt>Checks/failures</dt>
      <dd><a href="{% url 'lava.scheduler.device_report' device.pk %}">Graphical reports</a></dd>
{% endif %}
    </dl>
  </div>
</div>
<div class="row">
  <div class="col-md-6">
    <h4 class="modal-header">Actions</h4>
    <div class="row">
      <div class="col-md-6">
{% if show_maintenance %}
        <div class="btn-group btn-group-justified">
          <div class="btn-group">
            <button class="btn btn-primary" data-toggle="modal" data-target="#maintenanceDialog">Maintenance</button>
            <div class="modal fade" id="maintenanceDialog" tabindex="-1" role="dialog" aria-labelledby="maintenanceDialoglabel" aria-hidden="true">
              <div class="modal-dialog">
                <div class="modal-content">
                  <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title" id="maintenanceDialoglabel">Reason for offlining</h4>
                  </div>
                  <div class="modal-body">
                    <form role="form" method="post" action="{% url 'lava.scheduler.device.maintenance' device.pk %}">
                      <div id="maintenance-container" class="form-group has-error has-feedback">
                        <p>a reason must be specified:</p>
                        <input id="maintenance-reason" name="reason"/>
                        {% csrf_token %}
                        <div id="maintenance-feedback">
                        </div>
                      </div>
                      <dl class="dl-horizontal">
                        {% if device.current_job %}
                        <div class="form-group">
                          <input type="checkbox" name="notify" value="{{user.email}}">notify {{ user.email }} when job {{ device.current_job.id }} is complete.
                        </div>
                        {% endif %}
                        <div class="form-group">
                          <div id="maintenance-submit">
                          </div>
                        </div>
                      </dl>
                    </form>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
{% endif %}
{% if cancel_looping %}
        <div class="btn-group btn-group-justified">
          <div class="btn-group">
            <button class="btn btn-warning" data-toggle="modal" data-target="#stoploopingDialog">Cancel Looping mode</button>
            <div class="modal fade" id="stoploopingDialog" tabindex="-1" role="dialog" aria-labelledby="stoploopingDialoglabel" aria-hidden="true">
              <div class="modal-dialog">
                <div class="modal-content">
                  <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title" id="stoploopingDialoglabel">Reason for stopping looping mode</h4>
                  </div>
                  <div class="modal-body">
                    <form role="form" method="post" action="{% url 'lava.scheduler.device.maintenance' device.pk %}">
                      <div id="stoplooping-container" class="form-group has-error has-feedback">
                        <p>A reason must be specified:</p>
                        <input id="stoplooping-reason" name="reason"/>
                        {% csrf_token %}
                        <div id="stoplooping-feedback">
                        </div>
                      </div>
                      <dl class="dl-horizontal">
                        <div class="form-group">
                          <div id="stoplooping-submit">
                          </div>
                        </div>
                      </dl>
                    </form>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
{% endif %}
{% if show_online %}
        <div class="btn-group btn-group-justified">
          <div class="btn-group">
            <button class="btn btn-primary" data-toggle="modal" data-target="#onlineDialog">Put online</button>
            <div class="modal fade" id="onlineDialog" tabindex="-1" role="dialog" aria-labelledby="onlineDialoglabel" aria-hidden="true">
              <div class="modal-dialog">
                <div class="modal-content">
                  <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title" id="onlineDialoglabel">Reason for onlining</h4>
                  </div>
                  <div class="modal-body">
                    <form role="form" method="post" action="{% url 'lava.scheduler.device.online' device.pk %}">
                      <div id="online-container" class="form-group has-error has-feedback">
                        <p>A reason must be specified:</p>
                        <input id="online-reason" name="reason"/>
                        {% csrf_token %}
                        <input type="checkbox" name="skiphealthcheck" value="True"/> Skip manual health check <abbr
                        title="An automatic health check may still run if one is already due.">(?)</abbr>
                        <div id="online-feedback">
                        </div>
                      </div>
                      <dl class="dl-horizontal">
                        <div class="form-group">
                          <div id="online-submit">
                          </div>
                        </div>
                      </dl>
                    </form>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
        <div class="btn-group btn-group-justified">
          <div class="btn-group">
            <button class="btn btn-warning" data-toggle="modal" data-target="#loopingDialog">Looping mode</button>
            <div class="modal fade" id="loopingDialog" tabindex="-1" role="dialog" aria-labelledby="loopingDialoglabel" aria-hidden="true">
              <div class="modal-dialog">
                <div class="modal-content">
                  <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title" id="loopingDialoglabel">Reason for looping health checks</h4>
                  </div>
                  <div class="modal-body">
                    <form role="form" method="post" action="{% url 'lava.scheduler.device.looping' device.pk %}">
                      <div id="looping-container" class="form-group has-error has-feedback">
                        <p>A reason must be specified:</p>
                        <input id="looping-reason" name="reason"/>
                        {% csrf_token %}
                        <div id="looping-feedback">
                        </div>
                      </div>
                      <dl class="dl-horizontal">
                        <div class="form-group">
                          <div id="looping-submit">
                          </div>
                        </div>
                      </dl>
                    </form>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
{% endif %}
{% if show_forcehealthcheck %}
        <div class="btn-group btn-group-justified">
          <div class="btn-group">
            <form role="form" method="POST" action="{% url 'lava.scheduler.device.forcehealthcheck' device.pk %}">
              {% csrf_token %}
              <button class="btn btn-info" id="forcehealthcheck-button">Force Health Check</button>
            </form>
          </div>
        </div>
{% endif %}
      </div>

      <div class="col-md-6">
        {% if user.is_authenticated and user.is_superuser %}
        <div class="btn-group btn-group-justified">
          <div class="btn-group">
            <a href="{% url 'admin:lava_scheduler_app_device_change' device.pk %}" class="btn btn-danger" title="Admin this device - {{ device.hostname }}">
              Admin this device
            </a>
          </div>
        </div>
        {% endif %}
{% if edit_description %}
        <div class="btn-group btn-group-justified">
          <div class="btn-group">
            <button class="btn btn-default" data-toggle="modal" data-target="#descriptionDialog">Edit description</button>
            <div class="modal fade" id="descriptionDialog" tabindex="-1" role="dialog" aria-labelledby="descriptionDialoglabel" aria-hidden="true">
              <div class="modal-dialog">
                <div class="modal-content">
                  <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title" id="descriptionDialoglabel">Edit device description</h4>
                  </div>
                  <div class="modal-body">
                    <form role="form" method="post" action="{% url 'lava.scheduler.device.edit_description' device.pk %}">
                      <div id="description-container" class="form-group">
                        <p>An empty description will clear the existing content</p>
                        <input id="device-description" name="desc" value="{{ device.get_description }}"/>
                        {% csrf_token %}
                      </div>
                      <dl class="dl-horizontal">
                        <div class="form-group">
                          <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
                          <button type="submit" class="btn btn-success">Set</button>
                        </div>
                      </dl>
                    </form>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
{% endif %}
{% if show_restrict %}
        <div class="btn-group btn-group-justified">
          <div class="btn-group">
            <button class="btn btn-danger" data-toggle="modal" data-target="#restrictDialog">Restrict submission</button>
            <div class="modal fade" id="restrictDialog" tabindex="-1" role="dialog" aria-labelledby="restrictDialoglabel" aria-hidden="true">
              <div class="modal-dialog">
                <div class="modal-content">
                  <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title" id="restrictDialoglabel">Reasons for restricting {{ device.hostname }}</h4>
                  </div>
                  <div class="modal-body">
                    <form role="form" method="post" action="{% url 'lava.scheduler.device.restrict_device' device.pk %}">
                      <div id="restrict-container" class="form-group has-error has-feedback">
                        <p>A reason must be specified:</p>
                        <input id="restrict-reason" name="reason"/>
                        {% csrf_token %}
                        <div id="restrict-feedback">
                        </div>
                      </div>
                      <dl class="dl-horizontal">
                        <div class="form-group">
                          <div id="restrict-submit">
                          </div>
                        </div>
                      </dl>
                    </form>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
{% endif %}
{% if show_pool %}
        <div class="btn-group btn-group-justified">
          <div class="btn-group">
            <button class="btn btn-danger" data-toggle="modal" data-target="#poolDialog">Return {{ device.hostname }} to the pool</button>
            <div class="modal fade" id="poolDialog" tabindex="-1" role="dialog" aria-labelledby="poolDialoglabel" aria-hidden="true">
              <div class="modal-dialog">
                <div class="modal-content">
                  <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title" id="poolDialoglabel">Reasons for returning {{ device.hostname }} to the pool</h4>
                  </div>
                  <div class="modal-body">
                    <form role="form" method="post" action="{% url 'lava.scheduler.device.derestrict_device' device.pk %}">
                      <div id="derestrict-container" class="form-group has-error has-feedback">
                        <p>A reason must be specified:</p>
                        <input id="derestrict-reason" name="reason"/>
                        {% csrf_token %}
                        <div id="derestrict-feedback">
                        </div>
                      </div>
                      <dl class="dl-horizontal">
                      {% if device.current_job %}
                        <div class="form-group">
                          <input type="checkbox" name="notify" value="{{user.email}}">Notify {{ user.email }} when job {{ device.current_job.id }} is complete.
                        </div>
                        {% endif %}
                        <div class="form-group">
                          <div id="derestrict-submit">
                          </div>
                        </div>
                      </dl>
                    </form>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
{% endif %}
      </div>

  </div>
  </div>
</div>


{% block content_columns %}
{% endblock %}

<h3>Status transitions</h3>
  {% render_table transition_table %}

{% endblock %}

{% block scripts %}
<script type="text/javascript" src="{{ STATIC_URL }}lava_scheduler_app/js/jquery.details.min.js"></script>
<script type="text/javascript" src="{{ STATIC_URL }}lava_scheduler_app/js/jquery.jeditable.mini.js"></script>
<script type="text/javascript" src="{{ STATIC_URL }}lava_scheduler_app/js/tables.js"></script>

<script>
  $(document).ready(
    function() {
  {% if show_maintenance %}
      $("#maintenance-feedback").html('<span class="glyphicon glyphicon-remove form-control-feedback"></span>');
  {% endif %}
  {% if show_online %}
      $("#online-feedback").html('<span class="glyphicon glyphicon-remove form-control-feedback"></span>');
  {% endif %}
  {% if show_restrict %}
      $("#restrict-feedback").html('<span class="glyphicon glyphicon-remove form-control-feedback"></span>');
  {% endif %}
  {% if show_pool %}
      $("#derestrict-feedback").html('<span class="glyphicon glyphicon-remove form-control-feedback"></span>');
  {% endif %}
    });
  {% if show_maintenance %}
      $("#maintenance-container").keydown(
          function(e) {
                  if (document.getElementById("maintenance-reason").value!=""){
                      $("#maintenance-feedback").html('<span class="glyphicon glyphicon-ok form-control-feedback"></span>')
                      $("#maintenance-submit").html('<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>' +
                              '<button type="submit" class="btn btn-primary">Put {{ device.hostname }} offline</button>');
                  } else {
                      $("#maintenance-feedback").html('<span class="glyphicon glyphicon-remove form-control-feedback"></span>&nbsp;')
                      $("#maintenance-submit").html('<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>')
                  }
            }
      )
      $("#stoplooping-container").keydown(
          function(e) {
                  if (document.getElementById("stoplooping-reason").value!="") {
                      $("#stoplooping-feedback").html('<span class="glyphicon glyphicon-ok form-control-feedback"></span>')
                      $("#stoplooping-submit").html('<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>' +
                              '<button type="submit" class="btn btn-primary">Cancel looping mode</button>');
                  } else {
                      $("#stoplooping-feedback").html('<span class="glyphicon glyphicon-remove form-control-feedback"></span>&nbsp;')
                      $("#stoplooping-submit").html('<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>')
                  }
          }
      )
  {% endif %}
  {% if show_online %}
      $("#online-container").keydown(
          function(e) {
                  if (document.getElementById("online-reason").value!=""){
                      $("#online-feedback").html('<span class="glyphicon glyphicon-ok form-control-feedback"></span>')
                      $("#online-submit").html('<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>' +
                              '<button type="submit" class="btn btn-primary">Put {{ device.hostname }} online</button>');
                  } else {
                      $("#online-feedback").html('<span class="glyphicon glyphicon-remove form-control-feedback"></span>&nbsp;')
                      $("#online-submit").html('<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>')
                  }
            }
      )
      $("#looping-container").keydown(
          function(e) {
                  if (document.getElementById("looping-reason").value!="") {
                      $("#looping-feedback").html('<span class="glyphicon glyphicon-ok form-control-feedback"></span>')
                      $("#looping-submit").html('<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>' +
                              '<button type="submit" class="btn btn-primary">Put {{ device.hostname }} into looping mode</button>');
                  } else {
                      $("#looping-feedback").html('<span class="glyphicon glyphicon-remove form-control-feedback"></span>&nbsp;')
                      $("#looping-submit").html('<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>')
                  }
          }
      )
  {% endif %}
  {% if show_restrict %}
      $("#restrict-container").keydown(
          function(e) {
                  if (document.getElementById("restrict-reason").value!=""){
                      $("#restrict-feedback").html('<span class="glyphicon glyphicon-ok form-control-feedback"></span>')
                      $("#restrict-submit").html('<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>' +
                              '<button type="submit" class="btn btn-primary">Restrict {{ device.hostname }} </button>');
                  } else {
                      $("#restrict-feedback").html('<span class="glyphicon glyphicon-remove form-control-feedback"></span>&nbsp;')
                      $("#restrict-submit").html('<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>')
                  }
            }
      )
  {% endif %}
  {% if show_pool %}
      $("#derestrict-container").keydown(
          function(e) {
                  if (document.getElementById("derestrict-reason").value!=""){
                      $("#derestrict-feedback").html('<span class="glyphicon glyphicon-ok form-control-feedback"></span>')
                      $("#derestrict-submit").html('<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>' +
                              '<button type="submit" class="btn btn-primary">Return {{ device.hostname }} to the pool</button>');
                  } else {
                      $("#derestrict-feedback").html('<span class="glyphicon glyphicon-remove form-control-feedback"></span>&nbsp;')
                      $("#derestrict-submit").html('<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>')
                  }
            }
      )
  {% endif %}
</script>

{% endblock %}