Sha256: 73451d8762b3485cc99fe3ff977fd651b2979a9b8afbf708813e774842336885

Contents?: true

Size: 1.96 KB

Versions: 10

Compression:

Stored size: 1.96 KB

Contents

<%

@nav = Caboose.plugin_hook('admin_nav', [], @user, @page)

initial_state = session[:caboose_station_state].nil?      ? 'min' : session[:caboose_station_state] 
open_tabs     = session[:caboose_station_open_tabs].nil?  ? []    : session[:caboose_station_open_tabs] 
return_url    = session[:caboose_station_return_url].nil? ? '/'   : session[:caboose_station_return_url]
return_url = '/' if return_url.starts_with?('/admin/') || return_url == '/admin'

style = ''
if (initial_state == 'left')
  style = " style='display: block; left: 0;'"
elsif (initial_state == 'right')
  style = " style='display: block; right: 0;'"
end

%>
<div id='caboose_station' class='state_<%= initial_state %>'<%= raw style %>>
  
  <% if (@user.nil? || @user.id == Caboose::User::LOGGED_OUT_USER_ID) %>
    <h2>Caboose Station</h2>
    <a href='/login' class='login'>Login</a>
  <% else %>
    <ul class='account'>        
      <li class='my_account'><a href='/users/<%= @user.id %>/edit'>My Account</a></li>
      <li class='logout'><a href='/logout'>Logout</a></li>
    </ul>
    <h2>Caboose Station</h2>
    <ul class='admin'>
      <% i = 0 %>
      <% @nav.each do |item| %>
        <% id = item['id'].nil? ? i.to_s : item['id'] %>
        <li id='nav_item_<%= id %>'><a href='#' class='top_level'><%= item['text'] %></a>
        <% if (!item['children'].nil? && item['children'].count > 0) %>
          <%
          visible = open_tabs.include?(id) || (!item['show_children_default'].nil? && item['show_children_default'])
          style = visible ? '' : " style='display: none;'"
          %>
          <ul id='subnav_<%= id %>' class='<%= visible ? 'visible' : 'hidden' %>'<%= raw style %>>
            <% item['children'].each do |item2| %>
              <li><a href='<%= item2['href'] %>'><%= item2['text'] %></a></li>
            <% end %>
          </ul>
        <% end %>
        </li>
        <% i + 1 %>
      <% end %>
    </ul>
    <a href='<%= return_url %>' class='close'>Close</a>
  <% end %>
  
</div>

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
caboose-cms-0.1.35 app/views/layouts/caboose/_station.html.erb
caboose-cms-0.1.34 app/views/layouts/caboose/_station.html.erb
caboose-cms-0.1.7 app/views/layouts/caboose/_station.html.erb
caboose-cms-0.1.6 app/views/layouts/caboose/_station.html.erb
caboose-cms-0.1.5 app/views/layouts/caboose/_station.html.erb
caboose-cms-0.1.4 app/views/layouts/caboose/_station.html.erb
caboose-cms-0.1.3 app/views/layouts/caboose/_station.html.erb
caboose-cms-0.1.2 app/views/layouts/caboose/_station.html.erb
caboose-cms-0.1.1 app/views/layouts/caboose/_station.html.erb
caboose-cms-0.1.0 app/views/layouts/caboose/_station.html.erb