feat(login): show profile (#485)

* profile data

* fix scripts

* fix image paths

* feat: show profile (with image) when possible

* fix profile image width
This commit is contained in:
Livio Amstutz
2020-07-20 10:00:29 +02:00
committed by GitHub
parent 4f3ccbfad0
commit 933193855a
42 changed files with 321 additions and 212 deletions

View File

@@ -1,6 +1,7 @@
{{template "main-top" .}}
<h1>{{t "PasswordChange.Title"}}</h1>
{{ template "user-profile" . }}
<p>{{t "PasswordChange.Description"}}</p>
<form action="{{ changePasswordUrl }}" method="POST">

View File

@@ -1,7 +1,7 @@
{{template "main-top" .}}
{{ template "user-profile" . }}
<h1>{{t "PasswordChangeDone.Title"}}</h1>
<p>{{t "PasswordChangeDone.Description"}}</p>
<form action="{{ loginUrl }}" method="POST">

View File

@@ -1,7 +1,7 @@
{{template "main-top" .}}
{{ template "user-profile" . }}
<h1>{{t "InitPassword.Title" }}</h1>
<p>{{t "InitPassword.Description" }}</p>
<form action="{{ initPasswordUrl }}" method="POST">

View File

@@ -1,8 +1,9 @@
{{template "main-top" .}}
{{ template "user-profile" . }}
<h1>{{t "PasswordSetDone.Title"}}</h1>
<p>{{t "PasswordSetDone.Description"}}</p>
<form action="{{ loginUrl }}" method="POST">
{{ .CSRF }}

View File

@@ -1,7 +1,7 @@
{{template "main-top" .}}
{{ template "user-profile" . }}
<h1>{{t "InitUser.Title" }}</h1>
<p>{{t "InitUser.Description" }}</p>
<form action="{{ initUserUrl }}" method="POST">

View File

@@ -1,8 +1,9 @@
{{template "main-top" .}}
{{ template "user-profile" . }}
<h1>{{t "InitUserDone.Title"}}</h1>
<p>{{t "InitUserDone.Description"}}</p>
<form action="{{ loginUrl }}" method="POST">
{{ .CSRF }}

View File

@@ -1,7 +1,7 @@
{{template "main-top" .}}
{{ template "user-profile" . }}
<h1>{{t "EmailVerification.Title"}}</h1>
<p>{{t "EmailVerification.Description"}}</p>
<form action="{{ mailVerificationUrl }}" method="POST">

View File

@@ -1,7 +1,7 @@
{{template "main-top" .}}
{{ template "user-profile" . }}
<h1>{{t "EmailVerificationDone.Title"}}</h1>
<p>{{t "EmailVerificationDone.Description"}}</p>
<form action="{{ loginUrl }}" method="POST">

View File

@@ -1,7 +1,7 @@
{{template "main-top" .}}
{{ template "user-profile" . }}
<h1>{{t "MfaInitDone.Title"}}</h1>
<p>{{t "MfaInitDone.Description"}}</p>
<form action="{{ loginUrl }}" method="POST">

View File

@@ -1,7 +1,7 @@
{{template "main-top" .}}
{{ template "user-profile" . }}
<h1>{{t "MfaInitVerify.Title"}}</h1>
<p>{{t "MfaInitVerify.Description"}}</p>
<form action="{{ mfaInitVerifyUrl }}" method="POST">

View File

@@ -1,7 +1,8 @@
{{template "main-top" .}}
{{ template "user-profile" . }}
<h1>{{t "MfaPrompt.Title"}}</h1>
<p>{{t "MfaPrompt.Description"}}</p>
<form action="{{ mfaPromptUrl }}" method="POST">

View File

@@ -1,7 +1,7 @@
{{template "main-top" .}}
{{ template "user-profile" . }}
<h1>{{t "MfaVerify.Title"}}</h1>
<p>{{t "MfaVerify.Description"}}</p>
<form action="{{ mfaVerifyUrl }}" method="POST">

View File

@@ -1,7 +1,8 @@
{{template "main-top" .}}
{{ template "user-profile" . }}
<h1>{{t "Password.Title"}}</h1>
<p>{{t "Password.Description"}}</p>
<form action="{{ passwordUrl }}" method="POST">

View File

@@ -1,8 +1,9 @@
{{template "main-top" .}}
{{ template "user-profile" . }}
<h1>{{t "PasswordResetDone.Title"}}</h1>
<p>{{t "PasswordResetDone.Description"}}</p>
<form action="{{ loginUrl }}" method="POST">
{{ .CSRF }}

View File

@@ -0,0 +1,13 @@
{{define "user-profile"}}
{{if .LoginName}}
<div class="login-profile">
<div class="profile-image"></div>
<div class="names">
{{if .DisplayName}}
<div class="displayname">{{.DisplayName}}</div>
{{end}}
<div class="loginname">{{.LoginName}}</div>
</div>
</div>
{{end}}
{{end}}