Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
nopaque
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SFB 1288 - INF
nopaque
Commits
37765c75
Commit
37765c75
authored
5 years ago
by
Patrick Jentsch
Browse files
Options
Downloads
Patches
Plain Diff
Rename profile to account and enable password change.
parent
de2aacc2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/auth/views.py
+8
-6
8 additions, 6 deletions
app/auth/views.py
app/templates/auth/account.html.j2
+2
-1
2 additions, 1 deletion
app/templates/auth/account.html.j2
app/templates/base.html.j2
+1
-1
1 addition, 1 deletion
app/templates/base.html.j2
with
11 additions
and
8 deletions
app/auth/views.py
+
8
−
6
View file @
37765c75
...
...
@@ -125,9 +125,9 @@ def password_reset(token):
title
=
'
Password Reset
'
)
@auth.route
(
'
/
profile
'
,
methods
=
[
'
GET
'
,
'
POST
'
])
@auth.route
(
'
/
account
'
,
methods
=
[
'
GET
'
,
'
POST
'
])
@login_required
def
profile
():
def
account
():
form
=
ChangeProfileForm
()
if
form
.
validate_on_submit
():
flash
(
'
It is just a test, nothing changed.
'
)
...
...
@@ -138,8 +138,10 @@ def profile():
current_user
.
email
=
form
.
email
.
data
current_user
.
confirmed
=
False
db
.
session
.
add
(
current_user
)
resend_confirmation
()
if
form
.
password
.
data
:
current_user
.
password
=
form
.
password
.
data
db
.
session
.
commit
()
resend_confirmation
()
return
redirect
(
url_for
(
'
auth.profile
'
))
return
render_template
(
'
auth/profile.html.j2
'
,
form
=
form
,
title
=
'
Profile
'
)
return
redirect
(
url_for
(
'
auth.account
'
))
return
render_template
(
'
auth/account.html.j2
'
,
form
=
form
,
title
=
'
Account
'
)
This diff is collapsed.
Click to expand it.
app/templates/auth/
profile
.html.j2
→
app/templates/auth/
account
.html.j2
+
2
−
1
View file @
37765c75
...
...
@@ -4,13 +4,14 @@
<div class="col s12">
<div class="card large">
<div class="card-content">
<span class="card-title">Change
profile
</span>
<span class="card-title">Change
account information
</span>
<form method="POST">
{{ form.hidden_tag() }}
<div class="input-field ">
<i class="material-icons prefix">email</i>
{{ form.email(type='email', placeholder=current_user.email) }}
{{ form.email.label }}
<span class="helper-text" data-error="wrong" data-success="right">When changing your e-mail adress you will have to reconfirm it.</span>
{% for error in form.email.errors %}
<span class="helper-text" style="color:red;">{{ error }}</span>
{% endfor %}
...
...
This diff is collapsed.
Click to expand it.
app/templates/base.html.j2
+
1
−
1
View file @
37765c75
...
...
@@ -20,7 +20,7 @@
</div>
<ul
id=
"nav-account-dropdown"
class=
"dropdown-content"
>
{% if current_user.is_authenticated %}
<li><a
href=
"{{ url_for('auth.
profile
') }}"
><i
class=
"material-icons"
>
person
</i>
Profile
</a></li>
<li><a
href=
"{{ url_for('auth.
account
') }}"
><i
class=
"material-icons"
>
person
</i>
Account
</a></li>
<li
class=
"divider"
></li>
<li><a
href=
"{{ url_for('auth.logout') }}"
><i
class=
"material-icons"
>
chevron_left
</i>
Log out
</a></li>
{% else %}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment