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:
Son Nguyen Kim 2022-07-04 15:39:12 +02:00 committed by GitHub
parent 2f9301eb97
commit 6d86e64d65
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 3 deletions

View File

@ -1,6 +1,6 @@
import arrow
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 .base import internal_bp
@ -8,12 +8,13 @@ from .base import internal_bp
@internal_bp.route("/integrations/proton")
def set_enable_proton_cookie():
if current_user.is_authenticated:
redirect_url = url_for("dashboard.index")
redirect_url = url_for("dashboard.setting", _anchor="connect-with-proton")
else:
redirect_url = url_for("auth.login")
response = make_response(redirect(redirect_url))
if CONNECT_WITH_PROTON_COOKIE_NAME:
flash("You can now connect your Proton and your SimpleLogin account", "success")
response.set_cookie(
CONNECT_WITH_PROTON_COOKIE_NAME,
value="true",

View File

@ -10,6 +10,10 @@
font-weight: 600;
margin-bottom: 3px;
}
.highlighted{
border: solid 2px #5675E2;
}
</style>
{% endblock %}
{% block default_content %}
@ -219,7 +223,7 @@
<!-- Connect with Proton -->
{% if connect_with_proton %}
<div class="card">
<div class="card" id="connect-with-proton">
<div class="card-body">
<div class="card-title">Connect with Proton</div>
{% if proton_linked_account != None %}
@ -719,3 +723,11 @@
</div>
</div>
{% endblock %}
{% block script %}
<script>
let anchor = window.location.hash;
$(anchor).addClass("highlighted")
</script>
{% endblock %}