2017-09-15 10:40:37 +00:00
|
|
|
{% load i18n %}
|
|
|
|
{% if request.user.is_superuser %}
|
2021-07-07 11:12:38 +00:00
|
|
|
<a href="#addInstanceOwner" type="button" class="btn btn-success float-end" data-bs-toggle="modal">
|
2020-05-19 16:53:54 +00:00
|
|
|
<span class="fa fa-plus" aria-hidden="true"></span>
|
2017-09-15 10:40:37 +00:00
|
|
|
</a>
|
|
|
|
|
|
|
|
<!-- Modal pool -->
|
|
|
|
<div class="modal fade" id="addInstanceOwner" tabindex="-1" role="dialog" aria-labelledby="addInstanceOwnerLabel" aria-hidden="true">
|
|
|
|
<div class="modal-dialog">
|
|
|
|
<div class="modal-content">
|
|
|
|
<div class="modal-header">
|
2020-05-19 16:53:54 +00:00
|
|
|
<h5 class="modal-title">{% trans "Add Instance Owner" %}</h5>
|
2021-07-07 11:12:38 +00:00
|
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
2017-09-15 10:40:37 +00:00
|
|
|
</div>
|
|
|
|
<div class="modal-body">
|
2020-07-13 09:33:09 +00:00
|
|
|
<form id="add-owner-form" method="post" action="{% url 'instances:add_owner' instance.id %}" role="form" aria-label="Add instance owner form">{% csrf_token %}
|
2021-07-07 11:12:38 +00:00
|
|
|
<div class="row">
|
2020-05-19 16:53:54 +00:00
|
|
|
<label class="col-sm-4 col-form-label">{% trans "User" %}</label>
|
2017-09-15 10:40:37 +00:00
|
|
|
<div class="col-sm-6">
|
2021-07-07 11:12:38 +00:00
|
|
|
<select class="form-select" name="user_id">
|
2017-09-15 10:40:37 +00:00
|
|
|
{% for user in users %}
|
|
|
|
<option value="{{ user.id }}">{{ user.username }}</option>
|
|
|
|
{% endfor %}
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-07-13 09:33:09 +00:00
|
|
|
</form>
|
2017-09-15 10:40:37 +00:00
|
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
2021-07-07 11:12:38 +00:00
|
|
|
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">{% trans "Close" %}</button>
|
2020-07-13 09:33:09 +00:00
|
|
|
<button type="submit" class="btn btn-primary" form="add-owner-form">{% trans "Add" %}</button>
|
2017-09-15 10:40:37 +00:00
|
|
|
</div>
|
|
|
|
</div> <!-- /.modal-content -->
|
|
|
|
</div> <!-- /.modal-dialog -->
|
|
|
|
</div> <!-- /.modal -->
|
|
|
|
{% endif %}
|