Add official contest
This commit is contained in:
parent
796a670cd7
commit
10e50795d9
25 changed files with 882 additions and 362 deletions
|
@ -77,30 +77,24 @@
|
|||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro contest_join(contest, request) %}
|
||||
{% if request.in_contest and request.participation.contest == contest %}
|
||||
<button class="small" disabled>{{ _('In contest') }}</button>
|
||||
{% elif request.profile.id in contest.editor_ids or request.profile.id in contest.tester_ids %}
|
||||
<form action="{{ url('contest_join', contest.key) }}" method="post">
|
||||
{% csrf_token %}
|
||||
<input type="submit" class="unselectable button full small"
|
||||
value="{{ _('Spectate') }}">
|
||||
</form>
|
||||
{% macro contest_format_user(contest, request, show_user=True, is_official=False) %}
|
||||
{% if is_official %}
|
||||
<div style="display: flex; flex-direction: column;">
|
||||
<div><b>{{ _('Format') }}</b>: {{ contest.format.name }}</div>
|
||||
<div><b>{{ _('Category') }}</b>: {{ contest.official.category.name }}</div>
|
||||
<div><b>{{ _('Location') }}</b>: {{ contest.official.location.name }}</div>
|
||||
<div><b>{{ _('Year') }}</b>: {{ contest.official.year }}</div>
|
||||
{% if show_user %}
|
||||
<div class="contest-title" style="margin-top: 0.4em">{{ user_count(contest, request.user) }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% else %}
|
||||
<form action="{{ url('contest_join', contest.key) }}" method="post">
|
||||
{% csrf_token %}
|
||||
<input type="submit" class="unselectable button full small join-warning"
|
||||
value="{{ _('Join') }}">
|
||||
</form>
|
||||
<div style="display: flex; flex-direction: column;">
|
||||
<div class="contest-title"> {{ _('Format') }} </div>
|
||||
<div style="flex-grow: 1">{{ contest.format.name }}</div>
|
||||
{% if show_user %}
|
||||
<div class="contest-title" style="margin-top: 0.4em">{{ user_count(contest, request.user) }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro contest_format_user(contest, request, show_user=True) %}
|
||||
<div style="display: flex; flex-direction: column; height: 100%;">
|
||||
<div class="contest-title"> {{ _('Format') }} </div>
|
||||
<div style="flex-grow: 1">{{ contest.format.name }}</div>
|
||||
{% if show_user %}
|
||||
<div class="contest-title">{{ user_count(contest, request.user) }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endmacro %}
|
Loading…
Add table
Add a link
Reference in a new issue