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
b4ee4c56
Commit
b4ee4c56
authored
Nov 19, 2020
by
sfang97
Committed by
serenafang
Dec 02, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Send user email on rejection
Start building out email sending and admin views
parent
f8dcbdd1
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
44 additions
and
1 deletion
+44
-1
app/mailers/devise_mailer.rb
app/mailers/devise_mailer.rb
+4
-0
app/mailers/previews/devise_mailer_preview.rb
app/mailers/previews/devise_mailer_preview.rb
+4
-0
app/views/admin/users/_reject_user.html.haml
app/views/admin/users/_reject_user.html.haml
+8
-0
app/views/admin/users/_user_reject_effects.html.haml
app/views/admin/users/_user_reject_effects.html.haml
+10
-0
app/views/admin/users/show.html.haml
app/views/admin/users/show.html.haml
+1
-1
app/views/devise/mailer/user_admin_rejection.html.haml
app/views/devise/mailer/user_admin_rejection.html.haml
+6
-0
app/views/devise/mailer/user_admin_rejection.text.erb
app/views/devise/mailer/user_admin_rejection.text.erb
+6
-0
config/locales/devise.en.yml
config/locales/devise.en.yml
+2
-0
locale/gitlab.pot
locale/gitlab.pot
+3
-0
No files found.
app/mailers/devise_mailer.rb
View file @
b4ee4c56
...
@@ -17,6 +17,10 @@ class DeviseMailer < Devise::Mailer
...
@@ -17,6 +17,10 @@ class DeviseMailer < Devise::Mailer
devise_mail
(
record
,
:user_admin_approval
,
opts
)
devise_mail
(
record
,
:user_admin_approval
,
opts
)
end
end
def
user_admin_rejection
(
record
,
opts
=
{})
devise_mail
(
record
,
:user_admin_rejection
,
opts
)
end
protected
protected
def
subject_for
(
key
)
def
subject_for
(
key
)
...
...
app/mailers/previews/devise_mailer_preview.rb
View file @
b4ee4c56
...
@@ -28,6 +28,10 @@ class DeviseMailerPreview < ActionMailer::Preview
...
@@ -28,6 +28,10 @@ class DeviseMailerPreview < ActionMailer::Preview
DeviseMailer
.
user_admin_approval
(
unsaved_user
,
{})
DeviseMailer
.
user_admin_approval
(
unsaved_user
,
{})
end
end
def
user_admin_rejection
DeviseMailer
.
user_admin_rejection
(
unsaved_user
,
{})
end
private
private
def
unsaved_user
def
unsaved_user
...
...
app/views/admin/users/_reject_user.html.haml
0 → 100644
View file @
b4ee4c56
.card.border-danger
.card-header.bg-danger.gl-text-white
=
s_
(
'AdminUsers|This user has requested access'
)
.card-body
=
render
partial:
'admin/users/user_reject_effects'
%br
=
link_to
s_
(
'AdminUsers|Reject request'
),
approve_admin_user_path
(
user
),
method: :put
,
class:
"btn delete-user-button gl-button btn-danger"
,
data:
{
delete:
s_
(
'AdminUsers|Are you sure?'
)
}
app/views/admin/users/_user_reject_effects.html.haml
0 → 100644
View file @
b4ee4c56
%p
=
s_
(
'AdminUsers|If you reject the user:'
)
%ul
%li
=
s_
(
'AdminUsers|The user can not sign in or access instance information.'
)
%li
=
s_
(
'AdminUsers|The user will be deleted.'
)
%p
-
link_start
=
'<a href="%{url}">'
.
html_safe
%
{
url:
help_page_path
(
"user/profile/account/delete_account"
,
anchor:
"associated-records"
)
}
=
_
(
'For more information, please refer to the %{link_start}user account deletion documentation.%{link_end}'
).
html_safe
%
{
link_start:
link_start
,
link_end:
'</a>'
.
html_safe
}
app/views/admin/users/show.html.haml
View file @
b4ee4c56
...
@@ -172,7 +172,7 @@
...
@@ -172,7 +172,7 @@
-
if
@user
.
blocked?
-
if
@user
.
blocked?
-
if
@user
.
blocked_pending_approval?
-
if
@user
.
blocked_pending_approval?
=
render
'admin/users/approve_user'
,
user:
@user
=
render
'admin/users/approve_user'
,
user:
@user
=
render
'admin/users/
block
_user'
,
user:
@user
=
render
'admin/users/
reject
_user'
,
user:
@user
-
else
-
else
.card.border-info
.card.border-info
.card-header.gl-bg-blue-500.gl-text-white
.card-header.gl-bg-blue-500.gl-text-white
...
...
app/views/devise/mailer/user_admin_rejection.html.haml
0 → 100644
View file @
b4ee4c56
=
email_default_heading
(
say_hi
(
@resource
))
%p
=
_
(
'Your request to join host fix this has been rejected.'
)
%p
=
_
(
'Please contact your GitLab administrator if you think this is an error.'
)
app/views/devise/mailer/user_admin_rejection.text.erb
0 → 100644
View file @
b4ee4c56
<%=
say_hi
(
@resource
)
%>
<%=
_
(
'Your request to join host fix this has been rejected.'
)
%>
<%=
_
(
'Please contact your GitLab administrator if you think this is an error.'
)
%>
config/locales/devise.en.yml
View file @
b4ee4c56
...
@@ -32,6 +32,8 @@ en:
...
@@ -32,6 +32,8 @@ en:
subject
:
"
Password
changed
by
administrator"
subject
:
"
Password
changed
by
administrator"
user_admin_approval
:
user_admin_approval
:
subject
:
"
Welcome
to
GitLab!"
subject
:
"
Welcome
to
GitLab!"
user_admin_rejection
:
subject
:
"
GitLab
account
request
rejected"
omniauth_callbacks
:
omniauth_callbacks
:
failure
:
"
Could
not
authenticate
you
from
%{kind}
because
\"
%{reason}
\"
."
failure
:
"
Could
not
authenticate
you
from
%{kind}
because
\"
%{reason}
\"
."
success
:
"
Successfully
authenticated
from
%{kind}
account."
success
:
"
Successfully
authenticated
from
%{kind}
account."
...
...
locale/gitlab.pot
View file @
b4ee4c56
...
@@ -20325,6 +20325,9 @@ msgstr ""
...
@@ -20325,6 +20325,9 @@ msgstr ""
msgid "Please complete your profile with email address"
msgid "Please complete your profile with email address"
msgstr ""
msgstr ""
msgid "Please contact your GitLab administrator if you think this is an error."
msgstr ""
msgid "Please contact your administrator with any questions."
msgid "Please contact your administrator with any questions."
msgstr ""
msgstr ""
...
...
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