{% endif %}
{% if not (tsdoc.attend) and not model.contest.isDone(tdoc) %}
{% if handler.user.hasPerm(perm.PERM_ATTEND_CONTEST) and handler.user.hasPriv(PRIV.PRIV_USER_PROFILE) %}
{% elif not handler.user.hasPriv(PRIV.PRIV_USER_PROFILE) %}
{{ _('Login to Attend Contest') }}
{% elif not handler.user._dudoc.join %}
{% endif %}
{% if handler.user.own(tdoc) or handler.user.hasPriv(PRIV.PRIV_READ_RECORD_CODE) or handler.user.hasPerm(perm.PERM_READ_RECORD_CODE) %}
{% if model.contest.canShowRecord.call(handler, tdoc, true) %}