Skip to content
Snippets Groups Projects
Commit d2a75c72 authored by Chris Lawton's avatar Chris Lawton
Browse files

change profile page to a three column layout

parent 921ec1e7
No related branches found
No related tags found
No related merge requests found
...@@ -10,55 +10,55 @@ ...@@ -10,55 +10,55 @@
</div> </div>
</div> </div>
<section class="section section--profile"> <div class="profile">
<h3>Profile</h3> <div class="profile__column">
<form action="" method="post" class="form"> <h3>Profile</h3>
{% csrf_token %} <form action="" method="post" class="form">
<div class="form__columns"> {% csrf_token %}
{% for field in form %} {% for field in form %}
{% include "funds/includes/field.html" %} {% include "funds/includes/field.html" %}
{% endfor %} {% endfor %}
</div> <button class="button button--primary" type="submit">{% trans "Update Profile" %}</button>
<button class="button button--primary" type="submit">{% trans "Update Profile" %}</button>
</form>
</section>
{% if show_change_password and user.has_usable_password and not backends.associated %}
<section class="section section--profile">
<h3>Change password</h3>
<a class="button button--primary" href="{% url 'users:password_change' %}">{% trans "Update password" %}</a>
</section>
{% endif %}
<section class="section section--profile">
{% if swappable %}
<form action="{% url 'users:become' %}" method="post" class="form">
{% csrf_token %}
{% for user in swappable %}
{% if forloop.first %}
<h3>Become:</h3>
<p class="form__help">Only includes active, non-superusers</p>
<div class="form__item">
<div class="form__select">
<select name="user" id="user">
{% endif %}
<option value="{{ user.id }}">{{ user }}</option>
{% if forloop.last %}
</select>
</div>
</div>
{% endif %}
{% endfor %}
<button class="button button--primary button--top-space" type="submit">Become</button>
</form> </form>
{% endif %} </div>
{# Remove the comment block tags below when such need arises. e.g. adding new providers #} {% if show_change_password and user.has_usable_password and not backends.associated %}
{% comment %} <div class="profile__column">
{% can_use_oauth as show_oauth_link %} <h3>Change password</h3>
{% if show_oauth_link %} <a class="button button--primary" href="{% url 'users:password_change' %}">{% trans "Update password" %}</a>
<a href="{% url 'users:oauth' %}">{% trans "Manage OAuth" %}</a> </div>
{% endif %} {% endif %}
{% endcomment %}
</section> <div class="profile__column">
{% if swappable %}
<form action="{% url 'users:become' %}" method="post" class="form">
{% csrf_token %}
{% for user in swappable %}
{% if forloop.first %}
<h3>Become:</h3>
<p class="form__help">Only includes active, non-superusers</p>
<div class="form__item">
<div class="form__select">
<select name="user" id="user">
{% endif %}
<option value="{{ user.id }}">{{ user }}</option>
{% if forloop.last %}
</select>
</div>
</div>
{% endif %}
{% endfor %}
<button class="button button--primary button--top-space" type="submit">Become</button>
</form>
{% endif %}
{# Remove the comment block tags below when such need arises. e.g. adding new providers #}
{% comment %}
{% can_use_oauth as show_oauth_link %}
{% if show_oauth_link %}
<a href="{% url 'users:oauth' %}">{% trans "Manage OAuth" %}</a>
{% endif %}
{% endcomment %}
</div>
</div>
{% endblock %} {% endblock %}
...@@ -33,6 +33,11 @@ ...@@ -33,6 +33,11 @@
@include media-query(tablet-portrait) { @include media-query(tablet-portrait) {
margin: 2rem 0; margin: 2rem 0;
// reduce spacing on the profile page
.profile & {
margin: 1rem 0;
}
} }
&:nth-of-type(1) { &:nth-of-type(1) {
...@@ -165,6 +170,10 @@ ...@@ -165,6 +170,10 @@
&__help { &__help {
@extend %h6; @extend %h6;
.profile & {
margin-top: 0;
}
} }
&__item { &__item {
...@@ -392,24 +401,5 @@ ...@@ -392,24 +401,5 @@
max-width: 70%; max-width: 70%;
} }
} }
&__columns {
display: flex;
flex-wrap: wrap;
#{$root}__group {
width: 100%;
margin: 0;
@include media-query(mob-landscape) {
width: 50%;
padding-right: 20px;
&:nth-child(even) {
padding-right: 0;
}
}
}
}
} }
.profile {
margin-top: $mobile-gutter;
@include media-query(tablet-portrait) {
display: flex;
margin-top: 2rem;
}
&__column {
padding-bottom: 2rem;
margin-bottom: 2rem;
border-bottom: 1px solid $color--light-mid-grey;
@include media-query(tablet-portrait) {
width: 50%;
padding-right: 3rem;
margin: 0 3rem 0 0;
border-right: 1px solid $color--light-mid-grey;
border-bottom: 0;
&:last-child {
padding-right: 0;
margin-right: 0;
border-right: 0;
}
}
}
}
...@@ -8,29 +8,4 @@ ...@@ -8,29 +8,4 @@
margin-bottom: 0; margin-bottom: 0;
} }
} }
&--profile {
max-width: $site-width;
padding-bottom: $mobile-gutter;
margin: 0 auto;
margin-bottom: $mobile-gutter;
border-bottom: 1px solid $color--light-mid-grey;
@include media-query(tablet-portrait) {
padding-bottom: 2rem;
margin-bottom: 1.5rem;
}
&:first-of-type {
padding-top: $mobile-gutter;
@include media-query(tablet-portrait) {
padding-top: 2rem;
}
}
&:last-of-type {
border-bottom: 0;
}
}
} }
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
@import 'components/input'; @import 'components/input';
@import 'components/nav'; @import 'components/nav';
@import 'components/pagination'; @import 'components/pagination';
@import 'components/profile';
@import 'components/reviews-list'; @import 'components/reviews-list';
@import 'components/reviews-summary'; @import 'components/reviews-summary';
@import 'components/reviews-sidebar'; @import 'components/reviews-sidebar';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment