Redesign org and fullname

This commit is contained in:
cuom1999 2022-06-19 16:15:58 +07:00
parent bce34a0c40
commit c69127748a
4 changed files with 21 additions and 33 deletions

View file

@ -89,17 +89,6 @@
text-align: left; text-align: left;
} }
#users-table .fullname-column {
min-width: 6em;
text-align: right !important;
border-right: none !important;
}
#users-table .fullname-column span {
color: gray !important;
font-weight: 600;
}
#users-table th a { #users-table th a {
color: white; color: white;
} }

View file

@ -56,7 +56,7 @@
} }
} }
function renew_filter() { function renew_filter(excludeBox=null) {
var checkboxes = [ var checkboxes = [
'#show-organizations-checkbox', '#show-organizations-checkbox',
'#show-fullnames-checkbox', '#show-fullnames-checkbox',
@ -69,6 +69,7 @@
] ]
for (var i of checkboxes) { for (var i of checkboxes) {
if (i === excludeBox) continue;
var $box = $(i); var $box = $(i);
if ($box.is(':checked')) { if ($box.is(':checked')) {
$box.prop('checked', false); $box.prop('checked', false);
@ -79,6 +80,7 @@
var to_update = false; var to_update = false;
for (var i of checkboxes2) { for (var i of checkboxes2) {
if (i === excludeBox) continue;
var $box = $(i); var $box = $(i);
if ($box.is(':checked')) { if ($box.is(':checked')) {
to_update = true; to_update = true;
@ -103,7 +105,7 @@
var is_virtual = []; var is_virtual = [];
$('.user-name').each(function() { $('.user-name').each(function() {
if($(this).children('sup').length) { if($(this).children('sub').length) {
is_virtual.push(1); is_virtual.push(1);
} }
else is_virtual.push(0); else is_virtual.push(0);
@ -123,6 +125,7 @@
success: function(HTML) { success: function(HTML) {
$('#users-table').html(HTML); $('#users-table').html(HTML);
highlightFirstSolve(); highlightFirstSolve();
renew_filter("#show-virtual-checkbox");
$('#loading-gif').hide(); $('#loading-gif').hide();
if (!virtual && !friend) { if (!virtual && !friend) {
get_initial_rank(); get_initial_rank();
@ -171,10 +174,10 @@
}); });
$('#show-organizations-checkbox').click(function () { $('#show-organizations-checkbox').click(function () {
$('.organization-column').toggle(); $('.organization').toggle();
}); });
$('#show-fullnames-checkbox').click(function () { $('#show-fullnames-checkbox').click(function () {
$('.fullname-column').toggle(); $('.fullname').toggle();
}); });
{% if request.user.is_authenticated %} {% if request.user.is_authenticated %}

View file

@ -6,34 +6,30 @@
{% if has_rating %} {% if has_rating %}
<th>{{ _('Rating') }}</th> <th>{{ _('Rating') }}</th>
{% endif %} {% endif %}
<th class="organization-column">{{ _('Organization') }}</th>
<th class="fullname-column" style="display: none;">{{ _('Full Name') }}</th>
{% endblock %} {% endblock %}
{% block after_rank %} {% block after_rank %}
{% if has_rating %} {% if has_rating %}
<td>{% if user.participation_rating %}{{ rating_number(user.participation_rating) }}{% endif %}</td> <td>{% if user.participation_rating %}{{ rating_number(user.participation_rating) }}{% endif %}</td>
{% endif %} {% endif %}
<td class="organization-column"> {% endblock %}
{% if user.organization %}
<span class="organization"><a href="{{ user.organization.get_absolute_url() }}">
{{- user.organization.short_name -}}
</a></span>
{% endif %}
</td>
<td class="fullname-column" style="display: none;"> {% block user_footer %}
{% if user.user.first_name %} {% if user.user.first_name %}
<span class="fullname"> <div style="color: gray; font-weight: 600; display: none" class="fullname">
{{ user.user.first_name }} {{ user.user.first_name if user.user.first_name else ''}}
</span> </div>
{% endif %}
{% if user.organization %}
<div class="organization" style="display: none"><a style="color: gray; font-weight: 600" href="{{ user.organization.get_absolute_url() }}">
{{- user.organization.short_name -}}
</a></div>
{% endif %} {% endif %}
</td>
{% endblock %} {% endblock %}
{% block user_data %} {% block user_data %}
{% if user.participation.virtual %} {% if user.participation.virtual %}
<sup style="color:grey">[{{user.participation.virtual}}]</sup> <sub style="color:grey">[{{user.participation.virtual}}]</sub>
{% endif %} {% endif %}
{% if can_edit %} {% if can_edit %}
<span class="contest-participation-operation"> <span class="contest-participation-operation">

View file

@ -19,7 +19,7 @@
<tr id="user-{{ user.user.username }}" {% block row_extra scoped %}{% endblock %}> <tr id="user-{{ user.user.username }}" {% block row_extra scoped %}{% endblock %}>
<td class="rank-td">{{ rank }}</td> <td class="rank-td">{{ rank }}</td>
{% block after_rank scoped %}{% endblock %} {% block after_rank scoped %}{% endblock %}
<td class="user-name">{{ link_user(user) }} {% block user_data scoped %}{% endblock %}</td> <td class="user-name"><div style="display: inline-block;">{{ link_user(user) }}{% block user_footer scoped %}{% endblock %}</div> {% block user_data scoped %}{% endblock %}</td>
{% block before_point scoped %}{% endblock %} {% block before_point scoped %}{% endblock %}
{% block point scoped %} {% block point scoped %}
<td title="{{ user.performance_points|floatformat(2) }}" class="user-points"> <td title="{{ user.performance_points|floatformat(2) }}" class="user-points">