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
Boxiang Sun
gitlab-ce
Commits
99b8568f
Commit
99b8568f
authored
Oct 18, 2015
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Find correct group membership.
parent
5c4bb6df
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
8 deletions
+6
-8
app/controllers/projects_controller.rb
app/controllers/projects_controller.rb
+1
-2
app/views/projects/buttons/_notifications.html.haml
app/views/projects/buttons/_notifications.html.haml
+5
-6
No files found.
app/controllers/projects_controller.rb
View file @
99b8568f
...
@@ -87,8 +87,7 @@ class ProjectsController < ApplicationController
...
@@ -87,8 +87,7 @@ class ProjectsController < ApplicationController
render
'projects/empty'
render
'projects/empty'
else
else
if
current_user
if
current_user
@membership
=
@project
.
project_member_by_id
(
current_user
.
id
)
@membership
=
@project
.
team
.
find_member
(
current_user
.
id
)
@group_member
=
GroupMember
.
find_by
(
user_id:
current_user
.
id
)
end
end
render
:show
render
:show
...
...
app/views/projects/buttons/_notifications.html.haml
View file @
99b8568f
-
return
unless
[
@membership
,
@group_member
].
any?
-
case
@membership
-
when
ProjectMember
-
if
@membership
=
form_tag
profile_notifications_path
,
method: :put
,
remote:
true
,
class:
'inline'
,
id:
'notification-form'
do
=
form_tag
profile_notifications_path
,
method: :put
,
remote:
true
,
class:
'inline'
,
id:
'notification-form'
do
=
hidden_field_tag
:notification_type
,
'project'
=
hidden_field_tag
:notification_type
,
'project'
=
hidden_field_tag
:notification_id
,
@membership
.
id
=
hidden_field_tag
:notification_id
,
@membership
.
id
...
@@ -14,8 +13,8 @@
...
@@ -14,8 +13,8 @@
-
Notification
.
project_notification_levels
.
each
do
|
level
|
-
Notification
.
project_notification_levels
.
each
do
|
level
|
=
notification_list_item
(
level
,
@membership
)
=
notification_list_item
(
level
,
@membership
)
-
elsif
@group_m
ember
-
when
GroupM
ember
.btn.btn-new.disabled
#notifications-button
.btn.btn-new.disabled
=
icon
(
'bell'
)
=
icon
(
'bell'
)
=
notification_label
(
@
group_member
)
=
notification_label
(
@
membership
)
=
icon
(
'angle-down'
)
=
icon
(
'angle-down'
)
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