Change button style

This commit is contained in:
cuom1999 2022-08-20 11:18:28 -05:00
parent af670f7437
commit f5234dde56
12 changed files with 189 additions and 163 deletions

View file

@ -33,14 +33,14 @@
{# Allow users to leave the virtual contest #}
{% if in_contest %}
<form action="{{ url('contest_leave', contest.key) }}" method="post"
class="contest-join-pseudotab unselectable button full">
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 unselectable button full">
class="contest-join-pseudotab btn-midnightblue">
{% csrf_token %}
<input type="submit" value="{{ _('Virtual join') }}">
</form>
@ -49,9 +49,9 @@
{# Allow users to leave the contest #}
{% if in_contest %}
<form action="{{ url('contest_leave', contest.key) }}" method="post"
class="contest-join-pseudotab unselectable button full">
class="contest-join-pseudotab">
{% csrf_token %}
<input type="submit" value="
<input type="submit" class="btn-midnightblue" value="
{%- if request.participation.spectate %}
{{- _('Stop spectating') -}}
{% else %}
@ -59,16 +59,14 @@
{% 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 unselectable button full">
<form action="{{ url('contest_join', contest.key) }}" method="post" class="contest-join-pseudotab">
{% csrf_token %}
<input type="submit" value="{{ _('Spectate contest') }}">
<input type="submit" class="btn-midnightblue" value="{{ _('Spectate contest') }}">
</form>
{% else %}
<form action="{{ url('contest_join', contest.key) }}" method="post"
class="contest-join-pseudotab unselectable button full">
<form action="{{ url('contest_join', contest.key) }}" method="post" class="contest-join-pseudotab">
{% csrf_token %}
<input type="submit" {% if not has_joined %}class="first-join"{% endif %}
<input type="submit" class="btn-midnightblue {% if not has_joined %}first-join{% endif %}"
value="{{ _('Join contest') }}">
</form>
{% endif %}

View file

@ -91,21 +91,6 @@
'{{ _('Joining a contest for the first time starts your timer, after which it becomes unstoppable.') }}');
});
function makeToggleBtn(btn, divElement) {
btn.click(function() {
divElement.toggle(300);
if (btn.html().trim() === '{{ _('Hide')}}') {
btn.html('{{ _('Show')}}');
}
else {
btn.html('{{ _('Hide')}}');
}
});
}
makeToggleBtn($("#ongoing-btn"), $("#ongoing-table"));
$('#search-org').select2({multiple: 1, placeholder: '{{ _('Groups') }}...'})
.css({'visibility': 'visible'});
@ -205,13 +190,13 @@
{% if request.profile in contest.authors.all() or request.profile in contest.curators.all() or request.profile in contest.testers.all() %}
<form action="{{ url('contest_join', contest.key) }}" method="post">
{% csrf_token %}
<input type="submit" class="unselectable button full participate-button"
<input type="submit" class="unselectable button full small"
value="{{ _('Spectate') }}">
</form>
{% else %}
<form action="{{ url('contest_join', contest.key) }}" method="post">
{% csrf_token %}
<input type="submit" class="unselectable button full participate-button join-warning"
<input type="submit" class="unselectable button full small join-warning"
value="{{ _('Join') }}">
</form>
{% endif %}
@ -233,64 +218,63 @@
{% endfor %}
</select>
{% endif %}
<button id="search-btn"> {{ _('Search')}} </button>
<button id="search-btn" class="btn-green small"> {{ _('Search')}} </button>
</form>
{% if active_participations %}
<h4>{{ _('Active Contests') }}</h4>
<table class="contest-list table striped">
<thead>
<tr>
<th style="width:90%">{{ _('Contest') }}</th>
<th>{{ _('Users') }}</th>
{% if not request.in_contest %}
<th style="width:15%"></th>
{% endif %}
</tr>
</thead>
<tbody>
{% for participation in active_participations %}
{% with contest=participation.contest %}
<tr>
<td>
<div class="contest-block">
{{ contest_head(contest) }}
{% if contest.start_time %}
<br>
{% if contest.time_limit %}
<span class="time">
{% trans countdown=participation.end_time|as_countdown %}Window ends in {{countdown}}{% endtrans %}
</span>
{% elif contest.time_before_end %}
<span class="time">{% trans countdown=contest.end_time|as_countdown %}Ends in {{countdown}}{% endtrans %}</span>
<h4 class="toggle open">
<i class="fa fa-chevron-right fa-fw"></i>
{{ _('Active Contests') }}
</h4>
<div class="toggled">
<table class="contest-list table striped">
<thead>
<tr>
<th style="width:90%">{{ _('Contest') }}</th>
<th>{{ _('Users') }}</th>
{% if not request.in_contest %}
<th style="width:15%"></th>
{% endif %}
</tr>
</thead>
<tbody>
{% for participation in active_participations %}
{% with contest=participation.contest %}
<tr>
<td>
<div class="contest-block">
{{ contest_head(contest) }}
{% if contest.start_time %}
<br>
{% if contest.time_limit %}
<span class="time">
{% trans countdown=participation.end_time|as_countdown %}Window ends in {{countdown}}{% endtrans %}
</span>
{% elif contest.time_before_end %}
<span class="time">{% trans countdown=contest.end_time|as_countdown %}Ends in {{countdown}}{% endtrans %}</span>
{% endif %}
{{ time_left(contest) }}
{% endif %}
{{ time_left(contest) }}
{% endif %}
</div>
</td>
<td>
{{ user_count(contest, request.user) }}
</td>
{{ contest_join(contest, request) }}
</tr>
{% endwith %}
{% endfor %}
</tbody>
</table>
</div>
</td>
<td>
{{ user_count(contest, request.user) }}
</td>
{{ contest_join(contest, request) }}
</tr>
{% endwith %}
{% endfor %}
</tbody>
</table>
</div>
<br>
{% endif %}
{% if current_contests %}
<h4>
<h4 class="toggle open">
<i class="fa fa-chevron-right fa-fw"></i>
{{ _('Ongoing Contests') }}
<button class="btn-contest" id="ongoing-btn">
{% if page_obj and page_obj.number > 1%}
{{_('Show')}}
{% else %}
{{_('Hide')}}
{% endif %}
</button>
</h4>
<div id="ongoing-table">
<div id="ongoing-table" class="toggled">
<table class="contest-list table striped">
<thead>
<tr>
@ -328,33 +312,38 @@
</div>
{% endif %}
<h4>{{ _('Upcoming Contests') }}</h4>
<h4 class="toggle open">
<i class="fa fa-chevron-right fa-fw"></i>
{{ _('Upcoming Contests') }}
</h4>
{% if future_contests %}
<table class="contest-list table striped">
<thead>
<tr>
<th>{{ _('Contest') }}</th>
</tr>
</thead>
<tbody>
{% for contest in future_contests %}
<div class="toggled">
<table class="contest-list table striped">
<thead>
<tr>
<td>
<div class="contest-block">
{{ contest_head(contest) }}
{% if contest.start_time %}
<br>
{% if contest.time_before_start %}
<span class="time">{{ _('Starting in %(countdown)s.', countdown=contest.start_time|as_countdown) }}</span>
{% endif %}
{{ time_left(contest) }}
{% endif %}
</div>
</td>
<th>{{ _('Contest') }}</th>
</tr>
{% endfor %}
</tbody>
</table>
</thead>
<tbody>
{% for contest in future_contests %}
<tr>
<td>
<div class="contest-block">
{{ contest_head(contest) }}
{% if contest.start_time %}
<br>
{% if contest.time_before_start %}
<span class="time">{{ _('Starting in %(countdown)s.', countdown=contest.start_time|as_countdown) }}</span>
{% endif %}
{{ time_left(contest) }}
{% endif %}
</div>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% else %}
<i>{{ _('There are no scheduled contests at this time.') }}</i>
<br>
@ -397,7 +386,7 @@
{% if not request.in_contest %}
<td><form action="{{ url('contest_join', contest.key) }}" method="post">
{% csrf_token %}
<input type="submit" class="unselectable button full participate-button"
<input type="submit" class="unselectable button full small"
value="{{ _('Virtual join') }}">
</form></td>
{% endif %}