Add lazy loading img and fix friend ranking
This commit is contained in:
parent
4a2bc46206
commit
86815fb460
10 changed files with 11 additions and 11 deletions
|
@ -1018,7 +1018,7 @@ def base_contest_ranking_list(contest, problems, queryset, show_final=False):
|
|||
|
||||
|
||||
def contest_ranking_list(contest, problems, queryset=None, show_final=False):
|
||||
if not queryset:
|
||||
if queryset is None:
|
||||
queryset = contest.users.filter(virtual=0)
|
||||
|
||||
if not show_final:
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
{% with authors=post.get_authors() %}
|
||||
{%- if authors -%}
|
||||
<span class="user-img" style="width: 1.5em; height: 1.5em">
|
||||
<img src="{{gravatar(authors[0])}}">
|
||||
<img src="{{gravatar(authors[0])}}" loading="lazy">
|
||||
</span>
|
||||
<span class="post-authors">{{ link_users(authors) }}</span>
|
||||
{%- endif -%}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<li class="message" id="message-{{ message.id }}" message-id="{{ message.id }}">
|
||||
<a href="{{ url('user_page', message.author.username) }}">
|
||||
<img src="{{ gravatar(message.author, 135) }}" class="profile-pic user-img">
|
||||
<img loading="lazy" src="{{ gravatar(message.author, 135) }}" class="profile-pic user-img">
|
||||
</a>
|
||||
<div class="body-message">
|
||||
<div class="user-time">
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<li class="status-row" id="lobby_row">
|
||||
<div class="status-container">
|
||||
<img src="{{ static('icons/icon.svg') }}" style="height:32px">
|
||||
<img loading="lazy" src="{{ static('icons/icon.svg') }}" style="height:32px">
|
||||
</div>
|
||||
<span style="padding-left:0.5em">
|
||||
<b>{{_('Lobby')}}</b>
|
||||
|
@ -23,7 +23,7 @@
|
|||
{% for user in section.user_list %}
|
||||
<li class="click_space status-row" id="click_space_{{user.user.id}}" value="{{user.url}}">
|
||||
<div class="status-container">
|
||||
<img src="{{ gravatar(user.user, 135) }}" class="status-pic user-img">
|
||||
<img loading="lazy" src="{{ gravatar(user.user, 135) }}" class="status-pic user-img">
|
||||
<svg style="position:absolute;" height="32" width="32">
|
||||
<circle class="status-circle" fill="{{'green' if user.is_online else 'red'}}"/>
|
||||
</svg>
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
{% for course in courses %}
|
||||
<div class="course-item">
|
||||
<div class="course-image">
|
||||
<img src="{{course.image_url}}">
|
||||
<img loading="lazy" src="{{course.image_url}}">
|
||||
</div>
|
||||
<div class="course-content">
|
||||
<a href="{{url('course_detail', course.slug)}}" class="course-name">{{course.name}}</a>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{% set can_view = submission.is_accessible_by(profile) %}
|
||||
<div class="sub-user-img user-img">
|
||||
<img src="{{gravatar(submission.user)}}">
|
||||
<img loading="lazy" src="{{gravatar(submission.user)}}">
|
||||
</div>
|
||||
<div class="sub-details">
|
||||
<div class="sub-info{% if submission.status == 'G' %} sub-info-grading{% endif %}">
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<div class="header">
|
||||
<div class="info">
|
||||
<a class="user-container" href="{{ url('user_page', message.user.user.username) }}" class="user">
|
||||
<img src="{{ gravatar(message.user, 135) }}" class="gravatar">
|
||||
<img loading="lazy" src="{{ gravatar(message.user, 135) }}" class="gravatar">
|
||||
<span class="username {{ message.user.css_class }}">{{ message.user.user.username }}</span>
|
||||
</a>
|
||||
</div>
|
||||
|
|
|
@ -162,7 +162,7 @@
|
|||
<section class="message new-message">
|
||||
<div class="info">
|
||||
<a href="{{ url('user_page', request.user.username) }}" class="user">
|
||||
<img src="{{ gravatar(request.profile, 135) }}" class="gravatar">
|
||||
<img loading="lazy" src="{{ gravatar(request.profile, 135) }}" class="gravatar">
|
||||
<div class="username {{ request.profile.css_class }}">{{ request.user.username }}</div>
|
||||
</a>
|
||||
</div>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<span class="{{ profile.css_class }} {{'user-with-img' if show_image}}">
|
||||
{% if show_image %}
|
||||
<span class="user-img">
|
||||
<img src="{{gravatar(profile)}}">
|
||||
<img loading="lazy" src="{{gravatar(profile)}}">
|
||||
</span>
|
||||
{% endif %}
|
||||
<a href="{{ url('user_page', profile.username) }}">
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
{% endblock %}
|
||||
|
||||
{% block after_rank %}
|
||||
<td><img style="border: 2px solid lightblue; max-width: none;" class="user-img" src="{{ gravatar(user, 45) }}" height="45px" width="45px"></td>
|
||||
<td><img loading="lazy" style="border: 2px solid lightblue; max-width: none;" class="user-img" src="{{ gravatar(user, 45) }}" height="45px" width="45px"></td>
|
||||
{% endblock %}
|
||||
|
||||
{% block user_footer %}
|
||||
|
|
Loading…
Reference in a new issue