add correct descriptions in the pop ups

This commit is contained in:
Cayo Puigdefabregas 2023-01-18 12:38:08 +01:00
parent c26d2d69b9
commit 9db949cef2
2 changed files with 21 additions and 4 deletions

View File

@ -1745,6 +1745,16 @@ class UserTrustsForm(FlaskForm):
self._unic = len(self._devices) < 2
return self._unic
def dhids_all_devices(self):
self.unic()
return ", ".join([x.dhid for x in self._devices][1:])
def dhid_base(self):
self.unic()
if not self._devices:
return ''
return self._devices[0].dhid
def show(self):
if not self.snapshot or not self.device:
return False

View File

@ -100,14 +100,21 @@
<div class="modal-body">
<div id="new_device" class="d-none">
Are you sure that you want to Change to <strong>New device</strong>?
<p class="text-danger">
This action cannot be undone.
<p class="text-danger mt-3">
Please be certain, once you confirm this step there is no going back.<br />
<br />
All the updates that have the {{ form.device.dhid }} device will become new devices and
you will not be able to do any update over these devices.
</p>
</div>
<div id="update" class="d-none">
Are you sure that you want to Change to <strong>Update</strong>?
<p class="text-danger">
This action cannot be undone.
<p class="text-danger mt-3">
Please be certain, once you confirm there is no going back.<br />
<br />
All the devices {{ form.dhids_all_devices() }}
will be deleted and the device {{ form.dhid_base() }} will be set as the device base.<br />
After this change you will be able to update this device.
</p>
</div>
</div>