Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 1 | {% extends 'base.twig' %} |
| 2 | |
| 3 | {% block navbar %}{% endblock %} |
| 4 | |
| 5 | {% block content %} |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 6 | <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 Benkard | d1f5b68 | 2023-11-18 13:18:30 +0100 | [diff] [blame] | 17 | <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 Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 21 | {% if ui_texts.ui_announcement_text and ui_texts.ui_announcement_active %} |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 22 | <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 Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 23 | {% endif %} |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 24 | <legend>{% if oauth2_request %}{{ lang.oauth2.authorize_app }}{% else %}{{ ui_texts.main_name|raw }}{% endif %}</legend><hr /> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 25 | {% if is_mobileconfig %} |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 26 | <div class="my-4 alert alert-info ">{{ lang.login.mobileconfig_info }}</div> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 27 | {% endif %} |
| 28 | <form method="post" autofill="off"> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 29 | <div class="d-flex mt-3"> |
| 30 | <label class="visually-hidden" for="login_user">{{ lang.login.username }}</label> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 31 | <div class="input-group"> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 32 | <div class="input-group-text"><i class="bi bi-person-fill"></i></div> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 33 | <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 Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 36 | <div class="d-flex mt-3"> |
| 37 | <label class="visually-hidden" for="pass_user">{{ lang.login.password }}</label> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 38 | <div class="input-group"> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 39 | <div class="input-group-text"><i class="bi bi-lock-fill"></i></div> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 40 | <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 Benkard | d1f5b68 | 2023-11-18 13:18:30 +0100 | [diff] [blame] | 43 | <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 Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 47 | </div> |
| 48 | {% if not oauth2_request %} |
Matthias Andreas Benkard | d1f5b68 | 2023-11-18 13:18:30 +0100 | [diff] [blame] | 49 | <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 Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 51 | <span class="flag-icon flag-icon-{{ mailcow_locale[-2:] }}"></span> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 52 | </button> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 53 | <ul class="dropdown-menu ms-auto login"> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 54 | {% for key, val in available_languages %} |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 55 | <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 Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 58 | </a> |
| 59 | </li> |
| 60 | {% endfor %} |
| 61 | </ul> |
Matthias Andreas Benkard | d1f5b68 | 2023-11-18 13:18:30 +0100 | [diff] [blame] | 62 | </div> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 63 | {% endif %} |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 64 | </div> |
| 65 | </form> |
| 66 | {% if login_delay %} |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 67 | <p><div class="my-4 alert alert-info">{{ lang.login.delayed|format(login_delay) }}</b></div></p> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 68 | {% endif %} |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 69 | <div class="my-4" id="fido2-alerts"></div> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 70 | {% if not oauth2_request and (mailcow_apps or app_links) %} |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 71 | <legend><i class="bi bi-link-45deg"></i> {{ ui_texts.apps_name|raw }}</legend><hr /> |
Matthias Andreas Benkard | d1f5b68 | 2023-11-18 13:18:30 +0100 | [diff] [blame] | 72 | <div class="my-2 d-grid gap-2 d-sm-block apps"> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 73 | {% for app in mailcow_apps %} |
| 74 | {% if not skip_sogo or not is_uri('SOGo', app.link) %} |
Matthias Andreas Benkard | d1f5b68 | 2023-11-18 13:18:30 +0100 | [diff] [blame] | 75 | <a href="{{ app.link }}" role="button" {% if app.description %}title="{{ app.description }}"{% endif %} class="btn btn-primary">{{ app.name }}</a> |
| 76 | {% endif %} |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 77 | {% endfor %} |
| 78 | {% for row in app_links %} |
| 79 | {% for key, val in row %} |
Matthias Andreas Benkard | d1f5b68 | 2023-11-18 13:18:30 +0100 | [diff] [blame] | 80 | <a href="{{ val }}" role="button" class="btn btn-primary">{{ key }}</a> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 81 | {% endfor %} |
| 82 | {% endfor %} |
| 83 | </div> |
| 84 | {% endif %} |
| 85 | </div> |
| 86 | </div> |
| 87 | </div> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 88 | </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 Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 95 | </div> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 96 | <div id="collapse1" class="card-collapse collapse"> |
| 97 | <div class="card-body"> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 98 | {% 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 %} |