AlchemyCMS/alchemy_cms

View on GitHub
app/views/alchemy/admin/dashboard/widgets/_sites.html.erb

Summary

Maintainability
Test Coverage
<div class="widget sites">
  <table class="list">
    <tr>
      <th colspan="2"><%= Alchemy::Site.model_name.human(count: 2) %></th>
    </tr>
    <% @sites.each do |site| %>
    <tr class="<%= cycle('even', 'odd', name: 'sites') %>">
      <td>
        <% if alchemy.respond_to?(:login_url) %>
          <%= link_to_unless site == Alchemy::Current.site,
            site.name,
            alchemy.login_url(
              protocol: 'http://',
              host: site.host,
              user: {login: current_alchemy_user.try(:login)}
            ), target: '_blank' %>
        <% else %>
          <%= site.name %>
        <% end %>
      </td>
      <td><small><%= site.host %></small></td>
    </tr>
    <% end %>
  </table>
</div>