mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-10 11:59:23 +00:00
Add profiles to Trombi
This commit is contained in:
35
trombi/templates/trombi/user_profile.jinja
Normal file
35
trombi/templates/trombi/user_profile.jinja
Normal file
@ -0,0 +1,35 @@
|
||||
{% extends "core/base.jinja" %}
|
||||
|
||||
{% block title %}
|
||||
{% trans user_name=trombi_user.user.get_display_name() %}{{ user_name }}'s Trombi profile{% endtrans %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h3>{% trans user_name=trombi_user.user.get_display_name() %}{{ user_name }}'s Trombi profile{% endtrans %}</h3>
|
||||
<p> <a href="{{ url('trombi:user_tools') }}">{% trans %}Back to tools{% endtrans %}</a></p>
|
||||
<div>
|
||||
{% set profile_file = None %}
|
||||
{% set scrub_file = None %}
|
||||
{% if trombi_user.profile_pict %}
|
||||
{% set profile_file = trombi_user.profile_pict.url %}
|
||||
{% else %}
|
||||
{% set profile_file = static('core/img/na.gif') %}
|
||||
{% endif %}
|
||||
{% if trombi_user.scrub_pict %}
|
||||
{% set scrub_file = trombi_user.scrub_pict.url %}
|
||||
{% else %}
|
||||
{% set scrub_file = static('core/img/na.gif') %}
|
||||
{% endif %}
|
||||
<div style="max-width: 410px; margin: auto;">
|
||||
<img src="{{ profile_file }}" alt="" style="max-width: 200px">
|
||||
<img src="{{ scrub_file }}" alt="" style="max-width: 200px">
|
||||
</div>
|
||||
<dl>
|
||||
{% for c in trombi_user.received_comments.all() %}
|
||||
<dt style="font-weight: bold; font-size: 110%">{{ c.author.user.get_display_name() }}</dt>
|
||||
<dd>{{ c.content}}</dd>
|
||||
{% endfor %}
|
||||
</dl>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
@ -38,14 +38,21 @@
|
||||
<img src="{{ file }}" alt="" style="max-width: 100px">
|
||||
</div>
|
||||
<div>{{ u.user.get_display_name() }}</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 %}
|
||||
{% 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>
|
||||
|
Reference in New Issue
Block a user