%ul.nav.nav-sidebar
  = nav_link(path: 'groups#show', html_options: {class: 'home'}) do
    = link_to group_path(@group), title: 'Home', data: {placement: 'right'} do
      = icon('dashboard fw')
      %span
        Activity
  - if current_user
    = nav_link(controller: [:group, :milestones]) do
      = link_to group_milestones_path(@group), title: 'Milestones', data: {placement: 'right'} do
        = icon('clock-o fw')
        %span
          Milestones
  = nav_link(path: 'groups#issues') do
    = link_to issues_group_path(@group), title: 'Issues', data: {placement: 'right'} do
      = icon('exclamation-circle fw')
      %span
        Issues
        - if current_user
          %span.count= Issue.opened.of_group(@group).count
  = nav_link(path: 'groups#merge_requests') do
    = link_to merge_requests_group_path(@group), title: 'Merge Requests', data: {placement: 'right'} do
      = icon('tasks fw')
      %span
        Merge Requests
        - if current_user
          %span.count= MergeRequest.opened.of_group(@group).count
  = nav_link(controller: [:group_members]) do
    = link_to group_group_members_path(@group), title: 'Members', data: {placement: 'right'} do
      = icon('users fw')
      %span
        Members

  - if can?(current_user, :admin_group, @group)
    = nav_link(html_options: { class: "#{"active" if group_settings_page?} separate-item" }) do
      = link_to edit_group_path(@group), title: 'Settings', class: 'tab no-highlight', data: {placement: 'right'} do
        = icon ('cogs fw')
        %span
          Settings
          = icon ('angle-down fw')

  - if group_settings_page?
    %ul.sidebar-subnav
      = nav_link(path: 'groups#edit') do
        = link_to edit_group_path(@group), title: 'Group', data: {placement: 'right'} do
          = icon('pencil-square-o')
          %span
            Group
      = nav_link(path: 'groups#projects') do
        = link_to projects_group_path(@group), title: 'Projects', data: {placement: 'right'} do
          = icon('folder')
          %span
            Projects

