Skip to content

Commit

Permalink
BLUEBUTTON-1526 Format User Account Settings Page (#786)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
johnfrenchxyz authored Feb 10, 2020
1 parent a90033b commit fc761d7
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 77 deletions.
2 changes: 0 additions & 2 deletions apps/accounts/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,6 @@ def __init__(self, *args, **kwargs):
organization_name = forms.CharField(max_length=100,
label=_('Organization Name'),
required=True)
create_applications = forms.BooleanField(initial=False,
required=False)
required_css_class = 'required'


Expand Down
71 changes: 43 additions & 28 deletions apps/accounts/templates/account-settings.html
Original file line number Diff line number Diff line change
@@ -1,43 +1,58 @@
{% extends "base.html" %}
{% extends "oauth2_provider/base.html" %}
{% load i18n %}
{% block Content %}

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

<h1>{{name}} <small>{{subname}}</small></h1>
{% block bannerTitle %}
{{name}}
{% endblock %}

<div class="ds-u-margin-y--2">
<!-- Password Update Button -->
<a class="ds-c-button ds-c-button--default" href="{% url 'password_change' %}">
Change Your Password
</a>
</div>
{% block bannerDescription %}{% endblock %}

{% block bannerCallToActionButtons %}{% endblock %}

{% block Content %}

{% if additional_info %}
<div class="alert alert-info">
<div class="container">
<div class="ds-l-row ds-u-justify-content--center ds-u-margin-y--4">
<div class="ds-l-lg-col--11 ds-l-md-col--11 ds-l-sm-col--12">
<div class="bb-c-card bb-width--75 ds-u-padding--2 bb-raised-section">
<div class="ds-u-margin-y--2">

<!-- Password Section -->
<h2>Password Management</h2>
<a class="ds-c-button ds-c-button--default ds-u-margin-bottom--4" href="{% url 'password_change' %}">
Change Your Password
</a>

<h2>Additional Information</h2>

<!-- Additional Information Section -->
{% if additional_info %}
<h2>Additional Information</h2>
<div class="alert alert-info">
<button type="button" class="close" data-dismiss="alert">×</button>
<h4 class="ds-h4">{%trans "Important" %}</h4>
{{ additional_info |safe }}
</div>

{% endif %}

{% include "include/messages.html" %}
</div>
{% endif %}

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

{% load bootstrap %}
{{ form|bootstrap }}
<form class="well ds-u-margin-y--2" method="post" action="" enctype="multipart/form-data">
{% csrf_token %}

{% load bootstrap %}
{{ form|bootstrap }}

<input type="submit" class="ds-c-button ds-c-button--primary ds-u-margin-y--2" value="{% trans 'Update Information' %}" /><br>
</form>

<input type="submit" class="ds-c-button ds-c-button--primary ds-u-margin-y--2" value="{% trans 'Continue' %}" /><br>
<a href="javascript:history.go(-1)">{% trans "Go Back" %}</a>

</form>
</div>
</div>
</div>
</div>
</div>

{% endblock %}
93 changes: 49 additions & 44 deletions apps/accounts/templates/registration/passwd_change_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,74 +4,79 @@
<!-- Ignore Banner Code -->
{% block banner %}{% endblock %}

{% block messages %}

<div class="row">
<div class="col-lg-8">
{% include "include/messages.html" %}
</div>
</div>

{% endblock %}


{% block Content %}
<div class="sandbox-gradient-bg">
<div class="gradient-content-container">
<h1>Enter New Password</h1>
<p>Reset your password below. Please enter your new password twice so we can verify you typed it in correctly.</p>

{% if form.errors %}
<div class="gradient-messages-container">
{% if form.errors %}
<span>
{% if form.errors.items|length == 1 %}Please correct the error below.{% else %}Please correct the errors below.{% endif %}
</span>
{% endif %}
<span>
{% if form.errors.items|length == 1 %}Please correct the error below.{% else %}Please correct the errors below.{% endif %}
</span>

{% block messages %}
{% include "include/messages.html" %}
{% endblock %}

</div>
{% endif %}

<!-- Content Card -->
<div class="gradient-content-card">
<div class="content">
<!-- Password Set Form -->
<form class="well ds-u-margin-y--3" method="post" action="">{% csrf_token %}
<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>
<form class="" method="post" action="">{% csrf_token %}
<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>

<div class="form-row">
{{ form.old_password.errors }}
{{ form.old_password.label_tag }} {{ form.old_password }}
<!-- Current Password Errors -->
{% if form.old_password.errors %}
<div class="ds-c-alert ds-c-alert--error ds-u-margin-bottom--2 ds-c-alert--hide-icon">
{{ form.old_password.errors }}
</div>
{% endif %}

<div class="form-row">
{{ form.new_password1.errors }}
<p class="ds-u-margin-y--1"> </p>
{{ form.new_password1.label_tag }} {{ form.new_password1 }}
{% if form.new_password1.help_text %}
<p class="ds-u-margin-y--1"> </p>
<div class="help">{{ form.new_password1.help_text|safe }}</div>
{% endif %}
</div>
<!-- Current Password Input -->
{{ form.old_password.label_tag }}
{{ form.old_password }}

<!-- Password Requirements -->
<h2>Password Requirements</h2>
<div class="ds-u-margin-bottom--2">
{{ form.new_password1.help_text|safe }}
</div>

<div class="form-row">
<!-- New Password Field 1 Errors -->
{% if form.new_password1.errors %}
<p class="ds-u-margin-y--1">{{ form.new_password1.errors }}</p>
{% endif %}

<!-- New Password Field 1 Input -->
{{ form.new_password1.label_tag }}
{{ form.new_password1 }}

<!-- New Password Field 2 Errors (Confirm Password Errors) -->
{% if form.new_password2.errors %}
<div class="ds-c-alert ds-c-alert--error ds-u-margin-bottom--2 ds-c-alert--hide-icon">
{{ form.new_password2.errors }}
<p class="ds-u-margin-y--1"> </p>
{{ form.new_password2.label_tag }} {{ form.new_password2 }}
{% if form.new_password2.help_text %}
<div class="help">{{ form.new_password2.help_text|safe }}</div>
<p class="ds-u-margin-y--1"> </p>
{% endif %}
</div>
{% endif %}

<div class="submit-row">
<input type="submit" class="ds-c-button ds-c-button--primary" value="Change my password" class="default">
</div>
<!-- New Password Field 2 Input (Confirm Password Input) -->
{{ form.new_password2.label_tag }}
{{ form.new_password2 }}

<!-- New Password Field 2 Help Text (Confirm Password Help Text)-->
{% if form.new_password2.help_text %}
{{ form.new_password2.help_text|safe }}
{% endif %}

<input type="submit" class="ds-c-button ds-c-button--primary" value="Change my password" class="default">

</form>
</div>
</div>
</div>
</div>
{% endblock %}

{% block ExtraJSFoot %}
<script type="application/javascript">$("#id_email").focus();</script>
{% endblock %}
2 changes: 0 additions & 2 deletions apps/accounts/views/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ def account_settings(request):
request.user.save()
# update the user profile
up.organization_name = data['organization_name']
up.create_applications = data['create_applications']
up.authorize_applications = True
up.save()
messages.success(request,
'Your account settings have been updated.')
Expand Down
2 changes: 1 addition & 1 deletion templates/include/top-nav-responsive.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<a href="{% url 'test_links' %}">Test Client</a>
{% endif %}
{% if user.is_authenticated %}
<a class="button profile-button" href="{% url 'account_settings' %}"><i data-feather="user"></i>Profile</a>
<a class="button profile-button" href="{% url 'account_settings' %}"><i data-feather="user"></i>Account</a>
<a class="button logout-button" href="{% url 'logout' %}"><i data-feather="power"></i>Logout</a>
{% else %}
{% if 'apps.testclient' in settings.INSTALLED_APPS %}
Expand Down

0 comments on commit fc761d7

Please sign in to comment.