summaryrefslogtreecommitdiff
path: root/app/views/projects/_projects_top_menu.html.haml
blob: f80f28a8bbbb693432f88a181fe70ab545a26ea8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
%div.top_project_menu
  %span= link_to 'All', projects_path, :class => current_page?(projects_path) ? "current" : nil
  - if current_user.can_create_project?
    %span= link_to "New Project", new_project_path, :class => current_page?(:controller => "projects", :action => "new") ? "current" : nil
  %span.right
    = link_to_function(image_tag("list_view_icon.jpg"), "switchProjectView()", :style => "border:none;box-shadow:none;")

:javascript
  function switchProjectView(){
    $(".tile").toggle();
    $(".list").toggle();
    if($(".tile").is(":visible")){
      $.cookie('project_view', 'tile', { expires: 14 });
    } else { 
      $.cookie('project_view', 'list', { expires: 14 });
    }
  }