Commit 99b8568f authored by Douwe Maan's avatar Douwe Maan

Find correct group membership.

parent 5c4bb6df
...@@ -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
......
- 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_member - when GroupMember
.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')
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