Improve the sidebar, display site title and website link

master
kaiyou 7 years ago
parent 924760273c
commit 716e166b11

@ -85,6 +85,12 @@ WEB_ADMIN=/admin
# Path to the webmail if enabled
WEB_WEBMAIL=/webmail
# Website name
SITENAME=Mailu
# Linked Website URL
WEBSITE=https://mailu.io
###################################
# Advanced settings
###################################

@ -20,6 +20,8 @@ default_config = {
'HOSTNAMES': 'mail.mailu.io',
'DOMAIN': 'mailu.io',
'POSTMASTER': 'postmaster',
'SITENAME': 'Mailu',
'WEBSITE': 'https://mailu.io',
'DEBUG': False,
'BOOTSTRAP_SERVE_LOCAL': True,
'DKIM_PATH': '/dkim/{domain}.{selector}.key',
@ -32,6 +34,7 @@ default_config = {
'TLS_FLAVOR': 'cert',
'CERTS_PATH': '/certs',
'PASSWORD_SCHEME': 'SHA512-CRYPT',
'WEBMAIL': 'none',
}
# Load configuration from the environment if available
@ -72,8 +75,11 @@ def handle_needs_login():
)
@app.context_processor
def inject_user():
return dict(current_user=flask_login.current_user)
def inject_defaults():
return dict(
current_user=flask_login.current_user,
config=app.config
)
# Import views
from mailu import ui, internal

@ -1,17 +1,4 @@
{% extends "base.html" %}
{% block sidebar %}
<section class="sidebar">
<ul class="sidebar-menu">
<li class="header">{% trans %}Your account{% endtrans %}</li>
<li>
<a href="#">
<i class="fa fa-sign-in"></i> <span>{% trans %}Sign in{% endtrans %}</span>
</a>
</li>
</ul>
</section>
{% endblock %}
{% extends "form.html" %}
{% block title %}
{% trans %}Sign in{% endtrans %}
@ -20,9 +7,3 @@
{% block subtitle %}
{% trans %}to access the administration tools{% endtrans %}
{% endblock %}
{% block content %}
{% call macros.box() %}
{{ macros.form(form) }}
{% endcall %}
{% endblock %}

@ -1,7 +1,10 @@
<section class="sidebar">
{% if current_user.is_authenticated %}
<h4 class="text-center text-primary">{{ current_user }}</h4>
{% endif %}
<ul class="sidebar-menu">
{% if current_user.is_authenticated %}
<li class="header">{% trans %}My account{% endtrans %}</li>
<li>
<a href="{{ url_for('.user_settings') }}">
@ -28,11 +31,7 @@
<i class="fa fa-download"></i> <span>{% trans %}Fetched accounts{% endtrans %}</span>
</a>
</li>
<li>
<a href="{{ url_for('.logout') }}">
<i class="fa fa-sign-out"></i> <span>{% trans %}Sign out{% endtrans %}</span>
</a>
</li>
<li class="header">{% trans %}Administration{% endtrans %}</li>
{% if current_user.global_admin %}
<li>
@ -63,11 +62,38 @@
</a>
</li>
{% endif %}
{% endif %}
<li class="header">{% trans %}Go to{% endtrans %}</li>
{% if config["WEBMAIL"] != "none" %}
<li>
<a href="/webmail/">
<i class="fa fa-envelope-o"></i> <span>{% trans %}Webmail{% endtrans %}</span>
</a>
</li>
{% endif %}
<li>
<a href="https://mailu.io">
<i class="fa fa-globe"></i> <span>{% trans %}Website{% endtrans %}</span>
</a>
</li>
<li>
<a href="https://github.com/Mailu/Mailu">
<i class="fa fa-life-ring"></i> <span>{% trans %}Help{% endtrans %}</span>
</a>
</li>
{% if current_user.is_authenticated %}
<li>
<a href="{{ url_for('.logout') }}">
<i class="fa fa-sign-out"></i> <span>{% trans %}Sign out{% endtrans %}</span>
</a>
</li>
{% else %}
<li>
<a href="#">
<i class="fa fa-sign-in"></i> <span>{% trans %}Sign in{% endtrans %}</span>
</a>
</li>
{% endif %}
</ul>
</section>

@ -62,8 +62,7 @@ def domain_delete(domain_name):
@access.domain_admin(models.Domain, 'domain_name')
def domain_details(domain_name):
domain = models.Domain.query.get(domain_name) or flask.abort(404)
return flask.render_template('domain/details.html', domain=domain,
config=app.config)
return flask.render_template('domain/details.html', domain=domain)
@ui.route('/domain/genkeys/<domain_name>', methods=['GET', 'POST'])

Loading…
Cancel
Save