Sha256: f710a254b7ffe9b6534edb3c76e63b54cbe4d89523d7f40c9f9dcd7c2622a895

Contents?: true

Size: 1.17 KB

Versions: 4

Compression:

Stored size: 1.17 KB

Contents

<!-- Applications list with models. -->

<%
  page_title = Typus::I18n.t("Applications")
%>

<%
  applications = admin_user.applications

  # Detect if we are inside an application.
  if (application = params[:application])
    applications.each do |app|
      if app.parameterize == application
        applications = [app]
      end
    end
    page_title = applications.first
  end
%>

<h2><%= page_title %></h2>

<% if applications.any? %>
  <% applications.each do |app| %>

    <table style="margin-bottom: 1em;">

      <% table_header = application ? "Models" : app %>

      <thead>
        <tr>
          <th><%= Typus::I18n.t(table_header) %></th>
        </tr>
      </thead>

      <% admin_user.application(app).map { |i| i.constantize }.each do |klass| %>
        <% if klass.typus_options_for(:hide_from_dashboard) == false %>
          <tr class="<%= cycle("even", "odd") %>">
            <td>
              <%= link_to klass.model_name.human.pluralize, :controller => "/admin/#{klass.to_resource}" %>
            </td>
          </tr>
        <% end %>
      <% end %>

    </table>

  <% end %>
<% else %>
  <div class="notice">
    No applications detected.
  </div>
<% end %>

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
typus-3.1.2 app/views/admin/dashboard/widgets/_applications.html.erb
typus-3.1.1 app/views/admin/dashboard/widgets/_applications.html.erb
typus-3.1.0 app/views/admin/dashboard/widgets/_applications.html.erb
typus-3.1.0.rc19 app/views/admin/dashboard/widgets/_applications.html.erb