Sha256: ee1d4ea2dec56ac45f74986f452ac514325a36f6d5f9c5c8819d4759032b209e

Contents?: true

Size: 1.16 KB

Versions: 8

Compression:

Stored size: 1.16 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(&: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

8 entries across 8 versions & 1 rubygems

Version Path
typus-3.1.10 app/views/admin/dashboard/widgets/_applications.html.erb
typus-3.1.9 app/views/admin/dashboard/widgets/_applications.html.erb
typus-3.1.8 app/views/admin/dashboard/widgets/_applications.html.erb
typus-3.1.7 app/views/admin/dashboard/widgets/_applications.html.erb
typus-3.1.6 app/views/admin/dashboard/widgets/_applications.html.erb
typus-3.1.5 app/views/admin/dashboard/widgets/_applications.html.erb
typus-3.1.4 app/views/admin/dashboard/widgets/_applications.html.erb
typus-3.1.3 app/views/admin/dashboard/widgets/_applications.html.erb