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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
3b98830f
Commit
3b98830f
authored
Aug 08, 2014
by
Jan-Willem van der Meer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Give Admin email an interface
parent
7776d4d0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
1 deletion
+42
-1
app/controllers/admin/emails_controller.rb
app/controllers/admin/emails_controller.rb
+0
-1
app/helpers/admin_email_helper.rb
app/helpers/admin_email_helper.rb
+19
-0
app/views/admin/emails/show.html.haml
app/views/admin/emails/show.html.haml
+23
-0
No files found.
app/controllers/admin/emails_controller.rb
View file @
3b98830f
class
Admin::EmailsController
<
Admin
::
ApplicationController
def
show
render
text:
'hello world'
end
end
app/helpers/admin_email_helper.rb
0 → 100644
View file @
3b98830f
module
AdminEmailHelper
def
admin_email_grouped_recipient_options
options_for_select
([[
'Everyone'
,
'all'
]])
+
grouped_options_for_select
(
'Groups'
=>
Group
.
pluck
(
:name
,
:id
).
map
{
|
name
,
id
|
[
name
,
"group_
#{
id
}
"
]
},
'Projects'
=>
grouped_project_list
)
end
protected
def
grouped_project_list
Group
.
includes
(
:projects
).
flat_map
do
|
group
|
group
.
human_name
group
.
projects
.
map
do
|
project
|
[
"
#{
group
.
human_name
}
/
#{
project
.
name
}
"
,
"project_
#{
project
.
id
}
"
]
end
end
end
end
\ No newline at end of file
app/views/admin/emails/show.html.haml
0 → 100644
View file @
3b98830f
%h3
.page-title
Send email notication
%p
.light
You can notify the app / group or a project by sending them an email notification
=
form_tag
admin_email_path
,
class:
'form-horizontal'
do
.form-group
%label
.control-label
{
for: :subject
}
Subject
.col-sm-10
=
text_field_tag
:subject
,
''
,
class:
'form-control'
.form-group
%label
.control-label
{
for: :body
}
Body
.col-sm-10
=
text_area_tag
:body
,
''
,
class:
'form-control'
,
rows:
15
.form-group
%label
.control-label
{
for: :recipients
}
Recipients
.col-sm-10
=
select_tag
:recipients
,
admin_email_grouped_recipient_options
,
class: :select2
.form-actions
=
submit_tag
'Send message'
,
class:
'btn btn-create'
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