mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-09 19:40:19 +00:00
Migrate and improve subscriptions
This commit is contained in:
@ -71,7 +71,7 @@
|
||||
<td>
|
||||
<ul>
|
||||
{% for it in i.items.all() %}
|
||||
<li>{{ it.product_name }} - {{ it.product_unit_price }} €</li>
|
||||
<li>{{ it.quantity }} x {{ it.product_name }} - {{ it.product_unit_price }} €</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</td>
|
||||
|
@ -28,7 +28,7 @@
|
||||
{% endif %}
|
||||
{% if form.instance == user %}
|
||||
<p><a href="{{ url('core:password_change') }}">{% trans %}Change my password{% endtrans %}</a></p>
|
||||
{% elif user.is_root() %}
|
||||
{% elif user.is_root %}
|
||||
<p><a href="{{ url('core:password_root_change', user_id=form.instance.id) }}">{% trans %}Change user password{% endtrans %}</a></p>
|
||||
{% endif %}
|
||||
</form>
|
||||
|
19
core/templates/core/user_mini.jinja
Normal file
19
core/templates/core/user_mini.jinja
Normal file
@ -0,0 +1,19 @@
|
||||
<div id="user_profile">
|
||||
<div id="pictures">
|
||||
{% if profile.profile_pict %}
|
||||
<img src="{{ profile.profile_pict.get_download_url() }}" alt="{% trans %}Profile{% endtrans %}" />
|
||||
{% endif %}
|
||||
</div>
|
||||
<p>{{ profile.get_full_name() }}</p>
|
||||
{% if profile.nick_name %}
|
||||
<p id="nickname">« {{ profile.nick_name }} »</p>
|
||||
{% endif %}
|
||||
{% if profile.date_of_birth %}
|
||||
<p>{% trans %}Born: {% endtrans %}{{ profile.date_of_birth|date("d/m/Y") }}</p>
|
||||
{% endif %}
|
||||
{% if profile.promo %}
|
||||
<p><img src="{{ static('core/img/promo_%02d.png' % profile.promo) }}" alt="Promo {{ profile.promo }}" class="promo_pict" />
|
||||
{% trans %}Promo: {% endtrans %}{{ profile.promo }}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
@ -25,6 +25,7 @@ urlpatterns = [
|
||||
|
||||
# User views
|
||||
url(r'^user/$', UserListView.as_view(), name='user_list'),
|
||||
url(r'^user/(?P<user_id>[0-9]+)/mini$', UserMiniView.as_view(), name='user_profile_mini'),
|
||||
url(r'^user/(?P<user_id>[0-9]+)/$', UserView.as_view(), name='user_profile'),
|
||||
url(r'^user/(?P<user_id>[0-9]+)/edit$', UserUpdateProfileView.as_view(), name='user_edit'),
|
||||
url(r'^user/(?P<user_id>[0-9]+)/groups$', UserUpdateGroupView.as_view(), name='user_groups'),
|
||||
|
@ -50,7 +50,6 @@ class SelectFile(TextInput):
|
||||
'name': name,
|
||||
}
|
||||
output += '<span name="' + name + '" class="choose_file_button">' + _("Choose file") + '</span>'
|
||||
print(output)
|
||||
return output
|
||||
|
||||
# Forms
|
||||
|
@ -121,6 +121,15 @@ class UserView(CanViewMixin, DetailView):
|
||||
context_object_name = "profile"
|
||||
template_name = "core/user_detail.jinja"
|
||||
|
||||
class UserMiniView(CanViewMixin, DetailView):
|
||||
"""
|
||||
Display a user's profile
|
||||
"""
|
||||
model = User
|
||||
pk_url_kwarg = "user_id"
|
||||
context_object_name = "profile"
|
||||
template_name = "core/user_mini.jinja"
|
||||
|
||||
class UserListView(ListView):
|
||||
"""
|
||||
Displays the user list
|
||||
|
Reference in New Issue
Block a user