Merge branch 'feature/site-name'

This commit is contained in:
Jonas Schäfer
2021-01-22 15:30:18 +01:00
7 changed files with 32 additions and 19 deletions

View File

@@ -30,6 +30,13 @@ SNIKKET_WEB_PROSODY_ENDPOINT='http://localhost:5280'
# This must be set for login to work correctly.
SNIKKET_WEB_DOMAIN='localhost'
# A human-friendly name for the Snikket server.
#
# This should not be too wide when rendered to fit into the layout.
# Defaults to SNIKKET_WEB_DOMAIN.
#
#SNIKKET_WEB_SITE_NAME
# OPTIONAL SETTINGS
# =================
@@ -40,4 +47,4 @@ SNIKKET_WEB_DOMAIN='localhost'
# of an avatar is still up-to-date on every request; if it is, the avatar is
# not re-transferred.
#
# SNIKKET_WEB_AVATAR_CACHE_TTL = 1800
#SNIKKET_WEB_AVATAR_CACHE_TTL=1800

View File

@@ -140,6 +140,7 @@ class AppConfig:
secret_key = environ.var()
prosody_endpoint = environ.var()
domain = environ.var()
site_name = environ.var("")
avatar_cache_ttl = environ.var(1800, converter=int)
languages = environ.var(["de", "en"], converter=autosplit)
@@ -169,6 +170,7 @@ def create_app() -> quart.Quart:
app.config["SECRET_KEY"] = config.secret_key
app.config["PROSODY_ENDPOINT"] = config.prosody_endpoint
app.config["SNIKKET_DOMAIN"] = config.domain
app.config["SITE_NAME"] = config.site_name or config.domain
app.config["AVATAR_CACHE_TTL"] = config.avatar_cache_ttl
app.context_processor(proc)

View File

@@ -9,13 +9,14 @@
<h1>{% trans %}About Snikket{% endtrans %}</h1>
<p>{% trans snikket_url="https://snikket.org" %}To learn more about Snikket, visit the <a href="{{ snikket_url}}">Snikket website</a>.{% endtrans %}</p>
<h2>{% trans %}About this Server{% endtrans %}</h2>
<p>{% trans domain=config["SNIKKET_DOMAIN"] %}This is the Snikket server <em>{{ domain }}</em>.{% endtrans %}</p>
<p>{% trans site_name=config["SITE_NAME"] %}This is the Snikket server <em>{{ site_name }}</em>.{% endtrans %}</p>
<h3>{% trans %}Licenses{% endtrans %}</h3>
<p>{% trans agpl_url="https://www.gnu.org/licenses/agpl.html" %}The web portal software is licensed under the terms of the <a href="{{ agpl_url }}">Affero GNU General Public License, version 3.0 or later</a>. The full terms of the license can be reviewed using the aforementioned link.{% endtrans %}</p>
<p>{% trans source_url="https://github.com/snikket-im/snikket-web-portal/" %}The source code of the web portal can be downloaded and viewed in <a href="{{ source_url }}">its GitHub repository</a>.{% endtrans %}</p>
<p>{% trans source_url="https://material.io/resources/icons/", apache20_url="https://www.apache.org/licenses/LICENSE-2.0.txt" %}The icons used in the web portal are <a href="{{ source_url }}">Googles Material Icons</a>, made available by Google under the terms of the <a href="{{ apache20_url }}">Apache 2.0 License</a>.{% endtrans %}</p>
<h3>{% trans %}Software Versions{% endtrans %}</h3>
<pre>Snikket Server (unknown)
<pre>Snikket Server
Domain: {{ config["SNIKKET_DOMAIN"] }}
Snikket Web Portal ({{ version }})
{%- if extra_versions -%}
{% for name, version in extra_versions.items() %}

View File

@@ -10,7 +10,7 @@
{% endblock %}
{% block body %}
<div id="mwrap"><main><div class="form layout-expanded">
<h1 class="form-title">{{ config["SNIKKET_DOMAIN"] }}</h1>
<h1 class="form-title">{{ config["SITE_NAME"] }}</h1>
<p class="form-desc">{{ _("Enter your Snikket address and password to manage your account.") }}</p>
<form method="POST" action="{{ url_for('.login') }}" name="login">
{{ form.csrf_token }}

View File

@@ -2,7 +2,7 @@
{% from "library.j2" import box, form_button %}
{% block body %}
<div id="topbar" class="{% block topbar_classes %}{% endblock %}">
<header><a href="{{ url_for('.index') }}"><span>{{ config["SNIKKET_DOMAIN"] }}</span></a></header>
<header><a href="{{ url_for('.index') }}"><span>{{ config["SITE_NAME"] }}</span></a></header>
{% block topbar_left %}{% endblock %}
<div class="filler"></div>
{% block topbar_right %}{% endblock %}

View File

@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: SnikketWeb 0.1.0\n"
"Report-Msgid-Bugs-To: jonas@zombofant.net\n"
"POT-Creation-Date: 2021-01-21 17:39+0100\n"
"POT-Creation-Date: 2021-01-22 15:27+0100\n"
"PO-Revision-Date: 2020-03-07 16:32+0100\n"
"Last-Translator: Jonas Schäfer <jonas@zombofant.net>\n"
"Language: de\n"
@@ -94,19 +94,19 @@ msgstr "Benutzer hinzufügen"
msgid "Main"
msgstr "Kern"
#: snikket_web/main.py:37
#: snikket_web/main.py:36
msgid "Address"
msgstr "Adresse"
#: snikket_web/main.py:42
#: snikket_web/main.py:41
msgid "Password"
msgstr "Passwort"
#: snikket_web/main.py:47
#: snikket_web/main.py:46
msgid "Sign in"
msgstr "Anmelden"
#: snikket_web/main.py:73
#: snikket_web/main.py:72
msgid "Invalid user name or password."
msgstr "Benutzername oder Passwort falsch."
@@ -178,9 +178,9 @@ msgid "About this Server"
msgstr "Über diesen Server"
#: snikket_web/templates/about.html:12
#, python-format
msgid "This is the Snikket server <em>%(domain)s</em>."
msgstr "Dies ist der Snikket-Server <em>%(domain)s</em>."
#, fuzzy, python-format
msgid "This is the Snikket server <em>%(site_name)s</em>."
msgstr "Dies ist der Snikket-Server <em>%(site_name)s</em>."
#: snikket_web/templates/about.html:13
msgid "Licenses"

View File

@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2021-01-21 17:39+0100\n"
"POT-Creation-Date: 2021-01-22 15:27+0100\n"
"PO-Revision-Date: 2020-03-07 16:50+0100\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: en\n"
@@ -94,19 +94,19 @@ msgstr ""
msgid "Main"
msgstr ""
#: snikket_web/main.py:37
#: snikket_web/main.py:36
msgid "Address"
msgstr ""
#: snikket_web/main.py:42
#: snikket_web/main.py:41
msgid "Password"
msgstr ""
#: snikket_web/main.py:47
#: snikket_web/main.py:46
msgid "Sign in"
msgstr ""
#: snikket_web/main.py:73
#: snikket_web/main.py:72
#, fuzzy
msgid "Invalid user name or password."
msgstr ""
@@ -179,7 +179,7 @@ msgstr ""
#: snikket_web/templates/about.html:12
#, python-format
msgid "This is the Snikket server <em>%(domain)s</em>."
msgid "This is the Snikket server <em>%(site_name)s</em>."
msgstr ""
#: snikket_web/templates/about.html:13
@@ -696,3 +696,6 @@ msgstr ""
#~ msgid "All users on this instance have already been added."
#~ msgstr ""
#~ msgid "This is the Snikket server <em>%(domain)s</em>."
#~ msgstr ""