Skip to content

Commit fc761d7

Browse files
BLUEBUTTON-1526 Format User Account Settings Page (#786)
* Updates account page to correct template for UI consistency * Updates nav test to accurately describe page * Fixes Reset Password page - updates template for consistency/clean-up * Adds title to 'additional information' section * Removes create_applications since it is unused * Removes additional reference to create_applications
1 parent a90033b commit fc761d7

File tree

5 files changed

+93
-77
lines changed

5 files changed

+93
-77
lines changed

apps/accounts/forms.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,6 @@ def __init__(self, *args, **kwargs):
8989
organization_name = forms.CharField(max_length=100,
9090
label=_('Organization Name'),
9191
required=True)
92-
create_applications = forms.BooleanField(initial=False,
93-
required=False)
9492
required_css_class = 'required'
9593

9694

Lines changed: 43 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,58 @@
1-
{% extends "base.html" %}
1+
{% extends "oauth2_provider/base.html" %}
22
{% load i18n %}
3-
{% block Content %}
43

5-
<div class="container">
6-
<div class="ds-l-row ds-u-justify-content--center ds-u-margin-y--4">
7-
<div class="ds-l-col--11">
4+
{% block bannerBackButton %}
5+
<a class="banner-back-button" href="/"><i data-feather="arrow-left"></i>Back to Dashboard</a>
6+
{% endblock %}
87

9-
<h1>{{name}} <small>{{subname}}</small></h1>
8+
{% block bannerTitle %}
9+
{{name}}
10+
{% endblock %}
1011

11-
<div class="ds-u-margin-y--2">
12-
<!-- Password Update Button -->
13-
<a class="ds-c-button ds-c-button--default" href="{% url 'password_change' %}">
14-
Change Your Password
15-
</a>
16-
</div>
12+
{% block bannerDescription %}{% endblock %}
13+
14+
{% block bannerCallToActionButtons %}{% endblock %}
15+
16+
{% block Content %}
1717

18-
{% if additional_info %}
19-
<div class="alert alert-info">
18+
<div class="container">
19+
<div class="ds-l-row ds-u-justify-content--center ds-u-margin-y--4">
20+
<div class="ds-l-lg-col--11 ds-l-md-col--11 ds-l-sm-col--12">
21+
<div class="bb-c-card bb-width--75 ds-u-padding--2 bb-raised-section">
22+
<div class="ds-u-margin-y--2">
23+
24+
<!-- Password Section -->
25+
<h2>Password Management</h2>
26+
<a class="ds-c-button ds-c-button--default ds-u-margin-bottom--4" href="{% url 'password_change' %}">
27+
Change Your Password
28+
</a>
29+
30+
<h2>Additional Information</h2>
31+
32+
<!-- Additional Information Section -->
33+
{% if additional_info %}
34+
<h2>Additional Information</h2>
35+
<div class="alert alert-info">
2036
<button type="button" class="close" data-dismiss="alert">×</button>
2137
<h4 class="ds-h4">{%trans "Important" %}</h4>
2238
{{ additional_info |safe }}
23-
</div>
24-
25-
{% endif %}
26-
27-
{% include "include/messages.html" %}
39+
</div>
40+
{% endif %}
2841

29-
<form class="well ds-u-margin-y--2" method="post" action="" enctype="multipart/form-data">
30-
{% csrf_token %}
42+
{% include "include/messages.html" %}
3143

32-
{% load bootstrap %}
33-
{{ form|bootstrap }}
44+
<form class="well ds-u-margin-y--2" method="post" action="" enctype="multipart/form-data">
45+
{% csrf_token %}
46+
47+
{% load bootstrap %}
48+
{{ form|bootstrap }}
49+
50+
<input type="submit" class="ds-c-button ds-c-button--primary ds-u-margin-y--2" value="{% trans 'Update Information' %}" /><br>
51+
</form>
3452

35-
<input type="submit" class="ds-c-button ds-c-button--primary ds-u-margin-y--2" value="{% trans 'Continue' %}" /><br>
36-
<a href="javascript:history.go(-1)">{% trans "Go Back" %}</a>
37-
38-
</form>
53+
</div>
54+
</div>
3955
</div>
4056
</div>
4157
</div>
42-
4358
{% endblock %}

apps/accounts/templates/registration/passwd_change_form.html

Lines changed: 49 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -4,74 +4,79 @@
44
<!-- Ignore Banner Code -->
55
{% block banner %}{% endblock %}
66

7-
{% block messages %}
8-
9-
<div class="row">
10-
<div class="col-lg-8">
11-
{% include "include/messages.html" %}
12-
</div>
13-
</div>
14-
15-
{% endblock %}
16-
17-
187
{% block Content %}
198
<div class="sandbox-gradient-bg">
209
<div class="gradient-content-container">
2110
<h1>Enter New Password</h1>
2211
<p>Reset your password below. Please enter your new password twice so we can verify you typed it in correctly.</p>
2312

13+
{% if form.errors %}
2414
<div class="gradient-messages-container">
25-
{% if form.errors %}
26-
<span>
27-
{% if form.errors.items|length == 1 %}Please correct the error below.{% else %}Please correct the errors below.{% endif %}
28-
</span>
29-
{% endif %}
15+
<span>
16+
{% if form.errors.items|length == 1 %}Please correct the error below.{% else %}Please correct the errors below.{% endif %}
17+
</span>
18+
19+
{% block messages %}
20+
{% include "include/messages.html" %}
21+
{% endblock %}
22+
3023
</div>
24+
{% endif %}
3125

3226
<!-- Content Card -->
3327
<div class="gradient-content-card">
3428
<div class="content">
3529
<!-- Password Set Form -->
36-
<form class="well ds-u-margin-y--3" method="post" action="">{% csrf_token %}
37-
<p>Please enter your old password, for security's sake, and then enter your new password twice so we can verify you typed it in correctly.</p>
30+
<form class="" method="post" action="">{% csrf_token %}
31+
<p class="ds-u-color--base">Please enter your old password, for security's sake, and then enter your new password twice so we can verify you typed it in correctly.</p>
3832

39-
<div class="form-row">
40-
{{ form.old_password.errors }}
41-
{{ form.old_password.label_tag }} {{ form.old_password }}
33+
<!-- Current Password Errors -->
34+
{% if form.old_password.errors %}
35+
<div class="ds-c-alert ds-c-alert--error ds-u-margin-bottom--2 ds-c-alert--hide-icon">
36+
{{ form.old_password.errors }}
4237
</div>
38+
{% endif %}
4339

44-
<div class="form-row">
45-
{{ form.new_password1.errors }}
46-
<p class="ds-u-margin-y--1"> </p>
47-
{{ form.new_password1.label_tag }} {{ form.new_password1 }}
48-
{% if form.new_password1.help_text %}
49-
<p class="ds-u-margin-y--1"> </p>
50-
<div class="help">{{ form.new_password1.help_text|safe }}</div>
51-
{% endif %}
52-
</div>
40+
<!-- Current Password Input -->
41+
{{ form.old_password.label_tag }}
42+
{{ form.old_password }}
43+
44+
<!-- Password Requirements -->
45+
<h2>Password Requirements</h2>
46+
<div class="ds-u-margin-bottom--2">
47+
{{ form.new_password1.help_text|safe }}
48+
</div>
5349

54-
<div class="form-row">
50+
<!-- New Password Field 1 Errors -->
51+
{% if form.new_password1.errors %}
52+
<p class="ds-u-margin-y--1">{{ form.new_password1.errors }}</p>
53+
{% endif %}
54+
55+
<!-- New Password Field 1 Input -->
56+
{{ form.new_password1.label_tag }}
57+
{{ form.new_password1 }}
58+
59+
<!-- New Password Field 2 Errors (Confirm Password Errors) -->
60+
{% if form.new_password2.errors %}
61+
<div class="ds-c-alert ds-c-alert--error ds-u-margin-bottom--2 ds-c-alert--hide-icon">
5562
{{ form.new_password2.errors }}
56-
<p class="ds-u-margin-y--1"> </p>
57-
{{ form.new_password2.label_tag }} {{ form.new_password2 }}
58-
{% if form.new_password2.help_text %}
59-
<div class="help">{{ form.new_password2.help_text|safe }}</div>
60-
<p class="ds-u-margin-y--1"> </p>
61-
{% endif %}
6263
</div>
64+
{% endif %}
6365

64-
<div class="submit-row">
65-
<input type="submit" class="ds-c-button ds-c-button--primary" value="Change my password" class="default">
66-
</div>
66+
<!-- New Password Field 2 Input (Confirm Password Input) -->
67+
{{ form.new_password2.label_tag }}
68+
{{ form.new_password2 }}
69+
70+
<!-- New Password Field 2 Help Text (Confirm Password Help Text)-->
71+
{% if form.new_password2.help_text %}
72+
{{ form.new_password2.help_text|safe }}
73+
{% endif %}
74+
75+
<input type="submit" class="ds-c-button ds-c-button--primary" value="Change my password" class="default">
6776

6877
</form>
6978
</div>
7079
</div>
7180
</div>
7281
</div>
7382
{% endblock %}
74-
75-
{% block ExtraJSFoot %}
76-
<script type="application/javascript">$("#id_email").focus();</script>
77-
{% endblock %}

apps/accounts/views/core.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@ def account_settings(request):
6161
request.user.save()
6262
# update the user profile
6363
up.organization_name = data['organization_name']
64-
up.create_applications = data['create_applications']
65-
up.authorize_applications = True
6664
up.save()
6765
messages.success(request,
6866
'Your account settings have been updated.')

templates/include/top-nav-responsive.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<a href="{% url 'test_links' %}">Test Client</a>
2929
{% endif %}
3030
{% if user.is_authenticated %}
31-
<a class="button profile-button" href="{% url 'account_settings' %}"><i data-feather="user"></i>Profile</a>
31+
<a class="button profile-button" href="{% url 'account_settings' %}"><i data-feather="user"></i>Account</a>
3232
<a class="button logout-button" href="{% url 'logout' %}"><i data-feather="power"></i>Logout</a>
3333
{% else %}
3434
{% if 'apps.testclient' in settings.INSTALLED_APPS %}

0 commit comments

Comments
 (0)