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;
}
#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 {
color: white;
}

View file

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

View file

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

View file

@ -19,7 +19,7 @@
<tr id="user-{{ user.user.username }}" {% block row_extra scoped %}{% endblock %}>
<td class="rank-td">{{ rank }}</td>
{% 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 point scoped %}
<td title="{{ user.performance_points|floatformat(2) }}" class="user-points">