* Refactoring to add helper method Prior to this commit, we made view level calls to service modules. This refactor provides convenience methods on the model. Furthermore, it addresses a few Rubocop violations that "come along for the ride." * Ensuring cached entity squaks like User * Fixing broken spec * Fixing typo
30 lines
1.3 KiB
Text
30 lines
1.3 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">
|
|
<%= t("views.organizations.sponsor.text", level: t("views.organizations.sponsor.level.#{sponsorship.level}")) %>
|
|
</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><%= t("views.organizations.team") %></h4></header>
|
|
<div class="widget-body">
|
|
<% @organization.users.find_each do |user| %>
|
|
<div class="widget-user-pic">
|
|
<a href="/<%= user.username %>">
|
|
<img src="<%= user.profile_image_url_for(length: 90) %>" alt="<%= user.username %> profile image" loading="lazy" />
|
|
</a>
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
</div>
|