Move join button
This commit is contained in:
parent
756023a097
commit
9c6cd01ec2
4 changed files with 64 additions and 53 deletions
|
@ -186,6 +186,7 @@ form.contest-join-pseudotab {
|
|||
display: inline;
|
||||
line-height: 1.7em;
|
||||
margin-left: auto;
|
||||
float: right;
|
||||
|
||||
input {
|
||||
padding-left: 5px !important;
|
||||
|
|
|
@ -1,57 +1,12 @@
|
|||
<style>
|
||||
@media(max-width: 799px) {
|
||||
.middle-right-content {
|
||||
margin-left: 8px;
|
||||
margin-right: 8px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<div class="left-sidebar">
|
||||
{% if request.user.is_authenticated %}
|
||||
{% if contest.can_join or is_editor or is_tester %}
|
||||
{% set in_contest = contest.is_in_contest(request.user) %}
|
||||
{% if contest.ended %}
|
||||
{# Allow users to leave the virtual contest #}
|
||||
{% if in_contest %}
|
||||
<form action="{{ url('contest_leave', contest.key) }}" method="post"
|
||||
class="contest-join-pseudotab btn-midnightblue">
|
||||
{% csrf_token %}
|
||||
<input type="submit" class="leaving-forever" value="{{ _('Leave contest') }}">
|
||||
</form>
|
||||
{% else %}
|
||||
{# Allow users to virtual join #}
|
||||
<form action="{{ url('contest_join', contest.key) }}" method="post"
|
||||
class="contest-join-pseudotab btn-midnightblue">
|
||||
{% csrf_token %}
|
||||
<input type="submit" value="{{ _('Virtual join') }}">
|
||||
</form>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{# Allow users to leave the contest #}
|
||||
{% if in_contest %}
|
||||
<form action="{{ url('contest_leave', contest.key) }}" method="post"
|
||||
class="contest-join-pseudotab">
|
||||
{% csrf_token %}
|
||||
<input type="submit" class="btn-midnightblue" value="
|
||||
{%- if request.participation.spectate %}
|
||||
{{- _('Stop spectating') -}}
|
||||
{% else %}
|
||||
{{- _('Leave contest') -}}
|
||||
{% endif %}">
|
||||
</form>
|
||||
{% elif is_editor or is_tester or live_participation.ended %}
|
||||
<form action="{{ url('contest_join', contest.key) }}" method="post" class="contest-join-pseudotab">
|
||||
{% csrf_token %}
|
||||
<input type="submit" class="btn-midnightblue" value="{{ _('Spectate contest') }}">
|
||||
</form>
|
||||
{% else %}
|
||||
<form action="{{ url('contest_join', contest.key) }}" method="post" class="contest-join-pseudotab">
|
||||
{% csrf_token %}
|
||||
<input type="submit" class="btn-midnightblue {% if not has_joined %}first-join{% endif %}"
|
||||
value="{{ _('Join contest') }}">
|
||||
</form>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% elif contest.can_join %}
|
||||
<form action="{{ url('auth_login') }}" method="get"
|
||||
class="contest-join-pseudotab unselectable">
|
||||
<input type="hidden" name="next" value="{{ LOGIN_RETURN_PATH|urlencode }}">
|
||||
<input type="submit" class="btn-midnightblue" value="{{ _('Login to participate') }}">
|
||||
</form>
|
||||
{% endif %}
|
||||
{{ make_tab_item('detail', 'fa fa-info-circle', url('contest_view', contest.key), _('Info')) }}
|
||||
{% if contest.ended or can_edit %}
|
||||
{{ make_tab_item('stats', 'fa fa-pie-chart', url('contest_stats', contest.key), _('Statistics')) }}
|
||||
|
|
|
@ -20,6 +20,60 @@
|
|||
{% block middle_content %}
|
||||
{% include "contest/contest-datetime.html" %}
|
||||
|
||||
{% if request.user.is_authenticated %}
|
||||
{% if contest.can_join or is_editor or is_tester %}
|
||||
{% set in_contest = contest.is_in_contest(request.user) %}
|
||||
{% if contest.ended %}
|
||||
{# Allow users to leave the virtual contest #}
|
||||
{% if in_contest %}
|
||||
<form action="{{ url('contest_leave', contest.key) }}" method="post"
|
||||
class="contest-join-pseudotab btn-midnightblue">
|
||||
{% csrf_token %}
|
||||
<input type="submit" class="leaving-forever" value="{{ _('Leave contest') }}">
|
||||
</form>
|
||||
{% else %}
|
||||
{# Allow users to virtual join #}
|
||||
<form action="{{ url('contest_join', contest.key) }}" method="post"
|
||||
class="contest-join-pseudotab btn-midnightblue">
|
||||
{% csrf_token %}
|
||||
<input type="submit" value="{{ _('Virtual join') }}">
|
||||
</form>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{# Allow users to leave the contest #}
|
||||
{% if in_contest %}
|
||||
<form action="{{ url('contest_leave', contest.key) }}" method="post"
|
||||
class="contest-join-pseudotab">
|
||||
{% csrf_token %}
|
||||
<input type="submit" class="btn-midnightblue" value="
|
||||
{%- if request.participation.spectate %}
|
||||
{{- _('Stop spectating') -}}
|
||||
{% else %}
|
||||
{{- _('Leave contest') -}}
|
||||
{% endif %}">
|
||||
</form>
|
||||
{% elif is_editor or is_tester or live_participation.ended %}
|
||||
<form action="{{ url('contest_join', contest.key) }}" method="post" class="contest-join-pseudotab">
|
||||
{% csrf_token %}
|
||||
<input type="submit" class="btn-midnightblue" value="{{ _('Spectate contest') }}">
|
||||
</form>
|
||||
{% else %}
|
||||
<form action="{{ url('contest_join', contest.key) }}" method="post" class="contest-join-pseudotab">
|
||||
{% csrf_token %}
|
||||
<input type="submit" class="btn-midnightblue {% if not has_joined %}first-join{% endif %}"
|
||||
value="{{ _('Join contest') }}">
|
||||
</form>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% elif contest.can_join %}
|
||||
<form action="{{ url('auth_login') }}" method="get"
|
||||
class="contest-join-pseudotab unselectable">
|
||||
<input type="hidden" name="next" value="{{ LOGIN_RETURN_PATH|urlencode }}">
|
||||
<input type="submit" class="btn-midnightblue" value="{{ _('Login to participate') }}">
|
||||
</form>
|
||||
{% endif %}
|
||||
|
||||
<div class="content-description">
|
||||
{% cache 3600 'contest_html' contest.id MATH_ENGINE %}
|
||||
{{ contest.description|markdown|reference|str|safe }}
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
<input id="search-handle" type="text" name="search"
|
||||
placeholder="{{ _('Search by handle...') }}">
|
||||
</form>
|
||||
<div style="clear:both"></div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
|
|
Loading…
Reference in a new issue