Improve and condense related controls
This commit is contained in:
@@ -1,14 +1,31 @@
|
||||
{% if object.ok %}
|
||||
<img src="data:image/png;base64, {{ object.image_b64 }}" alt="WhatsApp QR code" />
|
||||
{% if object.warning %}
|
||||
<p class="is-size-7" style="margin-top: 0.6rem;">{{ object.warning }}</p>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<article class="notification is-warning is-light" style="margin-bottom: 0;">
|
||||
<p><strong>WhatsApp QR Not Ready.</strong></p>
|
||||
<p>{{ object.error|default:"No Neonize pairing QR is available yet." }}</p>
|
||||
<div class="whatsapp-account-add-fragment">
|
||||
{% if object.ok %}
|
||||
<img src="data:image/png;base64, {{ object.image_b64 }}" alt="WhatsApp QR code" />
|
||||
{% if object.warning %}
|
||||
<p style="margin-top: 0.45rem;">{{ object.warning }}</p>
|
||||
<p class="is-size-7" style="margin-top: 0.6rem;">{{ object.warning }}</p>
|
||||
{% endif %}
|
||||
</article>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<article class="notification is-warning is-light" style="margin-bottom: 0;">
|
||||
<p><strong>WhatsApp QR Not Ready.</strong></p>
|
||||
<p>{{ object.error|default:"No Neonize pairing QR is available yet." }}</p>
|
||||
{% if object.warning %}
|
||||
<p style="margin-top: 0.45rem;">{{ object.warning }}</p>
|
||||
{% endif %}
|
||||
{% if object.pending %}
|
||||
<p class="is-size-7" style="margin-top: 0.5rem;">
|
||||
Waiting for Neonize QR event. This panel will refresh automatically.
|
||||
</p>
|
||||
<form
|
||||
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
|
||||
hx-post="{{ detail_url }}"
|
||||
hx-target="closest .whatsapp-account-add-fragment"
|
||||
hx-swap="outerHTML"
|
||||
hx-trigger="load delay:1800ms">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="device" value="{{ object.device|default:'GIA Device' }}" />
|
||||
<input type="hidden" name="refresh" value="1" />
|
||||
</form>
|
||||
{% endif %}
|
||||
</article>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user