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
master
Dimitri Huisman 4 years ago
parent 17cea83301
commit 7b27d0dd4e

@ -53,7 +53,10 @@ def build_app(path):
@app.context_processor @app.context_processor
def app_context(): 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 = flask.Blueprint(version, __name__)
prefix_bp.jinja_loader = jinja2.ChoiceLoader([ prefix_bp.jinja_loader = jinja2.ChoiceLoader([

@ -8,13 +8,21 @@
<h1>Mailu configuration</h1> <h1>Mailu configuration</h1>
<p> <p>
Version 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 %} {% 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 %} {% endfor %}
</select> </select>
</p> </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 %} {% block page %}{% endblock %}
</div> </div>

Loading…
Cancel
Save