Sith/trombi/templates/trombi/user_tools.jinja
Julien Constant b30ee0a27a
[FIX] Correction de bugs (#617)
* Fix #600

* Fix #602

* Fixes & améliorations du nouveau CSS (#616)

* Fix #604

* should fix #605

* Fix #608

* Update core/views/site.py

Co-Authored-By: thomas girod <56346771+imperosol@users.noreply.github.com>

* Added back the permission denied

* Should fix #609

* Fix failing test when 2 user are merged

* Should fix #610

* Should fix #627

* Should fix #109

Block les URLs suivantes lorsque le fichier se trouve dans le dir `profiles` ou `SAS` :
- `/file/<id>/`
- `/file/<id>/[delete|prop|edit]`

> Les urls du SAS restent accessiblent pour les roots & les admins SAS
> Les urls de profiles sont uniquement accessiblent aux roots

* Fix root dir of SAS being unnaccessible for sas admins

⚠️ need to edit the SAS directory & save it (no changes required in sas directory properties)

* Remove overwritten code

* Should fix duplicated albums in user profile (wtf)

* Fix typo

* Extended profiles picture access to board members

* Should fix #607

* Fix keyboard navigation not working properly

* Fix user tagged pictures section inside python rather than in the template

* Update utils.py

* Apply suggested changes

* Fix #604

* Fix #608

* Added back the permission denied

* Should fix duplicated albums in user profile (wtf)

* Fix user tagged pictures section inside python rather than in the template

* Apply suggested changes

---------

Co-authored-by: thomas girod <56346771+imperosol@users.noreply.github.com>
2023-05-02 13:07:36 +02:00

61 lines
2.3 KiB
Django/Jinja

{% extends "core/base.jinja" %}
{% block title %}
{% trans user_name=user.get_display_name() %}{{ user_name }}'s Trombi{% endtrans %}
{% endblock %}
{% block content %}
<h3>{% trans%}Trombi'{% endtrans %}</h3>
{% if subscribe_form %}
<form action="" method="post">
{% csrf_token %}
{{ subscribe_form.as_p() }}
<p><input type="submit" value="{% trans %}Save{% endtrans %}" /></p>
</form>
{% endif %}
{% if trombi %}
<p>{% trans trombi = user.trombi_user.trombi %}You are subscribed to the Trombi {{ trombi }}{% endtrans %}</p>
<hr>
{% set can_comment = trombi.subscription_deadline < date.today() and
date.today() <= trombi.comments_deadline %}
{% if not can_comment %}
<p>{% trans %}You can not write comments at this date.{% endtrans %}</p>
<p>
{% trans start=trombi.subscription_deadline|date(DATE_FORMAT), end=trombi.comments_deadline|date(DATE_FORMAT) %}Comments are only allowed between {{ start }} (excluded) and {{ end }} (included){% endtrans %}</p>
<hr>
{% endif %}
<div>
{% for u in user.trombi_user.trombi.users.exclude(id=user.trombi_user.id).order_by('user__nick_name') %}
<div class="ib" style="border: solid 1px grey; text-align: center">
{% set file = None %}
{% if u.profile_pict %}
{% set file = u.profile_pict.url %}
{% else %}
{% set file = static('core/img/na.gif') %}
{% endif %}
<div style="max-width: 100px; margin: auto;">
<img src="{{ file }}" alt="" style="max-width: 100px">
</div>
<div>{{ u.user.get_display_name() }}</div>
{% if trombi.show_profiles %}
<div>
<a href="{{ url('trombi:user_profile', user_id=u.id) }}">{% trans %}Profile{% endtrans %}</a>
</div>
{% endif %}
<div>
{% if can_comment %}
{% set comment = u.received_comments.filter(author__id=user.trombi_user.id).first() %}
{% if comment %}
<a href="{{ url('trombi:edit_comment', comment_id=comment.id) }}">{% trans %}Edit comment{% endtrans %}</a>
{% else %}
<a href="{{ url('trombi:new_comment', user_id=u.id) }}">{% trans %}Comment{% endtrans %}</a>
{% endif %}
{% endif %}
</div>
</div>
{% endfor %}
</div>
{% endif %}
{% endblock %}