Commit b8225324 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Hide group sidebar menu if user cant access it

parent 66840f03
...@@ -12,34 +12,35 @@ ...@@ -12,34 +12,35 @@
= icon('dashboard fw') = icon('dashboard fw')
%span %span
Group Group
- if current_user - if can?(current_user, :read_group, @group)
= nav_link(controller: [:group, :milestones]) do - if current_user
= link_to group_milestones_path(@group), title: 'Milestones', data: {placement: 'right'} do = nav_link(controller: [:group, :milestones]) do
= icon('clock-o fw') = 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 %span
Milestones Issues
= nav_link(path: 'groups#issues') do - if current_user
= link_to issues_group_path(@group), title: 'Issues', data: {placement: 'right'} do %span.count= Issue.opened.of_group(@group).count
= icon('exclamation-circle fw') = nav_link(path: 'groups#merge_requests') do
%span = link_to merge_requests_group_path(@group), title: 'Merge Requests', data: {placement: 'right'} do
Issues = icon('tasks fw')
- if current_user %span
%span.count= Issue.opened.of_group(@group).count Merge Requests
= nav_link(path: 'groups#merge_requests') do - if current_user
= link_to merge_requests_group_path(@group), title: 'Merge Requests', data: {placement: 'right'} do %span.count= MergeRequest.opened.of_group(@group).count
= icon('tasks fw') = nav_link(controller: [:group_members]) do
%span = link_to group_group_members_path(@group), title: 'Members', data: {placement: 'right'} do
Merge Requests = icon('users fw')
- 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: "separate-item" }) do
= link_to edit_group_path(@group), title: 'Settings', data: {placement: 'right'} do
= icon ('cogs fw')
%span %span
Settings Members
- if can?(current_user, :admin_group, @group)
= nav_link(html_options: { class: "separate-item" }) do
= link_to edit_group_path(@group), title: 'Settings', data: {placement: 'right'} do
= icon ('cogs fw')
%span
Settings
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment