Commit 84d74e83 authored by Marin Jankovski's avatar Marin Jankovski

Add an option for sending emails to all users.

parent 4374104c
......@@ -15,9 +15,18 @@ class @AdminEmailSelect
projects
$.when(project_result, group_result).done (projects, groups) ->
data = $.merge(groups[0], projects[0])
all = {id: "all"}
data = $.merge([all], groups[0], projects[0])
query.callback({ results: data})
id: (object) ->
if object.path_with_namespace
"project-#{object.id}"
else if object.path
"group-#{object.id}"
else
"all"
formatResult: (args...) =>
@formatResult(args...)
formatSelection: (args...) =>
......@@ -32,15 +41,22 @@ class @AdminEmailSelect
<div class='project-name'>#{object.name}</div>
<div class='project-path'>#{object.path_with_namespace}</div>
</div>"
else
else if object.path
"<div class='group-result'>
<div class='group-name'>#{object.name}</div>
<div class='group-path'>#{object.path}</div>
</div>"
else
"<div class='group-result'>
<div class='group-name'>All</div>
<div class='group-path'>All groups and projects</div>
</div>"
formatSelection: (object) ->
if object.path_with_namespace
"Project: #{object.name}"
else
else if object.path
"Group: #{object.name}"
else
"All groups and projects"
......@@ -8,6 +8,7 @@ class AdminEmailsWorker
end
private
def recipient_list(recipient_id)
case recipient_id
when 'all'
......
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