diff --git a/snikket_web/templates/admin_edit_invite.html b/snikket_web/templates/admin_edit_invite.html
index 8922455..ac3d362 100644
--- a/snikket_web/templates/admin_edit_invite.html
+++ b/snikket_web/templates/admin_edit_invite.html
@@ -1,5 +1,5 @@
{% 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 %}
{{ super() }}
{% include "copy-snippet.html" %}
@@ -22,7 +22,7 @@
{% trans %}Circles{% endtrans %}
{% trans %}Users joining via this invitation will be added to the following circles:{% endtrans %}
{%- for group_id in invite.group_ids -%}
- - {{ circle_map[group_id] | circle_name }}
+ - {%- call extract_circle_name(circle_map, group_id) -%}{%- endcall -%}
{%- endfor -%}
{%- else -%}
@@ -30,7 +30,7 @@
{%- if ngroups == 1 -%}
{%- set group_id = invite.group_ids[0] -%}
- {{ circle_map[invite.group_ids[0]] | circle_name }}
+ {%- call extract_circle_name(circle_map, group_id) -%}{%- endcall -%}
{%- else -%}
{% trans %}The user will not be added to any circle and will have no contacts.{% endtrans %}
{%- endif -%}
diff --git a/snikket_web/templates/admin_invites.html b/snikket_web/templates/admin_invites.html
index e0b100e..ed9509d 100644
--- a/snikket_web/templates/admin_invites.html
+++ b/snikket_web/templates/admin_invites.html
@@ -1,5 +1,5 @@
{% 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 %}
{{ super() }}
{% include "copy-snippet.html" %}
@@ -34,12 +34,7 @@
{#- -#}
{%- for group_id in invite.group_ids -%}
- {%- set circle_info = circle_map[group_id] -%}
- {%- if circle_info -%}
- - {{ circle_map[group_id] | circle_name }}
- {%- else -%}
- - {% trans %}deleted{% endtrans %}
- {%- endif -%}
+ - {%- call extract_circle_name(circle_map, group_id) -%}{%- endcall -%}
{%- endfor -%}
{#- -#}
diff --git a/snikket_web/templates/library.j2 b/snikket_web/templates/library.j2
index 2f7a624..b9ffdb5 100644
--- a/snikket_web/templates/library.j2
+++ b/snikket_web/templates/library.j2
@@ -98,3 +98,12 @@
—
{%- endif -%}
{% endmacro %}
+
+{% macro extract_circle_name(circle_map, id, caller=None) %}
+{%- set circle_info = circle_map[id] -%}
+{%- if circle_info -%}
+{{ circle_info | circle_name }}
+{%- else -%}
+{% trans %}deleted{% endtrans %}
+{%- endif -%}
+{% endmacro %}
diff --git a/snikket_web/translations/messages.pot b/snikket_web/translations/messages.pot
index 0ea6bd2..4e46e05 100644
--- a/snikket_web/translations/messages.pot
+++ b/snikket_web/translations/messages.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\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"
"Last-Translator: FULL NAME \n"
"Language-Team: LANGUAGE \n"
@@ -546,23 +546,19 @@ msgstr ""
msgid "No"
msgstr ""
-#: snikket_web/templates/admin_invites.html:41
-msgid "deleted"
-msgstr ""
-
-#: snikket_web/templates/admin_invites.html:49
+#: snikket_web/templates/admin_invites.html:44
msgid "Show invite details"
msgstr ""
-#: snikket_web/templates/admin_invites.html:52
+#: snikket_web/templates/admin_invites.html:47
msgid "Copy invite link to clipboard"
msgstr ""
-#: snikket_web/templates/admin_invites.html:55
+#: snikket_web/templates/admin_invites.html:50
msgid "Delete invitation"
msgstr ""
-#: snikket_web/templates/admin_invites.html:63
+#: snikket_web/templates/admin_invites.html:58
msgid "Currently, there are no pending invitations."
msgstr ""
@@ -623,15 +619,15 @@ msgid "The web portal encountered an internal error."
msgstr ""
#: snikket_web/templates/invite_invalid.html:4
-#: snikket_web/templates/invite_view.html:11
+#: snikket_web/templates/invite_view.html:12
#, python-format
msgid "Invite to %(site_name)s"
msgstr ""
#: snikket_web/templates/invite_invalid.html:5
-#: snikket_web/templates/invite_register.html:9
-#: snikket_web/templates/invite_success.html:10
-#: snikket_web/templates/invite_view.html:12
+#: snikket_web/templates/invite_register.html:10
+#: snikket_web/templates/invite_success.html:11
+#: snikket_web/templates/invite_view.html:13
#, python-format
msgid "Powered by
"
msgstr ""
@@ -644,26 +640,26 @@ msgstr ""
msgid "Sorry, it looks like this invite code has expired!"
msgstr ""
-#: snikket_web/templates/invite_register.html:4
+#: snikket_web/templates/invite_register.html:5
#, python-format
msgid "Register on %(site_name)s | Snikket"
msgstr ""
-#: snikket_web/templates/invite_register.html:8
+#: snikket_web/templates/invite_register.html:9
#, python-format
msgid "Register on %(site_name)s"
msgstr ""
-#: snikket_web/templates/invite_register.html:10
+#: snikket_web/templates/invite_register.html:11
#, python-format
msgid "%(site_name)s is using Snikket - a secure, privacy-friendly chat app."
msgstr ""
-#: snikket_web/templates/invite_register.html:11
+#: snikket_web/templates/invite_register.html:12
msgid "Create an account"
msgstr ""
-#: snikket_web/templates/invite_register.html:12
+#: snikket_web/templates/invite_register.html:13
msgid ""
"Creating an account will allow to communicate with other people using the"
" 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:"
msgstr ""
-#: snikket_web/templates/invite_register.html:13
-#: snikket_web/templates/invite_view.html:30
+#: snikket_web/templates/invite_register.html:14
+#: snikket_web/templates/invite_view.html:31
msgid "App already installed?"
msgstr ""
-#: snikket_web/templates/invite_register.html:15
-#: snikket_web/templates/invite_view.html:32
+#: snikket_web/templates/invite_register.html:16
+#: snikket_web/templates/invite_view.html:33
msgid "Open the app"
msgstr ""
-#: snikket_web/templates/invite_register.html:17
-#: snikket_web/templates/invite_view.html:34
+#: snikket_web/templates/invite_register.html:18
+#: snikket_web/templates/invite_view.html:35
msgid "This button works only if you have the app installed already!"
msgstr ""
-#: snikket_web/templates/invite_register.html:18
+#: snikket_web/templates/invite_register.html:19
msgid "Create an account online"
msgstr ""
-#: snikket_web/templates/invite_register.html:19
+#: snikket_web/templates/invite_register.html:20
msgid ""
"If you plan to use a legacy XMPP client, you can register an account "
"online and enter your credentials into any XMPP-compatible software."
msgstr ""
-#: snikket_web/templates/invite_register.html:26
+#: snikket_web/templates/invite_register.html:27
msgid ""
"Choose a username, this will become the first part of your new chat "
"address."
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."
msgstr ""
-#: snikket_web/templates/invite_success.html:4
+#: snikket_web/templates/invite_success.html:5
#, python-format
msgid "Successfully registered on %(site_name)s | Snikket"
msgstr ""
-#: snikket_web/templates/invite_success.html:9
+#: snikket_web/templates/invite_success.html:10
#, python-format
msgid "Successfully registered on %(site_name)s"
msgstr ""
-#: snikket_web/templates/invite_success.html:11
+#: snikket_web/templates/invite_success.html:12
#, python-format
msgid "Congratulations! You successfully registered on %(site_name)s as %(jid)s."
msgstr ""
-#: snikket_web/templates/invite_success.html:14
+#: snikket_web/templates/invite_success.html:15
msgid "Copy address"
msgstr ""
-#: snikket_web/templates/invite_success.html:16
+#: snikket_web/templates/invite_success.html:17
msgid ""
"You can not set up your legacy XMPP client with the above address and the"
" password you chose during registration."
msgstr ""
-#: snikket_web/templates/invite_success.html:17
+#: snikket_web/templates/invite_success.html:18
msgid "You can now safely close this page."
msgstr ""
-#: snikket_web/templates/invite_view.html:5
+#: snikket_web/templates/invite_view.html:6
#, python-format
msgid "Invite to %(site_name)s | Snikket"
msgstr ""
-#: snikket_web/templates/invite_view.html:14
+#: snikket_web/templates/invite_view.html:15
#, python-format
msgid ""
"You have been invited to chat with %(inviter_name)s using Snikket, a "
"secure, privacy-friendly chat app on %(site_name)s."
msgstr ""
-#: snikket_web/templates/invite_view.html:16
+#: snikket_web/templates/invite_view.html:17
#, python-format
msgid ""
"You have been invited to chat on %(site_name)s using Snikket, a secure, "
"privacy-friendly chat app."
msgstr ""
-#: snikket_web/templates/invite_view.html:18
+#: snikket_web/templates/invite_view.html:19
msgid "Get started"
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."
msgstr ""
-#: snikket_web/templates/invite_view.html:22
+#: snikket_web/templates/invite_view.html:23
msgid "Get it on Google Play"
msgstr ""
-#: snikket_web/templates/invite_view.html:23
+#: snikket_web/templates/invite_view.html:24
msgid "Download on the App Store"
msgstr ""
-#: snikket_web/templates/invite_view.html:26
+#: snikket_web/templates/invite_view.html:27
msgid "Not on mobile?"
msgstr ""
-#: snikket_web/templates/invite_view.html:29
+#: snikket_web/templates/invite_view.html:30
msgid ""
"After installation the app should automatically open and prompt you to "
"create an account. If not, simply click the button below."
msgstr ""
-#: snikket_web/templates/invite_view.html:36
+#: snikket_web/templates/invite_view.html:37
msgid "Alternatives"
msgstr ""
-#: snikket_web/templates/invite_view.html:37
+#: snikket_web/templates/invite_view.html:38
#, python-format
msgid ""
"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."
msgstr ""
-#: snikket_web/templates/invite_view.html:43
+#: snikket_web/templates/invite_view.html:44
msgid "Scan invite code"
msgstr ""
-#: snikket_web/templates/invite_view.html:46
-#: snikket_web/templates/invite_view.html:75
+#: snikket_web/templates/invite_view.html:47
+#: snikket_web/templates/invite_view.html:76
msgid "Close"
msgstr ""
-#: snikket_web/templates/invite_view.html:49
+#: snikket_web/templates/invite_view.html:50
msgid ""
"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 "
"itself."
msgstr ""
-#: snikket_web/templates/invite_view.html:54
+#: snikket_web/templates/invite_view.html:55
msgid "Using a QR code scanner"
msgstr ""
-#: snikket_web/templates/invite_view.html:56
+#: snikket_web/templates/invite_view.html:57
msgid "Using the Snikket app"
msgstr ""
-#: snikket_web/templates/invite_view.html:61
+#: snikket_web/templates/invite_view.html:62
msgid ""
"Use a QR code scanner on your mobile device to scan the code "
"below:"
msgstr ""
-#: snikket_web/templates/invite_view.html:67
+#: snikket_web/templates/invite_view.html:68
msgid ""
"Install the Snikket app on your mobile device, open it, and tap the "
"'Scan' button at the top."
msgstr ""
-#: snikket_web/templates/invite_view.html:68
+#: snikket_web/templates/invite_view.html:69
msgid ""
"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 "
@@ -843,6 +839,10 @@ msgstr ""
msgid "Invalid input"
msgstr ""
+#: snikket_web/templates/library.j2:107
+msgid "deleted"
+msgstr ""
+
#: snikket_web/templates/login.html:5
msgid "Snikket Login"
msgstr ""