blob: e90a720a195f6b81542d2b5bbf97c691399a4e71 [file] [log] [blame]
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +01001{% extends 'base.twig' %}
2
3{% block navbar %}{% endblock %}
4
5{% block content %}
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +01006<div class="row mb-4" style="margin-top: 60px">
7 <div class="col-12 col-md-7 col-lg-6 col-xl-5 ms-auto me-auto">
8 <div class="card">
9 <div class="card-header d-flex align-items-center">
10 <i class="bi bi-person-fill me-2"></i> {{ lang.login.login }}
11 <div class="ms-auto form-check form-switch my-auto d-flex align-items-center">
12 <label class="form-check-label"><i class="bi bi-moon-fill"></i></label>
13 <input class="form-check-input ms-2" type="checkbox" id="dark-mode-toggle">
14 </div>
15 </div>
16 <div class="card-body">
17 <div class="text-center mailcow-logo mb-4"><img src="{{ logo|default('/img/cow_mailcow.svg') }}" alt="mailcow"></div>
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010018 {% if ui_texts.ui_announcement_text and ui_texts.ui_announcement_active %}
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010019 <div class="my-4 alert alert-{{ ui_texts.ui_announcement_type }} rot-enc ui-announcement-alert">{{ ui_texts.ui_announcement_text|rot13 }}</div>
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010020 {% endif %}
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010021 <legend>{% if oauth2_request %}{{ lang.oauth2.authorize_app }}{% else %}{{ ui_texts.main_name|raw }}{% endif %}</legend><hr />
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010022 {% if is_mobileconfig %}
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010023 <div class="my-4 alert alert-info ">{{ lang.login.mobileconfig_info }}</div>
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010024 {% endif %}
25 <form method="post" autofill="off">
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010026 <div class="d-flex mt-3">
27 <label class="visually-hidden" for="login_user">{{ lang.login.username }}</label>
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010028 <div class="input-group">
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010029 <div class="input-group-text"><i class="bi bi-person-fill"></i></div>
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010030 <input name="login_user" autocorrect="off" autocapitalize="none" type="{% if is_mobileconfig %}email{% else %}text{% endif %}" id="login_user" class="form-control" placeholder="{{ lang.login.username }}" required="" autofocus="" autocomplete="username">
31 </div>
32 </div>
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010033 <div class="d-flex mt-3">
34 <label class="visually-hidden" for="pass_user">{{ lang.login.password }}</label>
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010035 <div class="input-group">
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010036 <div class="input-group-text"><i class="bi bi-lock-fill"></i></div>
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010037 <input name="pass_user" type="password" id="pass_user" class="form-control" placeholder="{{ lang.login.password }}" required="" autocomplete="current-password">
38 </div>
39 </div>
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010040 <div class="d-flex mt-4" style="position: relative">
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010041 <div class="btn-group">
42 <div class="btn-group">
43 <button type="submit" class="btn btn-xs-lg btn-success" value="Login">{{ lang.login.login }}</button>
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010044 <button type="button" class="btn btn-xs-lg btn-success dropdown-toggle" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></button>
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010045 <ul class="dropdown-menu">
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010046 <li><a class="dropdown-item" href="#" id="fido2-login"><i class="bi bi-shield-fill-check"></i> {{ lang.login.fido2_webauthn }}</a></li>
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010047 </ul>
48 </div>
49 </div>
50 {% if not oauth2_request %}
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010051 <button type="button" {% if available_languages|length == 1 %}disabled="true"{% endif %} class="btn btn-xs-lg btn-secondary ms-auto dropdown-toggle" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
52 <span class="flag-icon flag-icon-{{ mailcow_locale[-2:] }}"></span>
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010053 </button>
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010054 <ul class="dropdown-menu ms-auto login">
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010055 {% for key, val in available_languages %}
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010056 <li>
57 <a class="dropdown-item {% if mailcow_locale == key %}active{% endif %}" href="?{{ query_string({'lang': key}) }}">
58 <span class="flag-icon flag-icon-{{ key[-2:] }}"></span>{{ val }}
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010059 </a>
60 </li>
61 {% endfor %}
62 </ul>
63 {% endif %}
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010064 </div>
65 </form>
66 {% if login_delay %}
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010067 <p><div class="my-4 alert alert-info">{{ lang.login.delayed|format(login_delay) }}</b></div></p>
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010068 {% endif %}
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010069 <div class="my-4" id="fido2-alerts"></div>
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010070 {% if not oauth2_request and (mailcow_apps or app_links) %}
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010071 <legend><i class="bi bi-link-45deg"></i> {{ ui_texts.apps_name|raw }}</legend><hr />
72 <div class="my-2 d-flex flex-wrap apps">
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010073 {% for app in mailcow_apps %}
74 {% if not skip_sogo or not is_uri('SOGo', app.link) %}
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010075 <div class="m-2">
76 <a href="{{ app.link }}" role="button" {% if app.description %}title="{{ app.description }}"{% endif %} class="btn btn-primary btn-block">{{ app.name }}</a>
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010077 </div>
78 {% endif %}
79 {% endfor %}
80 {% for row in app_links %}
81 {% for key, val in row %}
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010082 <div class="m-2">
83 <a href="{{ val }}" role="button" class="btn btn-primary btn-block">{{ key }}</a>
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010084 </div>
85 {% endfor %}
86 {% endfor %}
87 </div>
88 {% endif %}
89 </div>
90 </div>
91 </div>
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010092</div>
93{% if not oauth2_request %}
94<div class="row">
95 <div class="col-12 col-md-7 col-lg-6 col-xl-5 ms-auto me-auto">
96 <div class="card">
97 <div class="card-header">
98 <a class="btn btn-link" data-bs-toggle="collapse" href="#collapse1"><i class="bi bi-patch-question-fill"></i> {{ lang.start.help }}</a>
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010099 </div>
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +0100100 <div id="collapse1" class="card-collapse collapse">
101 <div class="card-body">
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +0100102 {% if ui_texts.help_text %}
103 <p>{{ ui_texts.help_text|raw }}</p>
104 {% else %}
105 <p><span style="border-bottom: 1px dotted #999;">{{ ui_texts.main_name|raw }}</span></p>
106 <p>{{ lang.start.mailcow_panel_detail|raw }}</p>
107 <p><span style="border-bottom: 1px dotted #999;">{{ ui_texts.apps_name|raw }}</span></p>
108 <p>{{ lang.start.mailcow_apps_detail|raw }}</p>
109 {% endif %}
110 </div>
111 </div>
112 </div>
113 </div>
114 {% endif %}
115</div>
116{% endblock %}