bridgy-fed/templates/settings.html

99 wiersze
3.9 KiB
HTML

{% set body_id = 'settings' %}
{% extends "base.html" %}
{% block content %}
<style type="text/css">
#update-profile-button { display: none; }
</style>
<p class="row big" style="text-align: left">Accounts</p>
{% for user in users %}
{% set logo = user.logo %}
<div class="profile-row">
<div class="row">
{% include 'user_with_links.html' %}
</div>
<div class="row">
{% if user.enabled_protocols and not user.status %} {# Bridging: on #}
<span id="{{ user.handle }}-switch-disabled-notice" class="disabled-notice"></span>
<a href="{{ user.user_page_path() }}">Bridging: </a>
<!-- to {{ user.enabled_protocols|join(', ') }} -->
<form method="post" action="/settings/disable"
onsubmit="return window.confirm('Are you sure you want to disable bridging? Disabling has effects that can\'t easily be reversed, even if you later re-enable bridging. For example, disabling removes all fediverse followers.')" />
<input name="key" type="hidden" value="{{ user.key.urlsafe().decode() }}" />
<label class="switch" id="{{ user.handle }}-switch-wrapper">
<input id="{{ user.handle }}-switch" type="checkbox" checked onClick="bridgingSwitch(event)">
<span class="slider round"></span>
</label>
<noscript>
<input type="submit" value="Disable" class="btn btn-default disable-button" />
</noscript>
</form>
{# TODO: generalize #}
{% if 'atproto' in user.enabled_protocols %}
<p>
<form method="post" action="/settings/set-username">
<input name="key" type="hidden" value="{{ user.key.urlsafe().decode() }}" />
<input name="protocol" type="hidden" value="atproto" />
<label for="username">Set Bluesky handle:</label>
<input id="username" type="text" name="username" placeholder ="your.domain" />
<input type="submit" value="Go" class="btn btn-default" />
</form>
</p>
{% endif %}
<!-- TODO: uncomment when we launch DM notifs
<p>
<form method="post" action="/settings/toggle-notifs">
<input name="key" type="hidden" value="{{ user.key.urlsafe().decode() }}" />
DM notifications from unbridged accounts:
<label class="switch" id="{{ user.handle }}-notifs-wrapper">
<input id="{{ user.handle }}-switch" type="checkbox"
onClick="event.currentTarget.closest('form').submit()"
{% if user.send_notifs == 'all' %}checked{% endif %} />
<span class="slider round"></span>
</label>
<noscript>
<input type="submit" class="btn btn-default"
value="{{ 'Enable' if user.send_notifs == 'none' else 'Disable' }}" />
</noscript>
</form>
</p>
-->
{% else %} {# Bridging: off #}
<label id="{{ user.handle }}-switch-disabled-notice" class="disabled-notice"></label>
Bridging:
<form method="post" action="/settings/enable">
<input name="key" type="hidden" value="{{ user.key.urlsafe().decode() }}" />
<label class="switch" id="{{ user.handle }}-switch-wrapper">
<input id="{{ user.handle }}-switch" type="checkbox" onClick="bridgingSwitch(event)" {% if user.status and user.status != 'private' %}disabled="true"{% endif %}>
<span class="slider round"></span>
</label>
<noscript>
<input type="submit" value="Enable" class="btn btn-default enable-button"
{% if user.status and user.status != 'private' %}disabled="true"{% endif %} />
</noscript>
</form>
{% if user.status %} Not bridging because your {{ USER_STATUS_DESCRIPTIONS[user.status] }}{% endif %}
{% endif %}
</div>
</div>
{% endfor %}
<br>
<form action="/login" method="get">
<input type="submit" class="btn btn-default" value="Add account" />
</form>
<form action="/logout" method="post">
<input type="submit" class="btn btn-default disable-button"
value="Log out of all accounts" />
</form>
{% endblock content %}