diff --git a/resources/base.scss b/resources/base.scss index 244c922..daedb8c 100644 --- a/resources/base.scss +++ b/resources/base.scss @@ -452,6 +452,7 @@ noscript #noscript { .toggle { font-weight: bold; + cursor: pointer; .fa { transition: transform 0.4s; diff --git a/resources/contest.scss b/resources/contest.scss index a48bfb8..a4cdef2 100644 --- a/resources/contest.scss +++ b/resources/contest.scss @@ -185,18 +185,12 @@ form.contest-join-pseudotab { display: inline; - padding: 6px 8px !important; line-height: 1.7em; - margin-left: 0.5em; - border-bottom-left-radius: 0; - border-bottom-right-radius: 0; + margin-left: auto; input { - display: inline; - border: none; - padding: 0; - background: none; - font-weight: 600; + padding-left: 5px !important; + padding-right: 5px !important; } } diff --git a/resources/problem.scss b/resources/problem.scss index b85d63e..2631453 100644 --- a/resources/problem.scss +++ b/resources/problem.scss @@ -60,7 +60,6 @@ a { margin-right: 5px; display: inline-block; - padding: 3px 10px; vertical-align: middle; } @@ -308,6 +307,7 @@ ul.problem-list { border-radius: 5px; margin-bottom: 1em; display: flex; + justify-content: space-between; } .problem-feed-option-item { diff --git a/resources/widgets.scss b/resources/widgets.scss index 1bd5d46..41ef66d 100644 --- a/resources/widgets.scss +++ b/resources/widgets.scss @@ -28,47 +28,93 @@ // Bootstrap-y buttons .button, button, input[type=submit] { - color: white !important; - text-decoration: none !important; + align-items: center; + background-clip: padding-box; + background-color: #fa6400; + border: 1px solid transparent; + border-radius: .25rem; + box-shadow: rgba(0, 0, 0, 0.02) 0 1px 3px 0; + box-sizing: border-box; + color: #fff !important; cursor: pointer; - vertical-align: middle; - white-space: nowrap; - font-weight: 400; - line-height: 1.4; - background: rgb(51, 122, 183) none repeat scroll 0 (0% / auto) padding-box border-box; - background: -webkit-linear-gradient(top, #337ab7 0, #265a88 100%) repeat-x; - background: linear-gradient(to bottom, #337ab7 0, #265a88 100%) repeat-x; - border-radius: $widget_border_radius; - padding: 6px 12px; display: block; - border: 1px solid #245580; + font-family: system-ui,-apple-system,system-ui,"Helvetica Neue",Helvetica,Arial,sans-serif; + font-size: 16px; + font-weight: 600; + justify-content: center; + line-height: 1.25; + margin: 0; + min-height: 3rem; + padding: calc(.875rem - 1px) calc(1.5rem - 1px); + position: relative; + text-decoration: none; + transition: all 250ms; + user-select: none; + -webkit-user-select: none; + touch-action: manipulation; + vertical-align: middle; text-align: center; - - // 4k hack - font-size: $base_font_size; - - &:hover { - background: #265a88; - } + width: auto; &.disabled { background: linear-gradient(to bottom, darkgray 0, gray 100%) repeat-x !important; border-color: grey !important; cursor: not-allowed; } + + &.small { + min-height: auto; + padding: calc(.5rem - 1px) calc(1rem - 1px); + } + + &.btn-gray { + background: gray; + } + + &.btn-green { + background: green; + + &:hover { + background: #2c974b; + } + } + + &.btn-darkred { + background: darkred; + + &:hover { + background: brown; + } + } + + &.btn-midnightblue { + background: midnightblue; + + &:hover { + background: darkblue; + } + } } .button.full, input[type=submit].full, button.full { - padding: 6px 0; + } -button:hover, button:hover, input[type=submit]:hover { - background: #265a88; +.button:hover, button:hover, input[type=submit]:hover { + background-color: #fb8332; + box-shadow: rgba(0, 0, 0, 0.1) 0 4px 12px; + transform: translateY(-1px); +} + +.button:focus, button:focus, input[type=submit]:focus { + background-color: #fb8332; + box-shadow: rgba(0, 0, 0, 0.1) 0 4px 12px; } .button:active, button:active, input[type=submit]:hover { - border-color: #245580; - background: #265a88; + background-color: #c85000; + box-shadow: rgba(0, 0, 0, .06) 0 2px 4px; + transform: translateY(0); } .inline-button { @@ -538,4 +584,4 @@ ul.select2-selection__rendered { .control-button:hover { background: gray; -} \ No newline at end of file +} diff --git a/templates/contest/contest-tabs.html b/templates/contest/contest-tabs.html index d063a24..b09a859 100644 --- a/templates/contest/contest-tabs.html +++ b/templates/contest/contest-tabs.html @@ -33,14 +33,14 @@ {# Allow users to leave the virtual contest #} {% if in_contest %}
+ class="contest-join-pseudotab btn-midnightblue"> {% csrf_token %}
{% else %} {# Allow users to virtual join #}
+ class="contest-join-pseudotab btn-midnightblue"> {% csrf_token %}
@@ -49,9 +49,9 @@ {# Allow users to leave the contest #} {% if in_contest %}
+ class="contest-join-pseudotab"> {% csrf_token %} -
{% elif is_editor or is_tester or live_participation.ended %} -
+ {% csrf_token %} - +
{% else %} -
+ {% csrf_token %} -
{% endif %} diff --git a/templates/contest/list.html b/templates/contest/list.html index 36f81bb..45e9152 100644 --- a/templates/contest/list.html +++ b/templates/contest/list.html @@ -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() %}
{% csrf_token %} -
{% else %}
{% csrf_token %} -
{% endif %} @@ -233,64 +218,63 @@ {% endfor %} {% endif %} - + {% if active_participations %} -

{{ _('Active Contests') }}

- - - - - - {% if not request.in_contest %} - - {% endif %} - - - - {% for participation in active_participations %} - {% with contest=participation.contest %} - - + + {{ contest_join(contest, request) }} + + {% endwith %} + {% endfor %} + +
{{ _('Contest') }}{{ _('Users') }}
-
- {{ contest_head(contest) }} - {% if contest.start_time %} -
- {% if contest.time_limit %} - - {% trans countdown=participation.end_time|as_countdown %}Window ends in {{countdown}}{% endtrans %} - - {% elif contest.time_before_end %} - {% trans countdown=contest.end_time|as_countdown %}Ends in {{countdown}}{% endtrans %} +

+ + {{ _('Active Contests') }} +

+
+ + + + + + {% if not request.in_contest %} + + {% endif %} + + + + {% for participation in active_participations %} + {% with contest=participation.contest %} + + - - {{ contest_join(contest, request) }} - - {% endwith %} - {% endfor %} - -
{{ _('Contest') }}{{ _('Users') }}
+
+ {{ contest_head(contest) }} + {% if contest.start_time %} +
+ {% if contest.time_limit %} + + {% trans countdown=participation.end_time|as_countdown %}Window ends in {{countdown}}{% endtrans %} + + {% elif contest.time_before_end %} + {% trans countdown=contest.end_time|as_countdown %}Ends in {{countdown}}{% endtrans %} + {% endif %} + {{ time_left(contest) }} {% endif %} - {{ time_left(contest) }} - {% endif %} -
-
- {{ user_count(contest, request.user) }} -
+
+
+ {{ user_count(contest, request.user) }} +
+
{% endif %} {% if current_contests %} -

+

+ {{ _('Ongoing Contests') }} -

-
+
@@ -328,33 +312,38 @@ {% endif %} -

{{ _('Upcoming Contests') }}

+

+ + {{ _('Upcoming Contests') }} +

{% if future_contests %} -
- - - - - - - {% for contest in future_contests %} +
+
{{ _('Contest') }}
+ - + - {% endfor %} - -
-
- {{ contest_head(contest) }} - {% if contest.start_time %} -
- {% if contest.time_before_start %} - {{ _('Starting in %(countdown)s.', countdown=contest.start_time|as_countdown) }} - {% endif %} - {{ time_left(contest) }} - {% endif %} -
-
{{ _('Contest') }}
+ + + {% for contest in future_contests %} + + +
+ {{ contest_head(contest) }} + {% if contest.start_time %} +
+ {% if contest.time_before_start %} + {{ _('Starting in %(countdown)s.', countdown=contest.start_time|as_countdown) }} + {% endif %} + {{ time_left(contest) }} + {% endif %} +
+ + + {% endfor %} + + +
{% else %} {{ _('There are no scheduled contests at this time.') }}
@@ -397,7 +386,7 @@ {% if not request.in_contest %}
{% csrf_token %} -
{% endif %} diff --git a/templates/problem/feed.html b/templates/problem/feed.html index 76c6d0e..9d60bff 100644 --- a/templates/problem/feed.html +++ b/templates/problem/feed.html @@ -5,14 +5,14 @@ {% block middle_content %}
- + {{_('FOR YOU')}} - + {{_('NEW')}} {% if request.user.has_perm('judge.suggest_problem_changes') %} - + {{_('VOLUNTEER')}} {% endif %} diff --git a/templates/problem/problem.html b/templates/problem/problem.html index d3ac052..33fa96c 100644 --- a/templates/problem/problem.html +++ b/templates/problem/problem.html @@ -164,7 +164,7 @@ {% block info_float %} {% if request.user.is_authenticated and request.in_contest_mode and submission_limit %} {% if submissions_left > 0 %} - + {{ _('Submit solution') }}
@@ -179,7 +179,7 @@
{{ _('0 submissions left') }}
{% endif %} {% else %} - + {{ _('Submit solution') }} {% endif %} diff --git a/templates/problem/search-form.html b/templates/problem/search-form.html index 62e62b8..d0116fe 100644 --- a/templates/problem/search-form.html +++ b/templates/problem/search-form.html @@ -98,8 +98,8 @@
diff --git a/templates/submission/list.html b/templates/submission/list.html index 4e7b95c..65fbd24 100644 --- a/templates/submission/list.html +++ b/templates/submission/list.html @@ -348,7 +348,7 @@
- {{ _('Go') }} + {{ _('Go') }}
diff --git a/templates/user/edit-profile.html b/templates/user/edit-profile.html index 8bd2c2f..532c779 100644 --- a/templates/user/edit-profile.html +++ b/templates/user/edit-profile.html @@ -161,21 +161,6 @@ - - - {% if profile.is_totp_enabled %} - {{ _('Two Factor Authentication is enabled.') }} - {% if require_staff_2fa and request.user.is_staff %} - Disable - {% else %} - Disable - {% endif %} - {% else %} - {{ _('Two Factor Authentication is disabled.') }} - Enable - {% endif %} - - @@ -187,7 +172,20 @@ -
+
+ {% if profile.is_totp_enabled %} + {{ _('Two Factor Authentication is enabled.') }} + {% if require_staff_2fa and request.user.is_staff %} + Disable + {% else %} + Disable + {% endif %} + {% else %} + {{ _('Two Factor Authentication is disabled.') }} + Enable + {% endif %} +
+

{{ _('User-script') }}:
{{ form.user_script }}
diff --git a/templates/user/user-base.html b/templates/user/user-base.html index 42407e4..60e2319 100644 --- a/templates/user/user-base.html +++ b/templates/user/user-base.html @@ -95,7 +95,7 @@ {% if request.user != user.user %}
{% csrf_token %} -