Skip to content

Commit

Permalink
apps/userdashboard: add settings dropdown and profile and dashboard l…
Browse files Browse the repository at this point in the history
…inks
  • Loading branch information
philli-m committed Jan 13, 2021
1 parent 861517d commit 7bf6ed9
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 16 deletions.
2 changes: 1 addition & 1 deletion adhocracy-plus/assets/scss/components/_userdashboard.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
.userdashboard-profile__user {
border: 1px solid #dadada;
text-align: center;
padding: 2*$padding;
padding-bottom: 2*$padding;
}

.userdashboard-profile__avatar {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,34 +29,65 @@
aria-labelledby="userdashboard-{{ user.pk }}-tile"
aria-expanded="false">
<div class="userdashboard-profile__user">

<div class="dropdown text-right">
<button
title="{% trans 'Settings' %}"
type="button"
class="dropdown-toggle btn btn--none btn--small"
data-toggle="dropdown"
data-flip="false"
aria-haspopup="true"
aria-expanded="false"
id="account-settings"
>
<i class="fa fa-ellipsis-v" aria-label="{% trans 'Settings' %}"></i>
</button>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="account-settings">
<a class="dropdown-item" href="{% url 'account' %}">{% trans 'Account Settings' %}</a>
</div>
</div>

<a href="{% url 'profile' user.username %}">
{% if user.avatar %}
<img class="userdashboard-profile__avatar mb-2" src="{% thumbnail user.avatar '170x170' crop %}" alt="" />
{% else %}
<img class="userdashboard-profile__avatar mb-2" src="{{ user.avatar_fallback }}" width="170" height="170" alt="" />
{% endif %}

<h3 class="mt-0 u-word-break-all">
{{ user.username }}
</h3>
</a>

<h3 class="mt-0 u-word-break-all">
{{ user.username }}
</h3>
<div>
{% trans 'Since' %} {{ request.user.date_joined|date:"d M Y" }}
</div>
</div>
<div>
<h3>{% trans 'Organisations' %}</h3>
{% for organisation in view.organisations %}
<a class="btn btn--link text-decoration-none text-muted" href="{% url 'a4dashboard:project-list' organisation_slug=organisation.slug %}">
{% if organisation.logo %}
<img src="{% thumbnail organisation.logo '0x160' %}" height="80" alt="{{ orgnaisation.name }}" class="dashboard-nav__logo" />
{% else %}
<i class="fas fa-home pt-2" aria-label="{{ orgnaisation.name }} {% trans 'Home' %}"></i>
{% endif %}
&nbsp {{ organisation.name }}
</a>
{% endfor %}
{% if request.user.organisations %}
<div>
<h3>{% trans 'Initiator Organisations' %}</h3>
{% for organisation in request.user.organisations %}
<a class="btn btn--link text-decoration-none text-muted" href="{% url 'a4dashboard:project-list' organisation_slug=organisation.slug %}">
<i class="fas fa-edit pt-2" aria-label="{{ orgnaisation.name }} {% trans 'Home' %}"></i>
&nbsp{{ organisation.name }}
</a>
{% endfor %}
</div>
{% endif %}

<div>
<h3>{% trans 'Organisations' %}</h3>
{% for organisation in view.organisations %}
<a class="btn btn--link text-decoration-none text-muted" href="{% url 'organisation' organisation_slug=organisation.slug %}">
{% if organisation.logo %}
<img src="{% thumbnail organisation.logo '0x160' %}" height="80" alt="{{ orgnaisation.name }}" class="dashboard-nav__logo" />
{% else %}
<i class="fas fa-home pt-2" aria-label="{{ orgnaisation.name }} {% trans 'Home' %}"></i>
{% endif %}
&nbsp {{ organisation.name }}
</a>
{% endfor %}
</div>
</div>
</div>
Expand Down

0 comments on commit 7bf6ed9

Please sign in to comment.