{% if request.user.is_authenticated and request.user.member is not None and request.user.member.current_membership is not None and request.user.member.can_attend_events %}
{% if event.status == event.REGISTRATION_OPEN or event.status == event.REGISTRATION_OPEN_NO_CANCEL %}
{% if user_registration_allowed %}
{% if can_update_event_registration %}
{% if registration is not None and registration.date_cancelled is None and event.has_fields %}
<inputtype="submit"class="btn btn-style1"value="{% trans "Updateregistration"%}"/>
</form>
{% endif %}
{% endif %}
{% if event.status == event.REGISTRATION_OPEN or event.status == event.REGISTRATION_CLOSED_CANCEL_ONLY or event.status == event.REGISTRATION_OPEN_NO_CANCEL %}
{% if registration is None or registration.date_cancelled is not None %}
{% if event.status == event.REGISTRATION_OPEN or event.status == event.REGISTRATION_OPEN_NO_CANCEL %}
<inputtype="submit"class="btn btn-style1"value="{% trans "Cancelregistration"%}"onclick="return confirm('{% blocktrans with costs=event.fine %}The deadline has passed, are you sure you want to cancel your registration and pay the full costs of €{{ costs }}? You will not be able to undo this!{% endblocktrans %}');"/>
{% else %}
<inputtype="submit"class="btn btn-style1"value="{% trans "Cancelregistration"%}"/>
{% endif %}
</form>
{% endif %}
</form>
{% elif can_cancel_event_registration %}
{# Special message to accept costs when cancelling after the deadline, unless member is on the waiting list #}
<inputtype="submit"class="btn btn-style1"value="{% trans "Cancelregistration"%}"onclick="return confirm('{% blocktrans with costs=event.fine %}The deadline has passed, are you sure you want to cancel your registration and pay the full costs of €{{ costs }}? You will not be able to undo this!{% endblocktrans %}');"/>
{% else %}
<inputtype="submit"class="btn btn-style1"value="{% trans "Cancelregistration"%}"/>
{% endif %}
</form>
{% endif %}
{% elif request.user.is_authenticated is False %}
<aclass="btn btn-style1"href="{% url 'login' %}?next={{ request.path }}">{% trans "Login" %}</a>