Fix user profiles not showing awards before an account gets a solve (#1848)

- Change users/private.html, users/public.html to show awards before a user gets a solve
- Change teams/private.html, teams/public.html to show awards before a team gets a solve
This commit is contained in:
Kevin Chung
2021-03-24 21:14:11 -04:00
committed by GitHub
parent cd9ff1ec32
commit c63c93b30a
5 changed files with 20 additions and 14 deletions

View File

@@ -24,6 +24,8 @@
- Allow for one theme to reference and inherit from another theme through approaches like `{% extends "core/page.html" %}`
- Allow for the automatic date rendering format to be overridden by specifying a `data-time-format` attribute.
- Add styling for the `<blockquote>` element.
- Change users/private.html, users/public.html to show awards before a user gets a solve
- Change teams/private.html, teams/public.html to show awards before a team gets a solve
- Change `colorHash` function to use HSL color values to avoid generating too light/dark colors
- Fix an issue where hidden users couldn't see their graphing data on their private user page (`/user`)
- Fix scoreboard table identifier to switch between User/Team depending on configured user mode

View File

@@ -273,7 +273,7 @@
</div>
</div>
{% if solves %}
{% if solves or awards %}
<div class="row">
<div class="col-md-6 d-none d-md-block d-lg-block">
<div id="keys-pie-graph" class="d-flex align-items-center">
@@ -370,12 +370,12 @@
'type': 'team',
'id': team.id,
'name': team.name,
'account_id': 'me' if user is defined and user.team_id == team.id else team.id,
'account_id': 'me',
} | tojson }};
var team_captain = {{ (user.id == team.captain_id) | tojson }};
</script>
<script defer src="{{ url_for('views.themes', path='js/echarts.bundle.js') }}"></script>
{% if solves %}
{% if solves or awards %}
<script defer src="{{ url_for('views.themes', path='js/graphs.js') }}"></script>
<script defer src="{{ url_for('views.themes', path='js/pages/stats.js') }}"></script>
{% endif %}

View File

@@ -89,7 +89,7 @@
</div>
</div>
{% if solves %}
{% if solves or awards %}
<div class="row">
<div class="col-md-6 d-none d-md-block d-lg-block">
<div id="keys-pie-graph" class="d-flex align-items-center">
@@ -186,7 +186,7 @@
'type': 'team',
'id': team.id,
'name': team.name,
'account_id': 'me' if user is defined and user.team_id == team.id else team.id,
'account_id': team.id,
} | tojson }};
</script>
<script defer src="{{ url_for('views.themes', path='js/echarts.bundle.js') }}"></script>
@@ -194,7 +194,7 @@
{% endblock %}
{% block entrypoint %}
{% if solves %}
{% if solves or awards %}
<script defer src="{{ url_for('views.themes', path='js/pages/stats.js') }}"></script>
{% endif %}
{% endblock %}

View File

@@ -71,7 +71,9 @@
<div class="container">
{% include "components/errors.html" %}
{% if user.solves %}
{% set solves = user.solves %}
{% set awards = user.awards %}
{% if solves or awards %}
<div class="row">
<div class="col-md-6 d-none d-md-block d-lg-block">
<div id="keys-pie-graph" class="d-flex align-items-center">
@@ -103,7 +105,7 @@
<div class="col-md-12">
<h3>Awards</h3>
</div>
{% for award in user.awards %}
{% for award in awards %}
<div class="col-md-3 col-sm-6">
<p class="text-center">
<i class="award-icon award-{{ award.icon }} fa-2x"></i>
@@ -132,7 +134,7 @@
</tr>
</thead>
<tbody>
{% for solve in user.solves %}
{% for solve in solves %}
<tr>
<td>
<a href="{{ url_for('challenges.listing') }}#{{ solve.challenge.name }}-{{ solve.challenge.id }}">
@@ -166,7 +168,7 @@
'type': 'user',
'id': user.id,
'name': user.name,
'account_id': 'me' if user.id == Session.id else user.id,
'account_id': 'me',
} | tojson }};
</script>
<script defer src="{{ url_for('views.themes', path='js/echarts.bundle.js') }}"></script>

View File

@@ -71,7 +71,9 @@
<div class="container">
{% include "components/errors.html" %}
{% if user.solves %}
{% set solves = user.solves %}
{% set awards = user.awards %}
{% if solves or awards %}
<div class="row">
<div class="col-md-6 d-none d-md-block d-lg-block">
<div id="keys-pie-graph" class="d-flex align-items-center">
@@ -103,7 +105,7 @@
<div class="col-md-12">
<h3>Awards</h3>
</div>
{% for award in user.awards %}
{% for award in awards %}
<div class="col-md-3 col-sm-6">
<p class="text-center">
<i class="award-icon award-{{ award.icon }} fa-2x"></i>
@@ -132,7 +134,7 @@
</tr>
</thead>
<tbody>
{% for solve in user.solves %}
{% for solve in solves %}
<tr>
<td>
<a href="{{ url_for('challenges.listing') }}#{{ solve.challenge.name }}-{{ solve.challenge.id }}">
@@ -166,7 +168,7 @@
'type': 'user',
'id': user.id,
'name': user.name,
'account_id': 'me' if user.id == Session.id else user.id,
'account_id': user.id,
} | tojson }};
</script>
<script defer src="{{ url_for('views.themes', path='js/echarts.bundle.js') }}"></script>