Handle edge case where a circle was deleted more thoroughly

This commit is contained in:
Jonas Schäfer
2021-01-25 18:28:30 +01:00
parent c1132ae975
commit 174a2c3e14
4 changed files with 68 additions and 64 deletions

View File

@@ -1,5 +1,5 @@
{% extends "admin_app.html" %} {% extends "admin_app.html" %}
{% from "library.j2" import showuri, form_button, standard_button %} {% from "library.j2" import showuri, form_button, standard_button, extract_circle_name %}
{% block head_lead %} {% block head_lead %}
{{ super() }} {{ super() }}
{% include "copy-snippet.html" %} {% include "copy-snippet.html" %}
@@ -22,7 +22,7 @@
<dt>{% trans %}Circles{% endtrans %}</dt> <dt>{% trans %}Circles{% endtrans %}</dt>
<dd><p>{% trans %}Users joining via this invitation will be added to the following circles:{% endtrans %}</p><ul> <dd><p>{% trans %}Users joining via this invitation will be added to the following circles:{% endtrans %}</p><ul>
{%- for group_id in invite.group_ids -%} {%- for group_id in invite.group_ids -%}
<li>{{ circle_map[group_id] | circle_name }}</li> <li>{%- call extract_circle_name(circle_map, group_id) -%}{%- endcall -%}</li>
{%- endfor -%} {%- endfor -%}
</ul></dd> </ul></dd>
{%- else -%} {%- else -%}
@@ -30,7 +30,7 @@
<dd> <dd>
{%- if ngroups == 1 -%} {%- if ngroups == 1 -%}
{%- set group_id = invite.group_ids[0] -%} {%- set group_id = invite.group_ids[0] -%}
<a href="{{ url_for(".edit_circle", id_=group_id) }}">{{ circle_map[invite.group_ids[0]] | circle_name }}</a> {%- call extract_circle_name(circle_map, group_id) -%}{%- endcall -%}
{%- else -%} {%- else -%}
<em>{% trans %}The user will not be added to any circle and will have no contacts.{% endtrans %}</em> <em>{% trans %}The user will not be added to any circle and will have no contacts.{% endtrans %}</em>
{%- endif -%} {%- endif -%}

View File

@@ -1,5 +1,5 @@
{% extends "admin_app.html" %} {% extends "admin_app.html" %}
{% from "library.j2" import action_button, icon, clipboard_button, form_button, custom_form_button %} {% from "library.j2" import action_button, icon, clipboard_button, form_button, custom_form_button, extract_circle_name %}
{% block head_lead %} {% block head_lead %}
{{ super() }} {{ super() }}
{% include "copy-snippet.html" %} {% include "copy-snippet.html" %}
@@ -34,12 +34,7 @@
{#- -#} {#- -#}
<ul class="inline"> <ul class="inline">
{%- for group_id in invite.group_ids -%} {%- for group_id in invite.group_ids -%}
{%- set circle_info = circle_map[group_id] -%} <li>{%- call extract_circle_name(circle_map, group_id) -%}{%- endcall -%}</li>
{%- if circle_info -%}
<li>{{ circle_map[group_id] | circle_name }}</li>
{%- else -%}
<li><em>{% trans %}deleted{% endtrans %}</em></li>
{%- endif -%}
{%- endfor -%} {%- endfor -%}
</ul> </ul>
{#- -#} {#- -#}

View File

@@ -98,3 +98,12 @@
{%- endif -%} {%- endif -%}
{% endmacro %} {% endmacro %}
{% macro extract_circle_name(circle_map, id, caller=None) %}
{%- set circle_info = circle_map[id] -%}
{%- if circle_info -%}
<a href="{{ url_for('.edit_circle', id_=id) }}">{{ circle_info | circle_name }}</a>
{%- else -%}
<em>{% trans %}deleted{% endtrans %}</em>
{%- endif -%}
{% endmacro %}

View File

@@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PROJECT VERSION\n" "Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2021-01-25 17:00+0100\n" "POT-Creation-Date: 2021-01-26 15:06+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -546,23 +546,19 @@ msgstr ""
msgid "No" msgid "No"
msgstr "" msgstr ""
#: snikket_web/templates/admin_invites.html:41 #: snikket_web/templates/admin_invites.html:44
msgid "deleted"
msgstr ""
#: snikket_web/templates/admin_invites.html:49
msgid "Show invite details" msgid "Show invite details"
msgstr "" msgstr ""
#: snikket_web/templates/admin_invites.html:52 #: snikket_web/templates/admin_invites.html:47
msgid "Copy invite link to clipboard" msgid "Copy invite link to clipboard"
msgstr "" msgstr ""
#: snikket_web/templates/admin_invites.html:55 #: snikket_web/templates/admin_invites.html:50
msgid "Delete invitation" msgid "Delete invitation"
msgstr "" msgstr ""
#: snikket_web/templates/admin_invites.html:63 #: snikket_web/templates/admin_invites.html:58
msgid "Currently, there are no pending invitations." msgid "Currently, there are no pending invitations."
msgstr "" msgstr ""
@@ -623,15 +619,15 @@ msgid "The web portal encountered an internal error."
msgstr "" msgstr ""
#: snikket_web/templates/invite_invalid.html:4 #: snikket_web/templates/invite_invalid.html:4
#: snikket_web/templates/invite_view.html:11 #: snikket_web/templates/invite_view.html:12
#, python-format #, python-format
msgid "Invite to %(site_name)s" msgid "Invite to %(site_name)s"
msgstr "" msgstr ""
#: snikket_web/templates/invite_invalid.html:5 #: snikket_web/templates/invite_invalid.html:5
#: snikket_web/templates/invite_register.html:9 #: snikket_web/templates/invite_register.html:10
#: snikket_web/templates/invite_success.html:10 #: snikket_web/templates/invite_success.html:11
#: snikket_web/templates/invite_view.html:12 #: snikket_web/templates/invite_view.html:13
#, python-format #, python-format
msgid "Powered by <img src=\"%(logo_url)s\" alt=\"Snikket\">" msgid "Powered by <img src=\"%(logo_url)s\" alt=\"Snikket\">"
msgstr "" msgstr ""
@@ -644,26 +640,26 @@ msgstr ""
msgid "Sorry, it looks like this invite code has expired!" msgid "Sorry, it looks like this invite code has expired!"
msgstr "" msgstr ""
#: snikket_web/templates/invite_register.html:4 #: snikket_web/templates/invite_register.html:5
#, python-format #, python-format
msgid "Register on %(site_name)s | Snikket" msgid "Register on %(site_name)s | Snikket"
msgstr "" msgstr ""
#: snikket_web/templates/invite_register.html:8 #: snikket_web/templates/invite_register.html:9
#, python-format #, python-format
msgid "Register on %(site_name)s" msgid "Register on %(site_name)s"
msgstr "" msgstr ""
#: snikket_web/templates/invite_register.html:10 #: snikket_web/templates/invite_register.html:11
#, python-format #, python-format
msgid "%(site_name)s is using Snikket - a secure, privacy-friendly chat app." msgid "%(site_name)s is using Snikket - a secure, privacy-friendly chat app."
msgstr "" msgstr ""
#: snikket_web/templates/invite_register.html:11 #: snikket_web/templates/invite_register.html:12
msgid "Create an account" msgid "Create an account"
msgstr "" msgstr ""
#: snikket_web/templates/invite_register.html:12 #: snikket_web/templates/invite_register.html:13
msgid "" msgid ""
"Creating an account will allow to communicate with other people using the" "Creating an account will allow to communicate with other people using the"
" Snikket app or compatible software. If you already have the app " " Snikket app or compatible software. If you already have the app "
@@ -671,120 +667,120 @@ msgid ""
"inside the app by clicking on the button below:" "inside the app by clicking on the button below:"
msgstr "" msgstr ""
#: snikket_web/templates/invite_register.html:13 #: snikket_web/templates/invite_register.html:14
#: snikket_web/templates/invite_view.html:30 #: snikket_web/templates/invite_view.html:31
msgid "App already installed?" msgid "App already installed?"
msgstr "" msgstr ""
#: snikket_web/templates/invite_register.html:15 #: snikket_web/templates/invite_register.html:16
#: snikket_web/templates/invite_view.html:32 #: snikket_web/templates/invite_view.html:33
msgid "Open the app" msgid "Open the app"
msgstr "" msgstr ""
#: snikket_web/templates/invite_register.html:17 #: snikket_web/templates/invite_register.html:18
#: snikket_web/templates/invite_view.html:34 #: snikket_web/templates/invite_view.html:35
msgid "This button works only if you have the app installed already!" msgid "This button works only if you have the app installed already!"
msgstr "" msgstr ""
#: snikket_web/templates/invite_register.html:18 #: snikket_web/templates/invite_register.html:19
msgid "Create an account online" msgid "Create an account online"
msgstr "" msgstr ""
#: snikket_web/templates/invite_register.html:19 #: snikket_web/templates/invite_register.html:20
msgid "" msgid ""
"If you plan to use a legacy XMPP client, you can register an account " "If you plan to use a legacy XMPP client, you can register an account "
"online and enter your credentials into any XMPP-compatible software." "online and enter your credentials into any XMPP-compatible software."
msgstr "" msgstr ""
#: snikket_web/templates/invite_register.html:26 #: snikket_web/templates/invite_register.html:27
msgid "" msgid ""
"Choose a username, this will become the first part of your new chat " "Choose a username, this will become the first part of your new chat "
"address." "address."
msgstr "" msgstr ""
#: snikket_web/templates/invite_register.html:31 #: snikket_web/templates/invite_register.html:32
msgid "Enter a secure password that you do not use anywhere else." msgid "Enter a secure password that you do not use anywhere else."
msgstr "" msgstr ""
#: snikket_web/templates/invite_success.html:4 #: snikket_web/templates/invite_success.html:5
#, python-format #, python-format
msgid "Successfully registered on %(site_name)s | Snikket" msgid "Successfully registered on %(site_name)s | Snikket"
msgstr "" msgstr ""
#: snikket_web/templates/invite_success.html:9 #: snikket_web/templates/invite_success.html:10
#, python-format #, python-format
msgid "Successfully registered on %(site_name)s" msgid "Successfully registered on %(site_name)s"
msgstr "" msgstr ""
#: snikket_web/templates/invite_success.html:11 #: snikket_web/templates/invite_success.html:12
#, python-format #, python-format
msgid "Congratulations! You successfully registered on %(site_name)s as %(jid)s." msgid "Congratulations! You successfully registered on %(site_name)s as %(jid)s."
msgstr "" msgstr ""
#: snikket_web/templates/invite_success.html:14 #: snikket_web/templates/invite_success.html:15
msgid "Copy address" msgid "Copy address"
msgstr "" msgstr ""
#: snikket_web/templates/invite_success.html:16 #: snikket_web/templates/invite_success.html:17
msgid "" msgid ""
"You can not set up your legacy XMPP client with the above address and the" "You can not set up your legacy XMPP client with the above address and the"
" password you chose during registration." " password you chose during registration."
msgstr "" msgstr ""
#: snikket_web/templates/invite_success.html:17 #: snikket_web/templates/invite_success.html:18
msgid "You can now safely close this page." msgid "You can now safely close this page."
msgstr "" msgstr ""
#: snikket_web/templates/invite_view.html:5 #: snikket_web/templates/invite_view.html:6
#, python-format #, python-format
msgid "Invite to %(site_name)s | Snikket" msgid "Invite to %(site_name)s | Snikket"
msgstr "" msgstr ""
#: snikket_web/templates/invite_view.html:14 #: snikket_web/templates/invite_view.html:15
#, python-format #, python-format
msgid "" msgid ""
"You have been invited to chat with %(inviter_name)s using Snikket, a " "You have been invited to chat with %(inviter_name)s using Snikket, a "
"secure, privacy-friendly chat app on %(site_name)s." "secure, privacy-friendly chat app on %(site_name)s."
msgstr "" msgstr ""
#: snikket_web/templates/invite_view.html:16 #: snikket_web/templates/invite_view.html:17
#, python-format #, python-format
msgid "" msgid ""
"You have been invited to chat on %(site_name)s using Snikket, a secure, " "You have been invited to chat on %(site_name)s using Snikket, a secure, "
"privacy-friendly chat app." "privacy-friendly chat app."
msgstr "" msgstr ""
#: snikket_web/templates/invite_view.html:18 #: snikket_web/templates/invite_view.html:19
msgid "Get started" msgid "Get started"
msgstr "" msgstr ""
#: snikket_web/templates/invite_view.html:19 #: snikket_web/templates/invite_view.html:20
msgid "Install the Snikket App on your Android or iOS device." msgid "Install the Snikket App on your Android or iOS device."
msgstr "" msgstr ""
#: snikket_web/templates/invite_view.html:22 #: snikket_web/templates/invite_view.html:23
msgid "Get it on Google Play" msgid "Get it on Google Play"
msgstr "" msgstr ""
#: snikket_web/templates/invite_view.html:23 #: snikket_web/templates/invite_view.html:24
msgid "Download on the App Store" msgid "Download on the App Store"
msgstr "" msgstr ""
#: snikket_web/templates/invite_view.html:26 #: snikket_web/templates/invite_view.html:27
msgid "Not on mobile?" msgid "Not on mobile?"
msgstr "" msgstr ""
#: snikket_web/templates/invite_view.html:29 #: snikket_web/templates/invite_view.html:30
msgid "" msgid ""
"After installation the app should automatically open and prompt you to " "After installation the app should automatically open and prompt you to "
"create an account. If not, simply click the button below." "create an account. If not, simply click the button below."
msgstr "" msgstr ""
#: snikket_web/templates/invite_view.html:36 #: snikket_web/templates/invite_view.html:37
msgid "Alternatives" msgid "Alternatives"
msgstr "" msgstr ""
#: snikket_web/templates/invite_view.html:37 #: snikket_web/templates/invite_view.html:38
#, python-format #, python-format
msgid "" msgid ""
"You can connect to Snikket using any XMPP-compatible software. If the " "You can connect to Snikket using any XMPP-compatible software. If the "
@@ -792,43 +788,43 @@ msgid ""
"href=\"%(register_url)s\">register an account manually</a>." "href=\"%(register_url)s\">register an account manually</a>."
msgstr "" msgstr ""
#: snikket_web/templates/invite_view.html:43 #: snikket_web/templates/invite_view.html:44
msgid "Scan invite code" msgid "Scan invite code"
msgstr "" msgstr ""
#: snikket_web/templates/invite_view.html:46 #: snikket_web/templates/invite_view.html:47
#: snikket_web/templates/invite_view.html:75 #: snikket_web/templates/invite_view.html:76
msgid "Close" msgid "Close"
msgstr "" msgstr ""
#: snikket_web/templates/invite_view.html:49 #: snikket_web/templates/invite_view.html:50
msgid "" msgid ""
"You can transfer this invite to your mobile device by scanning a code " "You can transfer this invite to your mobile device by scanning a code "
"with your camera. You can use either a QR scanner app or the Snikket app " "with your camera. You can use either a QR scanner app or the Snikket app "
"itself." "itself."
msgstr "" msgstr ""
#: snikket_web/templates/invite_view.html:54 #: snikket_web/templates/invite_view.html:55
msgid "Using a QR code scanner" msgid "Using a QR code scanner"
msgstr "" msgstr ""
#: snikket_web/templates/invite_view.html:56 #: snikket_web/templates/invite_view.html:57
msgid "Using the Snikket app" msgid "Using the Snikket app"
msgstr "" msgstr ""
#: snikket_web/templates/invite_view.html:61 #: snikket_web/templates/invite_view.html:62
msgid "" msgid ""
"Use a <em>QR code</em> scanner on your mobile device to scan the code " "Use a <em>QR code</em> scanner on your mobile device to scan the code "
"below:" "below:"
msgstr "" msgstr ""
#: snikket_web/templates/invite_view.html:67 #: snikket_web/templates/invite_view.html:68
msgid "" msgid ""
"Install the Snikket app on your mobile device, open it, and tap the " "Install the Snikket app on your mobile device, open it, and tap the "
"'Scan' button at the top." "'Scan' button at the top."
msgstr "" msgstr ""
#: snikket_web/templates/invite_view.html:68 #: snikket_web/templates/invite_view.html:69
msgid "" msgid ""
"Your camera will turn on. Point it at the square code below until it is " "Your camera will turn on. Point it at the square code below until it is "
"within the highlighted square on your screen, and wait until the app " "within the highlighted square on your screen, and wait until the app "
@@ -843,6 +839,10 @@ msgstr ""
msgid "Invalid input" msgid "Invalid input"
msgstr "" msgstr ""
#: snikket_web/templates/library.j2:107
msgid "deleted"
msgstr ""
#: snikket_web/templates/login.html:5 #: snikket_web/templates/login.html:5
msgid "Snikket Login" msgid "Snikket Login"
msgstr "" msgstr ""