{# DO NOT COPY THAT TO OTHER PLACES #}
{# THAT BLOCK SHOULD BE MOVED IN SEPARATE TEMPLATE #}
{# If connection exists then display it status #}
{% if item.connection %}
{% ifequal item.connection.status Connection.STATUS_NEW %}
{% ifequal item.connection.originator Connection.SIDE_FROM %}
<a href="{% url connection-manage 'approve' item.connection.pk %}">Approve</a><br/>
<a href="{% url connection-manage 'exclude' item.connection.pk %}">Exclude</a><br/>
{% else %}
Pending
{% endifequal %}
{% endifequal %}
{% ifequal item.connection.status Connection.STATUS_APPROVED %}
Approved
{% endifequal %}
{% ifequal item.connection.status Connection.STATUS_EXCLUDED %}
Excluded
{% endifequal %}
{# If connection does not exist then display then display link #}
{# to create connection if site has owner else #}
{# display link to invite site owner #}
{% else %}
{% if item.src_site.payee %}
<a href="{% url connections_create "in" item.src_site.pk %}">Request connection</a>
{% else %}
<a href="{% url owner_invite request.website.pk item.src_site.pk "owner_incoming" %}?connection=1">Invite and connect</a>
{% endif %}
{% endif %}
</td>
<td>
Reward (todo)
{% comment %}
{% ifequal item.connection.status Connection.STATUS_APPROVED %}
<a href="{% url connection-manage 'reward' item.connection.pk %}">Reward</a>
{% endifequal %}
{% endcomment %}
<div class="popmenu">
<img class="trigger" src="{{ MEDIA_URL }}images/asc.gif">
<div class="popup">
<a href="{% url messages_compose %}{% for u in item.src_site.owner.all %}{{ u.username}}/{% endfor %}">Send message</a><br/>
</div>
</div>