Files
nairobi/app/views/shared/_author_info.html.erb
Javi Martín 517f74a748 Extract component to render an initialjs avatar
This way it'll be easier to change it.
2023-10-10 15:03:35 +02:00

32 lines
994 B
Plaintext

<% if resource.author.hidden? || resource.author.erased? %>
<span class="icon-deleted author-deleted"></span>
<span class="author deleted">
<%= t("shared.author_info.author_deleted") %>
</span>
<% else %>
<%= render Shared::AvatarComponent.new(resource.author, size: 32, class: "author-photo") %>
<span class="author">
<%= link_to resource.author.name, user_path(resource.author) %>
</span>
<% if resource.respond_to?(:association_name) && resource.association_name.present? %>
<span>
<%= "(#{resource.association_name})" %>
</span>
<% end %>
<% if resource.author.display_official_position_badge? %>
&nbsp;&bull;&nbsp;
<span class="label round level-<%= resource.author.official_level %>">
<%= resource.author.official_position %>
</span>
<% end %>
<% end %>
<% if resource.author.verified_organization? %>
&nbsp;&bull;&nbsp;
<span class="label round is-association">
<%= t("shared.collective") %>
</span>
<% end %>