Skip to content
Snippets Groups Projects
Verified Commit b4ab74d0 authored by Jan Pavlíček's avatar Jan Pavlíček
Browse files

gui features

parent 31ea5efd
No related branches found
No related tags found
No related merge requests found
Pipeline #322913 failed
...@@ -66,7 +66,7 @@ def construct_gui_blueprint(cfg): ...@@ -66,7 +66,7 @@ def construct_gui_blueprint(cfg):
# session_services = [rp_names.get(c_id, {}).get(lang, c_id) for c_id in session_active_client_ids] # session_services = [rp_names.get(c_id, {}).get(lang, c_id) for c_id in session_active_client_ids]
# device_services = [rp_names.get(c_id, {}).get(lang, c_id) for c_id in device_active_client_ids] # device_services = [rp_names.get(c_id, {}).get(lang, c_id) for c_id in device_active_client_ids]
logged_out_service = None logged_out_service = "logged out"
session_services = [ session_services = [
{ {
"id": 1, "id": 1,
...@@ -105,6 +105,7 @@ def construct_gui_blueprint(cfg): ...@@ -105,6 +105,7 @@ def construct_gui_blueprint(cfg):
session_services=session_services, session_services=session_services,
device_services=device_services, device_services=device_services,
bootstrap_color=COLOR, bootstrap_color=COLOR,
init_logged_out_service={ "logback_url": "https://google.com", "labels": {"cs": "CZECH SERVICE", "en": "EN_SERVICEasdasddadsadasdasdasdad"}}
) )
@gui.route("/logout_state") @gui.route("/logout_state")
......
<svg xmlns="http://www.w3.org/2000/svg" height="2em" viewBox="0 0 512 512"><!--! Font Awesome Pro 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><style>svg{fill:#34ad00}</style><path d="M256 48a208 208 0 1 1 0 416 208 208 0 1 1 0-416zm0 464A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-111 111-47-47c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l64 64c9.4 9.4 24.6 9.4 33.9 0L369 209z"/></svg> <svg xmlns="http://www.w3.org/2000/svg" height="2.25em" viewBox="0 0 512 512"><!--! Font Awesome Pro 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><style>svg{fill:#34ad00}</style><path d="M256 48a208 208 0 1 1 0 416 208 208 0 1 1 0-416zm0 464A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-111 111-47-47c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l64 64c9.4 9.4 24.6 9.4 33.9 0L369 209z"/></svg>
\ No newline at end of file \ No newline at end of file
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
gap: 1em;
} }
.my-flex-row { .my-flex-row {
...@@ -25,4 +26,12 @@ ...@@ -25,4 +26,12 @@
.margin-top-1em { .margin-top-1em {
margin-top: 1em; margin-top: 1em;
}
.margin-bot-1em {
margin-bottom: 1em;
}
.services-box {
text-align: start;
} }
\ No newline at end of file
{% extends 'base.html' %}
{% block contentwrapper %}
<div
class="window {% if cfg.css_framework == 'MUNI' %}framework_muni{% else %}framework_bootstrap5 bg-light{% endif %}">
<div
class="wrap{% if not cfg.css_framework == 'MUNI' %} d-flex flex-column gap-2{% endif %}">
<br>
<h4>{{ _("Do you really want to log out from") }}
{{ logged_out_service }}?
</h4>
<p class="{% if cfg.css_framework == 'MUNI' %}btn-wrap{% else %}d-flex flex-row justify-content-center gap-3{% endif %}">
<button onclick=""
class="btn btn-primary btn-s">
<span class="no-uppercase">{{ _('Yes') }}</span>
</button>
<button onclick=""
class="btn btn-primary btn-s">
<span class="no-uppercase">{{ _('No') }}</span>
</button>
</p>
</div>
</div>
{% endblock %}
...@@ -6,25 +6,17 @@ ...@@ -6,25 +6,17 @@
<div <div
class="wrap{% if not cfg.css_framework == 'MUNI' %} d-flex flex-column gap-2{% endif %}"> class="wrap{% if not cfg.css_framework == 'MUNI' %} d-flex flex-column gap-2{% endif %}">
{% if logged_out_service is not none %} {% if logged_out_service is not none %}
{% if cfg.css_framework == 'MUNI' %} <h1 class="h1 margin-top-1em">{{ _("Logout Successful") }}</h1>
<h2 class="margin-top-1em">{{ _("Logout Successful") }}</h2> <h2 class="h3">{{ _("You have successfully logged out from ") }}
{% else %}
<h1 class="margin-top-1em">{{ _("Logout Successful") }}</h1>
{% endif %}
<h4>{{ _("You have successfully logged out from ") }}
{{ logged_out_service }}. {{ logged_out_service }}.
</h4> </h2>
{% else %} {% else %}
{% if cfg.css_framework == 'MUNI' %} <h1 class="margin-top-1em">{{ _("Logout Page") }}</h1>
<h2 class="margin-top-1em">{{ _("Logout Page") }}</h2>
{% else %}
<h1 class="margin-top-1em">{{ _("Logout Page") }}</h1>
{% endif %}
{% endif %} {% endif %}
<hr> <hr>
<div class="my-flex-column"> <div class="my-flex-column">
<div style="text-align: start"> <div class="services-box">
<h4>{{ _("Would you like to log out from the services below?") }}</h4> <h2 class="h4">{{ _("Would you like to log out from the services below?") }}</h2>
<p class="{% if cfg.css_framework == 'MUNI' %}btn-wrap{% else %}d-flex flex-row gap-3 ms-3{% endif %}"> <p class="{% if cfg.css_framework == 'MUNI' %}btn-wrap{% else %}d-flex flex-row gap-3 ms-3{% endif %}">
<a href="{{ url_for('gui.logout_state', from_devices=False) }}" <a href="{{ url_for('gui.logout_state', from_devices=False) }}"
class="btn btn-primary btn-s"> class="btn btn-primary btn-s">
...@@ -40,13 +32,13 @@ ...@@ -40,13 +32,13 @@
<span class="no-uppercase">{{ _('No') }}</span> <span class="no-uppercase">{{ _('No') }}</span>
</a> </a>
</p> </p>
<h4>{{ _("You can log out from the following services:") }}</h4> <h2 class="h5">{{ _("You can log out from the following services:") }}</h2>
<ul> <ul>
{% for service in session_services %} {% for service in session_services %}
<li>{{ service.rp_names.get(lang) }} </li> <li>{{ service.rp_names.get(lang) }} </li>
{% endfor %} {% endfor %}
</ul> </ul>
<h4>{{ _("You can log out from these services on your other devices:") }}</h4> <h2 class="h5">{{ _("You can log out from these services on your other devices:") }}</h2>
<ul> <ul>
{% for service in device_services %} {% for service in device_services %}
<li>{{ service.rp_names.get(lang) }} </li> <li>{{ service.rp_names.get(lang) }} </li>
......
...@@ -3,13 +3,24 @@ ...@@ -3,13 +3,24 @@
{% block contentwrapper %} {% block contentwrapper %}
<div <div
class="window {% if cfg.css_framework == 'MUNI' %}framework_muni{% else %}framework_bootstrap5 bg-light{% endif %}"> class="window {% if cfg.css_framework == 'MUNI' %}framework_muni{% else %}framework_bootstrap5 bg-light{% endif %}">
<br>
<div class="my-flex-column"> <div class="my-flex-column">
<div class="my-flex-row"> <div class="my-flex-row">
<img src="/static/images/circle-check-regular.svg"> <h1 class="nowrap margin-top-1em">
<h2 class="margin-left-24">{{ _("Logout successful") }}</h2> <img src="{{ url_for("static", filename="images/circle-check-regular.svg") }}">
{{ _("Logout successful") }}
</h1>
</div> </div>
</div> </div>
<br> {% if init_logged_out_service.logback_url is not none %}
<div class="my-flex-column margin-bot-1em">
<h2 class="h4">{{ _("Would you like to log back to") }} {{ init_logged_out_service.labels.get(lang) }}?</h2>
<p class="{% if cfg.css_framework == 'MUNI' %}btn-wrap{% else %}d-flex flex-row gap-3{% endif %}">
<a href="{{ init_logged_out_service.logback_url }}"
class="btn btn-primary btn-s">
<span class="no-uppercase">{{ _('Log back') }}</span>
</a>
</p>
</div>
{% endif %}
</div> </div>
{% endblock %} {% endblock %}
...@@ -5,38 +5,30 @@ ...@@ -5,38 +5,30 @@
class="window {% if cfg.css_framework == 'MUNI' %}framework_muni{% else %}framework_bootstrap5 bg-light{% endif %}"> class="window {% if cfg.css_framework == 'MUNI' %}framework_muni{% else %}framework_bootstrap5 bg-light{% endif %}">
<div <div
class="wrap{% if not cfg.css_framework == 'MUNI' %} d-flex flex-column gap-2{% endif %}"> class="wrap{% if not cfg.css_framework == 'MUNI' %} d-flex flex-column gap-2{% endif %}">
{% if cfg.css_framework == 'MUNI' %} <h1 class="margin-top-1em">{{ _("Performing log out") }}</h1>
<h2 class="margin-top-1em">{{ _("Performing log out") }}</h2>
{% else %}
<h1 class="margin-top-1em">{{ _("Performing log out") }}</h1>
{% endif %}
<hr>
<p class="{% if cfg.css_framework == 'MUNI' %}btn-wrap{% else %}d-flex flex-row justify-content-center{% endif %}"> <p class="{% if cfg.css_framework == 'MUNI' %}btn-wrap{% else %}d-flex flex-row justify-content-center{% endif %}">
<a href="{{ url_for('gui.post_logout') }}" <a href="{{ url_for('gui.post_logout') }}"
class="btn btn-primary btn-s"> class="btn btn-primary btn-s">
<span class="no-uppercase">{{ _('Continue') }}</span> <span class="no-uppercase">{{ _('Continue') }}</span>
</a> </a>
</p> </p>
<hr>
<div class="my-flex-column"> <div class="my-flex-column">
<div style="text-align: start"> <div class="services-box">
{% if session_services|length != 0 %} {% if session_services|length != 0 %}
<h4 class="margin-top-1em">{{ _("Performing logout from following services: ") }}</h4> <h2 class="h4 margin-top-1em">{{ _("Performing logout from following services: ") }}</h2>
{% for service in session_services %} {% for service in session_services %}
<div id="{{ service.id }}" <div id="{{ service.id }}"
class="process my-flex-row"> class="process my-flex-row">
{% if not service.iframe_src %} {% if not service.iframe_src %}
<img <img src="{{ url_for("static", filename="images/circle-exclamation-solid.svg") }}">
src="/static/images/circle-exclamation-solid.svg">
{% elif service.front_channel %} {% elif service.front_channel %}
<img src="/static/images/questionmark.svg"> <img src="{{ url_for("static", filename="images/questionmark.svg") }}">
<iframe src="{{ service.iframe_src }}" <iframe src="{{ service.iframe_src }}" hidden></iframe>
hidden></iframe>
{% else %} {% else %}
<img src="/static/images/spinner.svg" <img src="{{ url_for("static", filename="images/spinner.svg") }}"
class="spinner"> class="spinner">
<iframe id="iframe_{{ service.id }}" <iframe id="iframe_{{ service.id }}" src="{{ service.iframe_src }}" hidden></iframe>
src="{{ service.iframe_src }}"
hidden></iframe>
{% endif %} {% endif %}
<div <div
class="margin-left-12">{{ service.rp_names.get(lang) }}</div> class="margin-left-12">{{ service.rp_names.get(lang) }}</div>
...@@ -44,23 +36,19 @@ ...@@ -44,23 +36,19 @@
{% endfor %} {% endfor %}
{% endif %} {% endif %}
{% if device_services|length != 0 %} {% if device_services|length != 0 %}
<h4 class="margin-top-1em">{{ _("Performing logout from following services on your other devices:") }}</h4> <h2 class="h4 margin-top-1em">{{ _("Performing logout from following services on your other devices:") }}</h2>
{% for service in device_services %} {% for service in device_services %}
<div id="{{ service.id }}" <div id="{{ service.id }}"
class="process my-flex-row"> class="process my-flex-row">
{% if not service.iframe_src %} {% if not service.iframe_src %}
<img <img src="{{ url_for("static", filename="images/circle-exclamation-solid.svg") }}">
src="/static/images/circle-exclamation-solid.svg"> {% elif service.logout_type == "FRONTCHANNEL_LOGOUT" %}
{% elif service.front_channel %} <img src="{{ url_for("static", filename="images/questionmark.svg") }}">
<img src="/static/images/questionmark.svg"> <iframe src="{{ service.iframe_src }}" hidden></iframe>
<iframe src="{{ service.iframe_src }}"
hidden></iframe>
{% else %} {% else %}
<img src="/static/images/spinner.svg" <img src="{{ url_for("static", filename="images/spinner.svg") }}"
class="spinner"> class="spinner">
<iframe id="iframe_{{ service.id }}" <iframe id="iframe_{{ service.id }}" src="{{ service.iframe_src }}" hidden></iframe>
src="{{ service.iframe_src }}"
hidden></iframe>
{% endif %} {% endif %}
<div <div
class="margin-left-12">{{ service.rp_names.get(lang) }}</div> class="margin-left-12">{{ service.rp_names.get(lang) }}</div>
...@@ -71,4 +59,4 @@ ...@@ -71,4 +59,4 @@
</div> </div>
</div> </div>
</div> </div>
{% endblock %} {% endblock %}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment