diff options
author | Grzegorz Bizon <grzegorz.bizon@ntsn.pl> | 2015-10-12 12:07:31 +0200 |
---|---|---|
committer | Grzegorz Bizon <grzegorz.bizon@ntsn.pl> | 2015-10-12 12:07:31 +0200 |
commit | b8f5e7427f7cbcdb19dcc5554301e87a880cfe2a (patch) | |
tree | 9d2bb7a0dfd74eb0522607126b9f2d03b6289d06 /app/views/projects/buttons | |
parent | 5ffbf5feb7577ec3affc32992c79cddca3036c4d (diff) | |
download | gitlab-ce-b8f5e7427f7cbcdb19dcc5554301e87a880cfe2a.tar.gz |
Show notifications button even if user is not member of a project
Notifications button was unavailable if user wasn't member of the
project, even if protected project is available via group privileges.
Showing disabled button with explanation tool-tip is less confusing.
This closes #2846.
Diffstat (limited to 'app/views/projects/buttons')
-rw-r--r-- | app/views/projects/buttons/_notifications.html.haml | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/app/views/projects/buttons/_notifications.html.haml b/app/views/projects/buttons/_notifications.html.haml index 4b69a6d7a6f..501a51d0e8a 100644 --- a/app/views/projects/buttons/_notifications.html.haml +++ b/app/views/projects/buttons/_notifications.html.haml @@ -1,14 +1,21 @@ -- return unless @membership +- return unless [@membership, @group_member].any? -= form_tag profile_notifications_path, method: :put, remote: true, class: 'inline-form', id: 'notification-form' do - = hidden_field_tag :notification_type, 'project' - = hidden_field_tag :notification_id, @membership.id - = hidden_field_tag :notification_level - %span.dropdown - %a.dropdown-new.btn.btn-new#notifications-button{href: '#', "data-toggle" => "dropdown"} - = icon('bell') - = notification_label(@membership) - = icon('angle-down') - %ul.dropdown-menu.dropdown-menu-right.project-home-dropdown - - Notification.project_notification_levels.each do |level| - = notification_list_item(level, @membership) +- if @membership + = form_tag profile_notifications_path, method: :put, remote: true, class: 'inline-form', id: 'notification-form' do + = hidden_field_tag :notification_type, 'project' + = hidden_field_tag :notification_id, @membership.id + = hidden_field_tag :notification_level + %span.dropdown + %a.dropdown-new.btn.btn-new#notifications-button{href: '#', "data-toggle" => "dropdown"} + = icon('bell') + = notification_label(@membership) + = icon('angle-down') + %ul.dropdown-menu.dropdown-menu-right.project-home-dropdown + - Notification.project_notification_levels.each do |level| + = notification_list_item(level, @membership) + +- elsif @group_member + .btn.btn-new.disabled#notifications-button + = icon('bell') + = notification_label(@group_member) + = icon('angle-down') |