noesya/osuny

View on GitHub
app/views/admin/application/l10n/_widget.html.erb

Summary

Maintainability
Test Coverage
<%
small ||= false
%>
<% if about.available_languages.many? %>
  <%
    route_args =[:admin, about.becomes(about.class.base_class)]
  %>
  <%= osuny_panel t('localization.label'), small: small do %>
    <ul class="list-unstyled">
      <% about.available_languages.each do |language| %>
        <%
        label = language_name(language.iso_code)
        current = language.id == l10n.language_id
        %>
        <li>
          <%= osuny_published about.exists_in_language?(language) %>
          <%= link_to_unless current, label, [*route_args, lang: language.iso_code] %>
          <% if current %>
            <i class="fas fa-check"></i>
          <% end %>
        </li>
      <% end %>
      </tbody>
    </table>
  <% end %>
<% end %>