only render private if sbot is active, fix type in profile

This commit is contained in:
glyph 2022-03-03 09:34:30 +02:00
parent 59ef5960a4
commit 3991af11c7
2 changed files with 13 additions and 12 deletions

View File

@ -2,21 +2,22 @@
{%- block card %}
<!-- SCUTTLEBUTT PRIVATE MESSAGE FORM -->
<div class="card center">
{# only render the private message elements if the sbot is active #}
{%- if sbot_status and sbot_status.state == "active" %}
<form id="sbotConfig" class="center" action="/scuttlebutt/private" method="post">
<div class="capsule capsule-profile border-ssb" title="Scuttlebutt account profile information">
<div class="center" style="display: flex; flex-direction: column; margin-bottom: 2rem;" title="Public key (ID) of the peer being written to">
<label for="publicKey" class="label-small font-gray">PUBLIC KEY</label>
<input type="text" id="publicKey" name="recipient" placeholder="@xYz...=.ed25519" {% if recipient_id %}value="{{ recipient_id }}"{% else %}autofocus{% endif %}>
</div>
<!-- input for message contents -->
<textarea id="privatePost" class="center input message-input" name="text" title="Compose a private message" placeholder="Write a private message..."{% if recipient_id %} autofocus{% endif %}></textarea>
<!-- hidden input field to pass the public key of the local peer -->
<input type="hidden" id="localId" name="id" value="{{ id }}">
<div class="center" style="display: flex; flex-direction: column; margin-bottom: 1rem;" title="Public key (ID) of the peer being written to">
<label for="publicKey" class="label-small font-gray">PUBLIC KEY</label>
<input type="text" id="publicKey" name="recipient" placeholder="@xYz...=.ed25519" {% if recipient_id %}value="{{ recipient_id }}"{% else %}autofocus{% endif %}>
</div>
<!-- input for message contents -->
<textarea id="privatePost" class="center input message-input" name="text" title="Compose a private message" placeholder="Write a private message..."{% if recipient_id %} autofocus{% endif %}></textarea>
<!-- hidden input field to pass the public key of the local peer -->
<input type="hidden" id="localId" name="id" value="{{ id }}">
<!-- BUTTONS -->
<input id="publish" class="button button-primary center" type="submit" style="margin-top: 1rem;" title="Publish private message to peer" value="Publish">
</form>
<!-- FLASH MESSAGE -->
{% include "snippets/flash_message" %}
{%- endif %}
<!-- FLASH MESSAGE -->
{% include "snippets/flash_message" %}
</div>
{%- endblock card -%}

View File

@ -2,7 +2,7 @@
{%- block card %}
<!-- USER PROFILE -->
<div class="card center">
{# only render the profile info elements is the sbot is active #}
{# only render the profile info elements if the sbot is active #}
{%- if sbot_status and sbot_status.state == "active" %}
<!-- PROFILE INFO BOX -->
<div class="capsule capsule-profile border-ssb" title="Scuttlebutt account profile information">