mirror of
https://github.com/simple-login/app.git
synced 2024-09-28 20:51:29 +02:00
show msg on /internal/integrations/proton (#1139)
* show msg on /internal/integrations/proton * highlight the connect with Proton section * djlint
This commit is contained in:
parent
2f9301eb97
commit
6d86e64d65
@ -1,6 +1,6 @@
|
|||||||
import arrow
|
import arrow
|
||||||
from app.config import CONNECT_WITH_PROTON_COOKIE_NAME, URL
|
from app.config import CONNECT_WITH_PROTON_COOKIE_NAME, URL
|
||||||
from flask import make_response, redirect, url_for
|
from flask import make_response, redirect, url_for, flash
|
||||||
from flask_login import current_user
|
from flask_login import current_user
|
||||||
from .base import internal_bp
|
from .base import internal_bp
|
||||||
|
|
||||||
@ -8,12 +8,13 @@ from .base import internal_bp
|
|||||||
@internal_bp.route("/integrations/proton")
|
@internal_bp.route("/integrations/proton")
|
||||||
def set_enable_proton_cookie():
|
def set_enable_proton_cookie():
|
||||||
if current_user.is_authenticated:
|
if current_user.is_authenticated:
|
||||||
redirect_url = url_for("dashboard.index")
|
redirect_url = url_for("dashboard.setting", _anchor="connect-with-proton")
|
||||||
else:
|
else:
|
||||||
redirect_url = url_for("auth.login")
|
redirect_url = url_for("auth.login")
|
||||||
|
|
||||||
response = make_response(redirect(redirect_url))
|
response = make_response(redirect(redirect_url))
|
||||||
if CONNECT_WITH_PROTON_COOKIE_NAME:
|
if CONNECT_WITH_PROTON_COOKIE_NAME:
|
||||||
|
flash("You can now connect your Proton and your SimpleLogin account", "success")
|
||||||
response.set_cookie(
|
response.set_cookie(
|
||||||
CONNECT_WITH_PROTON_COOKIE_NAME,
|
CONNECT_WITH_PROTON_COOKIE_NAME,
|
||||||
value="true",
|
value="true",
|
||||||
|
@ -10,6 +10,10 @@
|
|||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
margin-bottom: 3px;
|
margin-bottom: 3px;
|
||||||
}
|
}
|
||||||
|
.highlighted{
|
||||||
|
border: solid 2px #5675E2;
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block default_content %}
|
{% block default_content %}
|
||||||
@ -219,7 +223,7 @@
|
|||||||
<!-- Connect with Proton -->
|
<!-- Connect with Proton -->
|
||||||
{% if connect_with_proton %}
|
{% if connect_with_proton %}
|
||||||
|
|
||||||
<div class="card">
|
<div class="card" id="connect-with-proton">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="card-title">Connect with Proton</div>
|
<div class="card-title">Connect with Proton</div>
|
||||||
{% if proton_linked_account != None %}
|
{% if proton_linked_account != None %}
|
||||||
@ -719,3 +723,11 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
{% block script %}
|
||||||
|
<script>
|
||||||
|
let anchor = window.location.hash;
|
||||||
|
$(anchor).addClass("highlighted")
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
{% endblock %}
|
||||||
|
Loading…
Reference in New Issue
Block a user