Add version numbers; make app title configurable

This commit is contained in:
Lexi / Zoe 2021-09-23 00:55:05 +02:00
parent 186dcdc0cb
commit 8df2684e5c
Signed by: binaryDiv
GPG key ID: F8D4956E224DA232
11 changed files with 159 additions and 38 deletions

View file

@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>{% block title %}Untitled page{% endblock %} - MailAccountAdmin</title>
<title>{% block title %}Untitled page{% endblock %} - {{ app_info.getTitle() }}</title>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="stylesheet" href="/static/style.css"/>
</head>
@ -10,27 +10,37 @@
<body>
<header>
<h1>MailAccountAdmin</h1>
<h1>{{ app_info.getTitle() }}</h1>
<div class="header_appversion">
<a href="{{ app_info.getRepositoryUrl() }}">{{ app_info.getVersion() }}</a>
</div>
<div class="header_spacer"></div>
<div class="header_userstatus">
Hello, <b>{{ current_user_name }}</b>. | <a href="/logout">Logout</a>
{% if logged_in | default() %}
Hello, <b>{{ current_user_name }}</b>. | <a href="/logout">Logout</a>
{% else %}
<a href="/login">Login</a>
{% endif %}
</div>
</header>
<nav>
<ul>
{% macro navbar_item(path, text) -%}
<li{% if current_url() == path or current_url() starts with path ~ '/' %} class="nav_current_page"{% endif %}>
<a href="{{ path }}">{{ text }}</a>
</li>
{%- endmacro -%}
{% if logged_in | default() %}
<nav>
<ul>
{% macro navbar_item(path, text) -%}
<li{% if current_url() == path or current_url() starts with path ~ '/' %} class="nav_current_page"{% endif %}>
<a href="{{ path }}">{{ text }}</a>
</li>
{%- endmacro -%}
{{ _self.navbar_item('/', 'Dashboard') }}
{{ _self.navbar_item('/domains', 'Domains') }}
{{ _self.navbar_item('/accounts', 'Accounts') }}
</ul>
</nav>
{{ _self.navbar_item('/', 'Dashboard') }}
{{ _self.navbar_item('/domains', 'Domains') }}
{{ _self.navbar_item('/accounts', 'Accounts') }}
</ul>
</nav>
{% endif %}
<main>
<main{% if main_classes is defined %} class="{{ main_classes }}"{% endif %}>
{% block content %}
Nothing to see here...
{% endblock %}

View file

@ -1,19 +1,9 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>Login - MailAccountAdmin</title>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="stylesheet" href="/static/style.css"/>
</head>
{% extends "base.html.twig" %}
<body>
{% block title %}Login{% endblock %}
{% set main_classes = 'login_page' %}
<header>
<h1>MailAccountAdmin</h1>
</header>
<main class="login_page">
{% block content %}
<h2>Login</h2>
<form action="/login" method="POST">
@ -38,7 +28,4 @@
</tr>
</table>
</form>
</main>
</body>
</html>
{% endblock %}