Sha256: 01744d89b8357ba1eebcfbf939095559d178a7f3f49471808c99aab5d5785aea

Contents?: true

Size: 1.55 KB

Versions: 3

Compression:

Stored size: 1.55 KB

Contents

<% display = ['not_signed_in', 'always'] %>
<% if user_signed_in? -%>
  <% display = ['signed_in', 'always'] %>
<% end %>

<% Contour.menu_items.each do |menu_item| %>
  <% if display.include?(menu_item[:display]) and (menu_item[:condition].blank? or eval(menu_item[:condition])) %>
    <div style="float:<%= menu_item[:position] %>">
      <%= link_to_function (menu_item[:eval] ? eval(menu_item[:name]) : menu_item[:name]), "$('#menu_#{menu_item[:id]}').show();", :onmouseover => "$('#menu_#{menu_item[:id]}').show();" %>
      <div style="position:relative;">
        <div id="menu_<%= menu_item[:id] %>" class="menu_dropdown_<%= menu_item[:position_class] %>" style="display:none">
          <% menu_item[:links].each do |link| %>
            <% if link[:condition].blank? or eval(link[:condition]) %>
              <% if link[:html].blank? %>
                <div style="white-space:nowrap">
                  <%= link_to (link[:eval] ? eval(link[:name]) : link[:name].html_safe), eval(link[:path]), :class => 'noicon' %>
                </div>
              <% else %>
                <%= link[:eval] ? eval(link[:html]).html_safe : link[:html].html_safe %>
              <% end %>
            <% end %>
          <% end %>
        </div>
      </div>
    </div>
  <% end %>
<% end %>

<% ids = Contour.menu_items.select{|mi| display.include?(mi[:display])}.collect{|mi| mi[:id]} %>
<%= javascript_tag "hideOnMouseOut([#{ids.collect{|id| "'#menu_#{id}'"}.join(',')}]);" %>

<%= render :partial => 'contour/authentications/menu' unless user_signed_in? %>

<div style="clear:both"></div>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
contour-0.3.2 app/views/contour/layouts/_menu.html.erb
contour-0.3.1 app/views/contour/layouts/_menu.html.erb
contour-0.3.0 app/views/contour/layouts/_menu.html.erb