{% extends "base.html" %} {% block content %}

Pedidos de troca

Qualquer pessoa pode assumir um turno aberto ou aceitar um pedido enviado diretamente para si.

{% for swap in swaps %}
{{ swap.assignment.date|dia_longo }}

{{ swap.assignment.schedule.name }}

{{ swap.requester.name }} pediu uma troca{% if swap.target_user %} a {{ swap.target_user.name }}{% else %} e deixou-a aberta a toda a gente{% endif %}.

{% if swap.message %}

{{ swap.message }}

{% endif %} {% if swap.accepted_by %}

Aceite por {{ swap.accepted_by.name }}.

{% endif %}
{{ swap.status|estado }}
{% if swap.status == 'open' and swap.requester_id != current_user.id and (swap.target_user_id is none or swap.target_user_id == current_user.id) %}
{% endif %} {% if swap.status == 'open' and swap.target_user_id == current_user.id %}
{% endif %} {% if swap.requester_id == current_user.id and swap.status in ['open', 'pending_approval'] %}
{% endif %} {% if current_user.is_admin and swap.status == 'pending_approval' %}
{% endif %}
{% else %}
Ainda não há pedidos de troca.
{% endfor %}
{% endblock %}