Sha256: 5b89aa2491e60e5164f9110e33f91e70e05c643634b7d4d63d6c2dc2d7656b64

Contents?: true

Size: 1.03 KB

Versions: 4

Compression:

Stored size: 1.03 KB

Contents

<% if Typus.quick_sidebar %>
  <h2><%= @resource.typus_application %></h2>

  <ul>
    <% resources.each do |resource, actions| %>
      <% klass = resource.constantize %>
      <li>
        <%= link_to klass.model_name.human.pluralize, :controller => "/admin/#{klass.to_resource}" %>
        <small>
          <%= link_to Typus::I18n.t("Add New"), :controller => "/admin/#{klass.to_resource}", :action => "new" %>
        </small>
      </li>
    <% end %>
  </ul>
<% else %>
  <div id="sidebar">

    <% resources.each do |resource, actions| %>

      <% klass = resource.constantize %>

      <ul>

        <%= link_to :controller => "/admin/#{klass.to_resource}" do %>
          <li class="header"><%= klass.model_name.human.pluralize %></li>
        <% end %>

        <% if @resource.model_name.eql?(resource) %>
          <ul>
            <% actions.each do |action| %>
              <li><%= link_to action[:message], action[:url] %></li>
            <% end %>
          </ul>
        <% end %>

      </ul>

    <% end %>

  </div>
<% end %>

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
typus-3.1.0.rc18 app/views/helpers/admin/resources/_sidebar.html.erb
typus-3.1.0.rc17 app/views/helpers/admin/resources/_sidebar.html.erb
typus-3.1.0.rc16 app/views/helpers/admin/resources/_sidebar.html.erb
typus-3.1.0.rc15 app/views/helpers/admin/resources/_sidebar.html.erb