Sha256: 32eaffbdf2ceca8b432bb761f77b1f2f72eb0c97bb550dc81843e28f533c5617
Contents?: true
Size: 1.83 KB
Versions: 26
Compression:
Stored size: 1.83 KB
Contents
<% if current_user.projects.active.any? -%> <ul id="project-selection"> <li> <h1> <%= link_to current_project? ? project_path(current_project) : root_url do -%> <% if current_project? -%> <span><%= current_project.name %></span> <% else %> <span>Projects</span> <% end -%> <% if current_user.memberships.admin.any? || current_user.projects.active.any? -%> <img src="/images/arrow-down.png" alt="arrow down" /> <% end -%> <% end %> </h1> <ul> <% current_user.projects.active.each do |project| %> <li><%= link_to project.name, project_path(project) -%></li> <% end %> <% if current_user.memberships.admin.any? -%> <li> <%= link_to current_account? && current_user.admin_of?(current_account) ? new_project_path(current_account) : new_project_path(current_user.memberships.admin.first.account) do %> + Create a new project <% end %> </li> <% end -%> </ul> </li> </ul> <% end -%> <%= content_for :javascript do -%> <%= javascript_tag do %> $(function() { $('#project-selection h1 a').click(function() { var dropdownbutton = $('#project-selection h1 a'); var dropdownlist = $('#project-selection li ul'); if(dropdownbutton.hasClass("expanded")) { dropdownbutton.removeClass("expanded"); dropdownlist.removeClass("expanded"); } else { dropdownbutton.addClass("expanded"); dropdownlist.addClass("expanded"); } return false; }); $('html *').live('click', function() { if($(this).parents('.expanded').length == 0) { $('.expanded').removeClass('expanded'); } }); }); <% end %> <% end -%>
Version data entries
26 entries across 26 versions & 2 rubygems