Add device model display to edit form, sort devices in index

This commit is contained in:
Kumi 2018-12-15 13:01:10 +01:00
parent 4ee542b7da
commit bd4b713560
2 changed files with 9 additions and 1 deletions

View file

@ -8,10 +8,18 @@
<label for="serial">Serial Number</label> <label for="serial">Serial Number</label>
<input type="text" class="form-control" id="serial" disabled="disabled" value="{{ device.serial }}"></input> <input type="text" class="form-control" id="serial" disabled="disabled" value="{{ device.serial }}"></input>
</div> </div>
{% if user.is_staff %}
<div class="form-group">
<label for="model">Device Model</label>
<input type="text" class="form-control" id="model" disabled="disabled" value="{{ device.model }}"></input>
</div>
{% endif %}
{% if user.is_superuser %} {% if user.is_superuser %}
<div class="form-group"> <div class="form-group">
<label for="secret">Device Secret</label> <label for="secret">Device Secret</label>
<input type="text" class="form-control" id="secret" disabled="disabled" value="{{ device.secret }}"></input> <input type="text" class="form-control" id="secret" disabled="disabled" value="{{ device.secret }}"></input>
{% endif %}
{% if user.is_staff %}
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="password">Root Password</label> <label for="password">Root Password</label>

View file

@ -99,7 +99,7 @@ def devices(request):
"title": "Device Administration", "title": "Device Administration",
"user": user, "user": user,
"organization": orga, "organization": orga,
"devices": devices "devices": sorted(devices, key=lambda x: x.__str__())
} }
) )
else: else: