Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Improve styling and wording of SSO redirect confirm template #9272

Merged
merged 5 commits into from
Feb 1, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions synapse/res/templates/sso.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
body {
font-family: "Inter", "Helvetica", "Arial", sans-serif;
font-size: 14px;
color: #17191C;
}

header {
max-width: 480px;
width: 100%;
margin: 24px auto;
text-align: center;
}

header p {
color: #737D8C;
line-height: 24px;
}

h1 {
font-size: 24px;
}

h2 {
font-size: 14px;
}

h2 img {
vertical-align: middle;
margin-right: 8px;
width: 24px;
height: 24px;
}

label {
cursor: pointer;
}

main {
max-width: 360px;
width: 100%;
margin: 24px auto;
}

.primary-button {
border: none;
text-decoration: none;
padding: 12px;
color: white;
background-color: #418DED;
font-weight: bold;
display: block;
border-radius: 12px;
width: 100%;
margin: 16px 0;
cursor: pointer;
text-align: center;
}

.profile {
display: flex;
justify-content: center;
margin: 24px 0;
}

.profile .avatar {
width: 36px;
height: 36px;
border-radius: 100%;
display: block;
margin-right: 8px;
}

.profile .display-name {
font-weight: bold;
margin-bottom: 4px;
}
.profile .user-id {
color: #737D8C;
}

.profile .display-name, .profile .user-id {
line-height: 18px;
}
34 changes: 28 additions & 6 deletions synapse/res/templates/sso_redirect_confirm.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,34 @@
<head>
<meta charset="UTF-8">
<title>SSO redirect confirmation</title>
<meta name="viewport" content="width=device-width, user-scalable=no">
<style type="text/css">
{% include "sso.css" without context %}
</style>
</head>
<body>
<p>The application at <span style="font-weight:bold">{{ display_url | e }}</span> is requesting full access to your <span style="font-weight:bold">{{ server_name }}</span> Matrix account.</p>
<p>If you don't recognise this address, you should ignore this and close this tab.</p>
<p>
<a href="{{ redirect_url | e }}">I trust this address</a>
</p>
<header>
<!-- {% if new_user %} -->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why putting this in HTML comment tags?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to make it it easier to develop outside the template engine, I believe.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've never seen this pattern before. What makes it easier to develop without these? We don't seem to do this in any other templates. Personally I find it makes my eyes ignore the Jinja logic.

<h1>Your account is now ready</h1>
<p>You've made your account on {{ server_name | e }}.</p>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With autoescape on I don't think we should be manually escaping these as it is confusing (although it shouldn't cause an error). (Or is #9200 not on the social login branch?)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Or is #9200 not on the social login branch?)

yup, that, I'm afraid.

<!-- {% else %} -->
<h1>Log in</h1>
<!-- {% endif %} -->
<p>Continue to confirm you trust <strong>{{ display_url | e }}</strong>.</p>
</header>
<main>
<!-- {% if user_profile.avatar_url and user_profile.display_name %} -->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this code account for having only a display name and not an avatar?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the design is not to show this section at all if we don't have an avatar (which we never will, currently).

That said, it ought to account for having an avatar and not a display name...

<div class="profile">
<img src="{{ user_profile.avatar_url | mxc_to_http(64, 64) }}" class="avatar" />
<div class="profile-details">
<!-- {% if user_profile.display_name %} -->
<div class="display-name">{{ user_profile.display_name | e }}</div>
<!-- {% endif %} -->
<div class="user-id">{{ user_id | e }}</div>
</div>
</div>
<!-- {% endif %} -->
<a href="{{ redirect_url | e }}" class="primary-button"/>Continue</a>
</main>
</body>
</html>
</html>