Add basic account view for user and refactor user tool bar

This commit is contained in:
Skia
2016-07-17 12:38:02 +02:00
parent c099cc489b
commit e92a73dfb1
11 changed files with 165 additions and 16 deletions

View File

@ -0,0 +1,29 @@
{% extends "core/base.jinja" %}
{% block content %}
<div>{{ profile.get_display_name() }}</div>
<div class="tool-bar">
<a href="{{ url('core:user_profile', user_id=profile.id) }}">Infos</a>
{% if can_edit(profile, request.user) or user.id == profile.id %}
<a href="{{ url('core:user_edit', user_id=profile.id) }}">Edit</a>
{% endif %}
{% if can_edit_prop(profile, request.user) %}
<a href="{{ url('core:user_prop', user_id=profile.id) }}">Props</a>
{% endif %}
{% if (profile == request.user
or request.user.is_in_group(settings.SITH_GROUPS['accounting-admin']['name'])
or request.user.is_in_group(settings.SITH_GROUPS['root']['name'])) %}
<a href="{{ url('core:user_account', user_id=profile.id) }}">Account</a>
{% endif %}
<hr>
</div>
<div>
{% block infos %}
{% endblock %}
</div>
{% endblock %}

View File

@ -1,22 +1,12 @@
{% extends "core/base.jinja" %}
{% extends "core/user_base.jinja" %}
{% block title %}
{{ profile.get_display_name() }}'s profile
{% endblock %}
{% block content %}
<div class="edit-bar">
{% if can_edit(profile, request.user) or user.id == profile.id %}
<a href="{{ url('core:user_edit', user_id=profile.id) }}">Edit</a>
{% endif %}
{% if can_edit_prop(profile, request.user) %}
<a href="{{ url('core:user_prop', user_id=profile.id) }}">Props</a>
{% endif %}
</div>
{% block infos %}
<h3>User Profile</h3>
<hr>
<div class="user_profile">
<h4>{{ profile.get_full_name() }}</h4>
<p>{{ profile.nick_name }}</p>
@ -24,6 +14,7 @@
</div>
{% if user.membership.filter(end_date=None).exists() %}
{# if the user is member of a club, he can view the subscription state #}
<p>
{% if get_subscriber(profile).is_subscribed() %}
User is subscriber until {{ get_subscriber(profile).subscriptions.last().subscription_end }}