blob: aa282547cd50b2fda85a5361a8225493eccc7338 [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">
Matthias Andreas Benkardd1f5b682023-11-18 13:18:30 +010017 <div class="text-center mailcow-logo mb-4">
18 <img class="main-logo" src="{{ logo|default('/img/cow_mailcow.svg') }}" alt="mailcow">
19 <img class="main-logo-dark" src="{{ logo_dark|default('/img/cow_mailcow.svg') }}" alt="mailcow-logo-dark">
20 </div>
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010021 {% if ui_texts.ui_announcement_text and ui_texts.ui_announcement_active %}
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010022 <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 +010023 {% endif %}
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010024 <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 +010025 {% if is_mobileconfig %}
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010026 <div class="my-4 alert alert-info ">{{ lang.login.mobileconfig_info }}</div>
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010027 {% endif %}
28 <form method="post" autofill="off">
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010029 <div class="d-flex mt-3">
30 <label class="visually-hidden" for="login_user">{{ lang.login.username }}</label>
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010031 <div class="input-group">
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010032 <div class="input-group-text"><i class="bi bi-person-fill"></i></div>
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010033 <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">
34 </div>
35 </div>
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010036 <div class="d-flex mt-3">
37 <label class="visually-hidden" for="pass_user">{{ lang.login.password }}</label>
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010038 <div class="input-group">
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010039 <div class="input-group-text"><i class="bi bi-lock-fill"></i></div>
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010040 <input name="pass_user" type="password" id="pass_user" class="form-control" placeholder="{{ lang.login.password }}" required="" autocomplete="current-password">
41 </div>
42 </div>
Matthias Andreas Benkardd1f5b682023-11-18 13:18:30 +010043 <div class="d-flex justify-content-between mt-4" style="position: relative">
44 <div class="d-grid gap-2 d-sm-block">
45 <button type="submit" class="btn btn-xs-lg btn-success" value="Login">{{ lang.login.login }}</button>
46 <button type="button" class="btn btn-xs-lg btn-success" id="fido2-login"><i class="bi bi-shield-fill-check"></i> {{ lang.login.fido2_webauthn }}</button>
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010047 </div>
48 {% if not oauth2_request %}
Matthias Andreas Benkardd1f5b682023-11-18 13:18:30 +010049 <div class="d-grid d-sm-block">
50 <button type="button" {% if available_languages|length == 1 %}disabled="true"{% endif %} class="btn btn-secondary ms-auto dropdown-toggle" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010051 <span class="flag-icon flag-icon-{{ mailcow_locale[-2:] }}"></span>
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010052 </button>
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010053 <ul class="dropdown-menu ms-auto login">
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010054 {% for key, val in available_languages %}
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010055 <li>
56 <a class="dropdown-item {% if mailcow_locale == key %}active{% endif %}" href="?{{ query_string({'lang': key}) }}">
57 <span class="flag-icon flag-icon-{{ key[-2:] }}"></span>{{ val }}
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010058 </a>
59 </li>
60 {% endfor %}
61 </ul>
Matthias Andreas Benkardd1f5b682023-11-18 13:18:30 +010062 </div>
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010063 {% 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 />
Matthias Andreas Benkardd1f5b682023-11-18 13:18:30 +010072 <div class="my-2 d-grid gap-2 d-sm-block 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 Benkardd1f5b682023-11-18 13:18:30 +010075 <a href="{{ app.link }}" role="button" {% if app.description %}title="{{ app.description }}"{% endif %} class="btn btn-primary">{{ app.name }}</a>
76 {% endif %}
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010077 {% endfor %}
78 {% for row in app_links %}
79 {% for key, val in row %}
Matthias Andreas Benkardd1f5b682023-11-18 13:18:30 +010080 <a href="{{ val }}" role="button" class="btn btn-primary">{{ key }}</a>
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010081 {% endfor %}
82 {% endfor %}
83 </div>
84 {% endif %}
85 </div>
86 </div>
87 </div>
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010088</div>
89{% if not oauth2_request %}
90<div class="row">
91 <div class="col-12 col-md-7 col-lg-6 col-xl-5 ms-auto me-auto">
92 <div class="card">
93 <div class="card-header">
94 <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 +010095 </div>
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010096 <div id="collapse1" class="card-collapse collapse">
97 <div class="card-body">
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +010098 {% if ui_texts.help_text %}
99 <p>{{ ui_texts.help_text|raw }}</p>
100 {% else %}
101 <p><span style="border-bottom: 1px dotted #999;">{{ ui_texts.main_name|raw }}</span></p>
102 <p>{{ lang.start.mailcow_panel_detail|raw }}</p>
103 <p><span style="border-bottom: 1px dotted #999;">{{ ui_texts.apps_name|raw }}</span></p>
104 <p>{{ lang.start.mailcow_apps_detail|raw }}</p>
105 {% endif %}
106 </div>
107 </div>
108 </div>
109 </div>
110 {% endif %}
111</div>
112{% endblock %}