Commit 87d710f5 authored by Robert Speicher's avatar Robert Speicher

Merge branch 'grzesiek/gitlab-ce-fix/non-member-notification-button'

parents ba41b2ba f9cd0639
...@@ -9,6 +9,7 @@ v 8.2.0 (unreleased) ...@@ -9,6 +9,7 @@ v 8.2.0 (unreleased)
v 8.1.0 (unreleased) v 8.1.0 (unreleased)
- Send an email to admin email when a user is reported for spam (Jonathan Rochkind) - Send an email to admin email when a user is reported for spam (Jonathan Rochkind)
- Show notifications button when user is member of group rather than project (Grzegorz Bizon)
- Fix bug preventing mentioned issued from being closed when MR is merged using fast-forward merge. - Fix bug preventing mentioned issued from being closed when MR is merged using fast-forward merge.
- Fix nonatomic database update potentially causing project star counts to go negative (Stan Hu) - Fix nonatomic database update potentially causing project star counts to go negative (Stan Hu)
- Fix error preventing displaying of commit data for a directory with a leading dot (Stan Hu) - Fix error preventing displaying of commit data for a directory with a leading dot (Stan Hu)
......
...@@ -101,7 +101,7 @@ class ProjectsController < ApplicationController ...@@ -101,7 +101,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)
end end
render :show render :show
......
- return unless @membership - case @membership
- when ProjectMember
= 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_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)
= form_tag profile_notifications_path, method: :put, remote: true, class: 'inline', id: 'notification-form' do - when GroupMember
= hidden_field_tag :notification_type, 'project' .btn.btn-new.disabled.has_tooltip{title: "To change the notification level, you need to be a member of the project itself, not only its group."}
= hidden_field_tag :notification_id, @membership.id = icon('bell')
= hidden_field_tag :notification_level = notification_label(@membership)
%span.dropdown = icon('angle-down')
%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)
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
type: 'button', | type: 'button', |
class: "btn #{ 'active' if default_clone_protocol == 'ssh' }#{ ' has_tooltip' if current_user && current_user.require_ssh_key? }", | class: "btn #{ 'active' if default_clone_protocol == 'ssh' }#{ ' has_tooltip' if current_user && current_user.require_ssh_key? }", |
:"data-clone" => project.ssh_url_to_repo, | :"data-clone" => project.ssh_url_to_repo, |
:"data-title" => "Add an SSH key to your profile<br> to pull or push via SSH", :"data-title" => "Add an SSH key to your profile<br> to pull or push via SSH.",
:"data-html" => "true", :"data-html" => "true",
:"data-container" => "body"} :"data-container" => "body"}
SSH SSH
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
type: 'button', | type: 'button', |
class: "btn #{ 'active' if default_clone_protocol == 'http' }#{ ' has_tooltip' if current_user && current_user.require_password? }", | class: "btn #{ 'active' if default_clone_protocol == 'http' }#{ ' has_tooltip' if current_user && current_user.require_password? }", |
:"data-clone" => project.http_url_to_repo, | :"data-clone" => project.http_url_to_repo, |
:"data-title" => "Set a password on your account<br> to pull or push via #{gitlab_config.protocol.upcase}", :"data-title" => "Set a password on your account<br> to pull or push via #{gitlab_config.protocol.upcase}.",
:"data-html" => "true", :"data-html" => "true",
:"data-container" => "body"} :"data-container" => "body"}
= gitlab_config.protocol.upcase = gitlab_config.protocol.upcase
......
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