mirror of
https://github.com/Mailu/Mailu.git
synced 2025-01-18 03:21:36 +02:00
When selecting a non-stable version, add a message this is version is "only for testing".
The stable version is set via the new environment variable stable_version. E.g. stable_version=1.7
This commit is contained in:
parent
17cea83301
commit
7b27d0dd4e
@ -53,7 +53,10 @@ def build_app(path):
|
||||
|
||||
@app.context_processor
|
||||
def app_context():
|
||||
return dict(versions=os.getenv("VERSIONS","master").split(','))
|
||||
return dict(
|
||||
versions=os.getenv("VERSIONS","master").split(','),
|
||||
stable_version = os.getenv("stable_version", "master")
|
||||
)
|
||||
|
||||
prefix_bp = flask.Blueprint(version, __name__)
|
||||
prefix_bp.jinja_loader = jinja2.ChoiceLoader([
|
||||
|
@ -8,13 +8,21 @@
|
||||
<h1>Mailu configuration</h1>
|
||||
<p>
|
||||
Version
|
||||
<select onchange="window.location.href=this.value;" class="btn btn-primary dropdown-toggle">
|
||||
<select id=version_select onchange="window.location.href=this.value;" class="btn btn-primary dropdown-toggle">
|
||||
{% for module in versions %}
|
||||
<option value="/{{ module }}" {% if module == version %}selected{% endif %}>{{ module }}</option>
|
||||
<option value="/{{ module }}" {% if module == version %}selected {% endif %}>{{ module }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</p>
|
||||
|
||||
{% if version != stable_version %}
|
||||
{% call macros.panel("danger", "You have not selected the stable version") %}
|
||||
You have not selected the stable version. The stable version is {{ stable_version }}.
|
||||
The selected version can be used for testing and reporting bugs.
|
||||
For production scenarios we recommend to use the stable version.
|
||||
{% endcall %}
|
||||
{% endif %}
|
||||
|
||||
{% block page %}{% endblock %}
|
||||
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user