docbrown/app/views/organizations/_sidebar_additional.html.erb
Dan Wallis 521bb09394
Add loading=lazy to image tags (#10888)
* Add loading=lazy to image tags

* Fix test

* Lazy-load some obvious templates

* Lazy-load more verified templates
2021-05-27 19:01:21 +02:00

30 lines
1.2 KiB
Text

<div id="sidebar-wrapper-right" class="sidebar-wrapper sidebar-wrapper-right">
<div class="sidebar-bg" id="sidebar-bg-right"></div>
<div class="side-bar sidebar-additional showing" id="sidebar-additional">
<% @organization.sponsorships.live.find_each do |sponsorship| %>
<div class="sidebar-sponsorship-level">
<%= sponsorship.level.capitalize %> Community Sponsor ❤️
</div>
<% end %>
<%# given the probability that organizations can have lots of users,
here we're using the any?/find_each pattern to avoid loading possibly
too many objects in memory %>
<% if @organization.users.any? %>
<div class="widget">
<div class="widget-suggested-follows-container">
<header><h4>meet the team</h4></header>
<div class="widget-body">
<% @organization.users.find_each do |user| %>
<div class="widget-user-pic">
<a href="/<%= user.username %>">
<img src="<%= Images::Profile.call(user.profile_image_url, length: 90) %>" alt="<%= user.username %> profile image" loading="lazy" />
</a>
</div>
<% end %>
</div>
</div>
</div>
<% end %>
</div>
</div>