Improve install button layout on narrow screens

This allows the button container to add line breaks between the
buttons when necessary.
This commit is contained in:
Jonas Schäfer
2021-03-20 16:19:25 +01:00
parent a6b67b3fdd
commit b822000f2e
4 changed files with 69 additions and 46 deletions

View File

@@ -148,15 +148,15 @@ async def register(id_: str) -> typing.Union[str, quart.Response]:
except aiohttp.ClientResponseError as exc: except aiohttp.ClientResponseError as exc:
if exc.status == 409: if exc.status == 409:
form.localpart.errors.append( form.localpart.errors.append(
_l("That username is already taken") _l("That username is already taken.")
) )
elif exc.status == 403: elif exc.status == 403:
form.localpart.errors.append( form.localpart.errors.append(
_l("Registration was declined for unknown reasons") _l("Registration was declined for unknown reasons.")
) )
elif exc.status == 400: elif exc.status == 400:
form.localpart.errors.append( form.localpart.errors.append(
_l("The username is not valid") _l("The username is not valid.")
) )
elif exc.status == 404: elif exc.status == 404:
return redirect(url_for(".view", id_=id_)) return redirect(url_for(".view", id_=id_))
@@ -216,7 +216,7 @@ async def reset(id_: str) -> typing.Union[str, quart.Response]:
except aiohttp.ClientResponseError as exc: except aiohttp.ClientResponseError as exc:
if exc.status == 403: if exc.status == 403:
form.localpart.errors.append( form.localpart.errors.append(
_l("Registration was declined for unknown reasons") _l("Registration was declined for unknown reasons.")
) )
elif exc.status == 404: elif exc.status == 404:
return redirect(url_for(".view", id_=id_)) return redirect(url_for(".view", id_=id_))

View File

@@ -80,7 +80,7 @@
<div class="box warning">{#- -#} <div class="box warning">{#- -#}
<header>{% trans %}Invalid input{% endtrans %}</header> <header>{% trans %}Invalid input{% endtrans %}</header>
{%- if error_list | length == 1 -%} {%- if error_list | length == 1 -%}
<p>{{ error_list[0] }}.</p> <p>{{ error_list[0] }}</p>
{%- else -%} {%- else -%}
<ul> <ul>
{%- for error in error_list -%} {%- for error in error_list -%}

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-03-20 16:15+0100\n" "POT-Creation-Date: 2021-03-20 16:27+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"
@@ -149,39 +149,39 @@ msgstr ""
msgid "Main" msgid "Main"
msgstr "" msgstr ""
#: snikket_web/invite.py:106 #: snikket_web/invite.py:107
msgid "Username" msgid "Username"
msgstr "" msgstr ""
#: snikket_web/invite.py:110 snikket_web/invite.py:177 snikket_web/main.py:42 #: snikket_web/invite.py:111 snikket_web/invite.py:178 snikket_web/main.py:42
msgid "Password" msgid "Password"
msgstr "" msgstr ""
#: snikket_web/invite.py:114 snikket_web/invite.py:181 #: snikket_web/invite.py:115 snikket_web/invite.py:182
msgid "Confirm password" msgid "Confirm password"
msgstr "" msgstr ""
#: snikket_web/invite.py:118 snikket_web/invite.py:185 #: snikket_web/invite.py:119 snikket_web/invite.py:186
msgid "The passwords must match" msgid "The passwords must match"
msgstr "" msgstr ""
#: snikket_web/invite.py:123 #: snikket_web/invite.py:124
msgid "Create account" msgid "Create account"
msgstr "" msgstr ""
#: snikket_web/invite.py:150 #: snikket_web/invite.py:151
msgid "That username is already taken" msgid "That username is already taken."
msgstr "" msgstr ""
#: snikket_web/invite.py:154 snikket_web/invite.py:218 #: snikket_web/invite.py:155 snikket_web/invite.py:219
msgid "Registration was declined for unknown reasons" msgid "Registration was declined for unknown reasons."
msgstr "" msgstr ""
#: snikket_web/invite.py:158 #: snikket_web/invite.py:159
msgid "The username is not valid" msgid "The username is not valid."
msgstr "" msgstr ""
#: snikket_web/invite.py:190 snikket_web/templates/user_home.html:32 #: snikket_web/invite.py:191 snikket_web/templates/user_home.html:32
#: snikket_web/templates/user_passwd.html:29 #: snikket_web/templates/user_passwd.html:29
msgid "Change password" msgid "Change password"
msgstr "" msgstr ""
@@ -252,7 +252,7 @@ msgid "Update profile"
msgstr "" msgstr ""
#: snikket_web/user.py:101 #: snikket_web/user.py:101
msgid "Incorrect password" msgid "Incorrect password."
msgstr "" msgstr ""
#: snikket_web/user.py:105 #: snikket_web/user.py:105
@@ -262,7 +262,7 @@ msgstr ""
#: snikket_web/user.py:113 #: snikket_web/user.py:113
msgid "" msgid ""
"The chosen avatar is too big. To be able to upload larger avatars, please" "The chosen avatar is too big. To be able to upload larger avatars, please"
" use the app" " use the app."
msgstr "" msgstr ""
#: snikket_web/user.py:161 #: snikket_web/user.py:161
@@ -789,19 +789,20 @@ msgid ""
msgstr "" msgstr ""
#: snikket_web/templates/invite_register.html:14 #: snikket_web/templates/invite_register.html:14
#: snikket_web/templates/invite_view.html:38 #: snikket_web/templates/invite_view.html:39
msgid "App already installed?" msgid "App already installed?"
msgstr "" msgstr ""
#: snikket_web/templates/invite_register.html:16 #: snikket_web/templates/invite_register.html:16
#: snikket_web/templates/invite_reset_view.html:21 #: snikket_web/templates/invite_reset_view.html:21
#: snikket_web/templates/invite_view.html:40 #: snikket_web/templates/invite_view.html:41
#: snikket_web/templates/invite_view.html:105 #: snikket_web/templates/invite_view.html:106
#: snikket_web/templates/invite_view.html:134
msgid "Open the app" msgid "Open the app"
msgstr "" msgstr ""
#: snikket_web/templates/invite_register.html:18 #: snikket_web/templates/invite_register.html:18
#: snikket_web/templates/invite_view.html:42 #: snikket_web/templates/invite_view.html:43
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 ""
@@ -887,7 +888,7 @@ msgid ""
msgstr "" msgstr ""
#: snikket_web/templates/invite_reset_view.html:26 #: snikket_web/templates/invite_reset_view.html:26
#: snikket_web/templates/invite_view.html:76 #: snikket_web/templates/invite_view.html:77
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 "
@@ -899,7 +900,7 @@ msgid "You will then be prompted to enter a new password for your account."
msgstr "" msgstr ""
#: snikket_web/templates/invite_reset_view.html:29 #: snikket_web/templates/invite_reset_view.html:29
#: snikket_web/templates/invite_view.html:44 #: snikket_web/templates/invite_view.html:45
msgid "Alternatives" msgid "Alternatives"
msgstr "" msgstr ""
@@ -975,21 +976,25 @@ msgid "Get it on Google Play"
msgstr "" msgstr ""
#: snikket_web/templates/invite_view.html:30 #: snikket_web/templates/invite_view.html:30
#: snikket_web/templates/invite_view.html:101 #: snikket_web/templates/invite_view.html:102
msgid "Download on the App Store" msgid "Download on the App Store"
msgstr "" msgstr ""
#: snikket_web/templates/invite_view.html:34 #: snikket_web/templates/invite_view.html:32
msgid "Get it on F-Droid"
msgstr ""
#: snikket_web/templates/invite_view.html:35
msgid "Send to mobile device" msgid "Send to mobile device"
msgstr "" msgstr ""
#: snikket_web/templates/invite_view.html:37 #: snikket_web/templates/invite_view.html:38
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:45 #: snikket_web/templates/invite_view.html:46
#, 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 "
@@ -997,64 +1002,82 @@ 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:51 #: snikket_web/templates/invite_view.html:52
msgid "Scan invite code" msgid "Scan invite code"
msgstr "" msgstr ""
#: snikket_web/templates/invite_view.html:54 #: snikket_web/templates/invite_view.html:55
#: snikket_web/templates/invite_view.html:83 #: snikket_web/templates/invite_view.html:84
#: snikket_web/templates/invite_view.html:95 #: snikket_web/templates/invite_view.html:96
#: snikket_web/templates/invite_view.html:111 #: snikket_web/templates/invite_view.html:112
#: snikket_web/templates/invite_view.html:124
#: snikket_web/templates/invite_view.html:140
msgid "Close" msgid "Close"
msgstr "" msgstr ""
#: snikket_web/templates/invite_view.html:57 #: snikket_web/templates/invite_view.html:58
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:62 #: snikket_web/templates/invite_view.html:63
msgid "Using a QR code scanner" msgid "Using a QR code scanner"
msgstr "" msgstr ""
#: snikket_web/templates/invite_view.html:64 #: snikket_web/templates/invite_view.html:65
msgid "Using the Snikket app" msgid "Using the Snikket app"
msgstr "" msgstr ""
#: snikket_web/templates/invite_view.html:69 #: snikket_web/templates/invite_view.html:70
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:75 #: snikket_web/templates/invite_view.html:76
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:92 #: snikket_web/templates/invite_view.html:93
msgid "Install on iOS" msgid "Install on iOS"
msgstr "" msgstr ""
#: snikket_web/templates/invite_view.html:98 #: snikket_web/templates/invite_view.html:99
msgid "" msgid ""
"After downloading Snikket from the app store, you have to return to this " "After downloading Snikket from the app store, you have to return to this "
"invite link and tap on \"Open the app\" to proceed." "invite link and tap on \"Open the app\" to proceed."
msgstr "" msgstr ""
#: snikket_web/templates/invite_view.html:100 #: snikket_web/templates/invite_view.html:101
msgid "First download Snikket from the app store using the button below:" msgid "First download Snikket from the app store using the button below:"
msgstr "" msgstr ""
#: snikket_web/templates/invite_view.html:102 #: snikket_web/templates/invite_view.html:103
#: snikket_web/templates/invite_view.html:131
msgid "" msgid ""
"After the installation is complete, you can return to this page and tap " "After the installation is complete, you can return to this page and tap "
"the \"Open the app\" button to continue with the setup:" "the \"Open the app\" button to continue with the setup:"
msgstr "" msgstr ""
#: snikket_web/templates/invite_view.html:121
#: snikket_web/templates/invite_view.html:130
msgid "Install via F-Droid"
msgstr ""
#: snikket_web/templates/invite_view.html:127
msgid ""
"After installing Snikket via F-Droid, you have to return to this invite "
"link and tap on \"Open the app\" to proceed."
msgstr ""
#: snikket_web/templates/invite_view.html:129
msgid "First install Snikket from F-Droid using the button below:"
msgstr ""
#: snikket_web/templates/library.j2:18 #: snikket_web/templates/library.j2:18
msgid "Copy link" msgid "Copy link"
msgstr "" msgstr ""

View File

@@ -98,7 +98,7 @@ async def change_pw() -> typing.Union[str, quart.Response]:
quart.exceptions.Forbidden): quart.exceptions.Forbidden):
# server refused current password, set an appropriate error # server refused current password, set an appropriate error
form.current_password.errors.append( form.current_password.errors.append(
_("Incorrect password"), _("Incorrect password."),
) )
else: else:
await flash( await flash(
@@ -112,7 +112,7 @@ async def change_pw() -> typing.Union[str, quart.Response]:
EAVATARTOOBIG = _l( EAVATARTOOBIG = _l(
"The chosen avatar is too big. To be able to upload larger " "The chosen avatar is too big. To be able to upload larger "
"avatars, please use the app" "avatars, please use the app."
) )