Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
iv
gitlab-ce
Commits
1381b4f4
Commit
1381b4f4
authored
Jun 10, 2016
by
Connor Shea
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix displaying of project settings links the user cannot access.
parent
37be2007
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
48 deletions
+50
-48
app/views/layouts/nav/_project.html.haml
app/views/layouts/nav/_project.html.haml
+13
-12
app/views/layouts/nav/_project_settings.html.haml
app/views/layouts/nav/_project_settings.html.haml
+37
-36
No files found.
app/views/layouts/nav/_project.html.haml
View file @
1381b4f4
-
if
current_user
-
access
=
user_max_access_in_project
(
current_user
.
id
,
@project
)
-
can_edit
=
can?
(
current_user
,
:admin_project
,
@project
)
.controls
-
access
=
user_max_access_in_project
(
current_user
.
id
,
@project
)
-
can_edit
=
can?
(
current_user
,
:admin_project
,
@project
)
.dropdown.project-settings-dropdown
%a
.dropdown-new.btn.btn-default
#project-settings-button
{
href:
'#'
,
'data-toggle'
=>
'dropdown'
}
=
icon
(
'cog'
)
=
icon
(
'caret-down'
)
%ul
.dropdown-menu.dropdown-menu-align-right
=
render
'layouts/nav/project_settings'
%li
.divider
-
if
can_edit
%li
=
link_to
edit_project_path
(
@project
)
do
Edit Project
-
if
access
%li
=
link_to
leave_namespace_project_project_members_path
(
@project
.
namespace
,
@project
),
data:
{
confirm:
leave_project_message
(
@project
)
},
method: :delete
,
title:
'Leave project'
do
Leave Project
-
if
can_edit
||
access
%li
.divider
-
if
can_edit
%li
=
link_to
edit_project_path
(
@project
)
do
Edit Project
-
if
access
%li
=
link_to
leave_namespace_project_project_members_path
(
@project
.
namespace
,
@project
),
data:
{
confirm:
leave_project_message
(
@project
)
},
method: :delete
,
title:
'Leave project'
do
Leave Project
%div
{
class:
nav_control_class
}
%ul
.nav-links.scrolling-tabs
...
...
app/views/layouts/nav/_project_settings.html.haml
View file @
1381b4f4
-
access
=
user_max_access_in_project
(
current_user
.
id
,
@project
)
-
if
project_nav_tab?
:team
=
nav_link
(
controller:
[
:project_members
,
:teams
])
do
=
link_to
namespace_project_project_members_path
(
@project
.
namespace
,
@project
),
title:
'Members'
,
class:
'team-tab tab'
do
%span
Members
-
if
@project
.
allowed_to_share_with_group?
=
nav_link
(
controller: :group_links
)
do
=
link_to
namespace_project_group_links_path
(
@project
.
namespace
,
@project
),
title:
"Groups"
do
%span
Groups
=
nav_link
(
controller: :deploy_keys
)
do
=
link_to
namespace_project_deploy_keys_path
(
@project
.
namespace
,
@project
),
title:
'Deploy Keys'
do
%span
Deploy Keys
=
nav_link
(
controller: :hooks
)
do
=
link_to
namespace_project_hooks_path
(
@project
.
namespace
,
@project
),
title:
'Webhooks'
do
%span
Webhooks
=
nav_link
(
controller: :services
)
do
=
link_to
namespace_project_services_path
(
@project
.
namespace
,
@project
),
title:
'Services'
do
%span
Services
=
nav_link
(
controller: :protected_branches
)
do
=
link_to
namespace_project_protected_branches_path
(
@project
.
namespace
,
@project
),
title:
'Protected Branches'
do
%span
Protected Branches
-
if
@project
.
builds_enabled?
=
nav_link
(
controller: :runners
)
do
=
link_to
namespace_project_runners_path
(
@project
.
namespace
,
@project
),
title:
'Runners'
do
-
if
access
-
if
@project
.
allowed_to_share_with_group?
=
nav_link
(
controller: :group_links
)
do
=
link_to
namespace_project_group_links_path
(
@project
.
namespace
,
@project
),
title:
"Groups"
do
%span
Groups
=
nav_link
(
controller: :deploy_keys
)
do
=
link_to
namespace_project_deploy_keys_path
(
@project
.
namespace
,
@project
),
title:
'Deploy Keys'
do
%span
Runner
s
=
nav_link
(
controller: :
variable
s
)
do
=
link_to
namespace_project_
variables_path
(
@project
.
namespace
,
@project
),
title:
'Variable
s'
do
Deploy Key
s
=
nav_link
(
controller: :
hook
s
)
do
=
link_to
namespace_project_
hooks_path
(
@project
.
namespace
,
@project
),
title:
'Webhook
s'
do
%span
Variable
s
=
nav_link
(
controller: :
trigger
s
)
do
=
link_to
namespace_project_
triggers_path
(
@project
.
namespace
,
@project
),
title:
'Trigger
s'
do
Webhook
s
=
nav_link
(
controller: :
service
s
)
do
=
link_to
namespace_project_
services_path
(
@project
.
namespace
,
@project
),
title:
'Service
s'
do
%span
Trigger
s
=
nav_link
(
controller: :
badg
es
)
do
=
link_to
namespace_project_
badges_path
(
@project
.
namespace
,
@project
),
title:
'Badg
es'
do
Service
s
=
nav_link
(
controller: :
protected_branch
es
)
do
=
link_to
namespace_project_
protected_branches_path
(
@project
.
namespace
,
@project
),
title:
'Protected Branch
es'
do
%span
Badges
Protected Branches
-
if
@project
.
builds_enabled?
=
nav_link
(
controller: :runners
)
do
=
link_to
namespace_project_runners_path
(
@project
.
namespace
,
@project
),
title:
'Runners'
do
%span
Runners
=
nav_link
(
controller: :variables
)
do
=
link_to
namespace_project_variables_path
(
@project
.
namespace
,
@project
),
title:
'Variables'
do
%span
Variables
=
nav_link
(
controller: :triggers
)
do
=
link_to
namespace_project_triggers_path
(
@project
.
namespace
,
@project
),
title:
'Triggers'
do
%span
Triggers
=
nav_link
(
controller: :badges
)
do
=
link_to
namespace_project_badges_path
(
@project
.
namespace
,
@project
),
title:
'Badges'
do
%span
Badges
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment