mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-09 19:40:19 +00:00
Can delete Godfathers
This commit is contained in:
@ -55,3 +55,9 @@
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro delete_godfather(user, profile, godfather, is_father) %}
|
||||
{% if user == profile or user.is_root or user.is_board_member %}
|
||||
<a href="{{ url("core:user_godfathers_delete", user_id=profile.id, godfather_id=godfather.id, is_father=is_father) }}">{% trans %}Delete{% endtrans %}</a>
|
||||
{% endif %}
|
||||
{% endmacro %}
|
@ -1,26 +1,34 @@
|
||||
{% extends "core/base.jinja" %}
|
||||
{% from "core/macros.jinja" import user_link_with_pict %}
|
||||
{% from "core/macros.jinja" import user_link_with_pict, delete_godfather %}
|
||||
|
||||
{% block title %}
|
||||
{% trans user_name=profile.get_display_name() %}{{ user_name }}'s godfathers{% endtrans %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h4>{% trans %}Godfathers{% endtrans %}</h4>
|
||||
<ul>
|
||||
{% for u in profile.godfathers.all() %}
|
||||
<li> <a href="{{ url("core:user_godfathers", user_id=u.id) }}" class="mini_profile_link" >
|
||||
{{ u.get_mini_item()|safe }} </a> </li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<h4>{% trans %}Godchildren{% endtrans %}</h4>
|
||||
<ul>
|
||||
{% for u in profile.godchildren.all() %}
|
||||
<li> <a href="{{ url("core:user_godfathers", user_id=u.id) }}" class="mini_profile_link" >
|
||||
{{ u.get_mini_item()|safe }} </a> </li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% if profile == user %}
|
||||
{% if profile.godfathers.exists() %}
|
||||
<h4>{% trans %}Godfathers{% endtrans %}</h4>
|
||||
<ul>
|
||||
{% for u in profile.godfathers.all() %}
|
||||
<li> <a href="{{ url("core:user_godfathers", user_id=u.id) }}" class="mini_profile_link" >
|
||||
{{ u.get_mini_item()|safe }} </a>{{ delete_godfather(user, profile, u, True) }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% else %}
|
||||
<p>{% trans %}No godfathers{% endtrans %}
|
||||
{% endif %}
|
||||
{% if profile.godchildren.exists() %}
|
||||
<h4>{% trans %}Godchildren{% endtrans %}</h4>
|
||||
<ul>
|
||||
{% for u in profile.godchildren.all() %}
|
||||
<li> <a href="{{ url("core:user_godfathers", user_id=u.id) }}" class="mini_profile_link" >
|
||||
{{ u.get_mini_item()|safe }} </a>{{ delete_godfather(user, profile, u, False) }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% else %}
|
||||
<p>{% trans %}No godchildren{% endtrans %}
|
||||
{% endif %}
|
||||
{% if profile == user or user.is_root %}
|
||||
<form action="" method="post">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p() }}
|
||||
|
Reference in New Issue
Block a user