Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gab-social
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
gab
social
gab-social
Commits
780512ef
Commit
780512ef
authored
Aug 29, 2019
by
Rob Colbert
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of
https://code.gab.com/gab/social/gab-social
into develop
parents
fda449bf
f21f2651
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
47 additions
and
3 deletions
+47
-3
app/controllers/admin/accounts_controller.rb
app/controllers/admin/accounts_controller.rb
+26
-1
app/services/fetch_link_card_service.rb
app/services/fetch_link_card_service.rb
+1
-1
app/views/admin/accounts/edit.html.haml
app/views/admin/accounts/edit.html.haml
+12
-0
app/views/admin/accounts/show.html.haml
app/views/admin/accounts/show.html.haml
+3
-0
config/locales/en.yml
config/locales/en.yml
+4
-0
config/routes.rb
config/routes.rb
+1
-1
No files found.
app/controllers/admin/accounts_controller.rb
View file @
780512ef
...
...
@@ -2,7 +2,7 @@
module
Admin
class
AccountsController
<
BaseController
before_action
:set_account
,
only:
[
:show
,
:subscribe
,
:unsubscribe
,
:redownload
,
:remove_avatar
,
:remove_header
,
:enable
,
:unsilence
,
:unsuspend
,
:memorialize
,
:approve
,
:reject
,
:verify
,
:unverify
,
:add_donor_badge
,
:remove_donor_badge
,
:add_investor_badge
,
:remove_investor_badge
,
:edit_pro
,
:save_pro
]
before_action
:set_account
,
only:
[
:show
,
:subscribe
,
:unsubscribe
,
:redownload
,
:remove_avatar
,
:remove_header
,
:enable
,
:unsilence
,
:unsuspend
,
:memorialize
,
:approve
,
:reject
,
:verify
,
:unverify
,
:add_donor_badge
,
:remove_donor_badge
,
:add_investor_badge
,
:remove_investor_badge
,
:edit_pro
,
:save_pro
,
:edit
,
:update
]
before_action
:require_remote_account!
,
only:
[
:subscribe
,
:unsubscribe
,
:redownload
]
before_action
:require_local_account!
,
only:
[
:enable
,
:memorialize
,
:approve
,
:reject
]
...
...
@@ -173,6 +173,22 @@ module Admin
redirect_to
edit_pro_admin_account_path
(
@account
.
id
)
end
def
edit
redirect_to
admin_account_path
(
@account
.
id
)
unless
@account
.
local?
@user
=
@account
.
user
end
def
update
redirect_to
admin_account_path
(
@account
.
id
)
unless
@account
.
local?
@user
=
@account
.
user
if
@user
.
update
(
credentials_params
)
redirect_to
admin_account_path
(
@account
.
id
),
notice:
I18n
.
t
(
'generic.changes_saved_msg'
)
else
render
action: :edit
end
end
private
def
set_account
...
...
@@ -211,5 +227,14 @@ module Admin
def
pro_params
params
.
require
(
:account
).
permit
(
:is_pro
,
:pro_expires_at
)
end
def
credentials_params
new_params
=
params
.
require
(
:user
).
permit
(
:email
,
:password
,
:password_confirmation
)
if
new_params
[
:password
].
blank?
&&
new_params
[
:password_confirmation
].
blank?
new_params
.
delete
(
:password
)
new_params
.
delete
(
:password_confirmation
)
end
new_params
end
end
end
app/services/fetch_link_card_service.rb
View file @
780512ef
...
...
@@ -187,6 +187,6 @@ class FetchLinkCardService < BaseService
def
send_status_update_payload
(
status
)
@payload
=
InlineRenderer
.
render
(
status
,
nil
,
:status
)
@payload
=
Oj
.
dump
(
event: :update
,
payload:
@payload
)
Redis
.
current
.
publish
(
'statuscard'
,
@payload
)
Redis
.
current
.
publish
(
"statuscard:
#{
status
.
account_id
}
"
,
@payload
)
end
end
app/views/admin/accounts/edit.html.haml
0 → 100644
View file @
780512ef
-
content_for
:page_title
do
=
t
(
'admin.accounts.change_password.title'
,
username:
@account
.
acct
)
=
simple_form_for
(
@user
,
url:
admin_account_path
(
@account
.
id
),
html:
{
method: :put
})
do
|
f
|
=
render
'shared/error_messages'
,
object:
@user
=
f
.
input
:email
,
placeholder:
t
(
'simple_form.labels.defaults.email'
),
input_html:
{
'aria-label'
=>
t
(
'simple_form.labels.defaults.email'
)
}
=
f
.
input
:password
,
autocomplete:
"off"
,
placeholder:
t
(
'simple_form.labels.defaults.new_password'
),
input_html:
{
'aria-label'
=>
t
(
'simple_form.labels.defaults.new_password'
)
}
=
f
.
input
:password_confirmation
,
autocomplete:
"off"
,
placeholder:
t
(
'simple_form.labels.defaults.confirm_new_password'
),
input_html:
{
'aria-label'
=>
t
(
'simple_form.labels.defaults.confirm_new_password'
)
}
.actions
=
f
.
button
:button
,
t
(
'admin.accounts.set_new_password'
),
type: :submit
\ No newline at end of file
app/views/admin/accounts/show.html.haml
View file @
780512ef
...
...
@@ -221,6 +221,9 @@
-
elsif
!
@account
.
local?
||
@account
.
user_approved?
=
link_to
t
(
'admin.accounts.perform_full_suspension'
),
new_admin_account_action_path
(
@account
.
id
,
type:
'suspend'
),
class:
'button button--destructive'
if
can?
(
:suspend
,
@account
)
-
if
@account
.
local?
=
link_to
t
(
'admin.accounts.change_password.button'
),
edit_admin_account_path
(
@account
.
id
),
class:
'button'
-
unless
@account
.
local?
-
if
DomainBlock
.
where
(
domain:
@account
.
domain
).
exists?
=
link_to
t
(
'admin.domain_blocks.undo'
),
admin_instance_path
(
@account
.
domain
),
class:
'button'
...
...
config/locales/en.yml
View file @
780512ef
...
...
@@ -92,6 +92,10 @@ en:
new_email
:
New email
submit
:
Change email
title
:
Change email for %{username}
change_password
:
button
:
Change Password
title
:
Change password for %{username}
set_new_password
:
Update
confirm
:
Confirm
confirmed
:
Confirmed
confirming
:
Confirming
...
...
config/routes.rb
View file @
780512ef
...
...
@@ -182,7 +182,7 @@ Rails.application.routes.draw do
resources
:report_notes
,
only:
[
:create
,
:destroy
]
resources
:accounts
,
only:
[
:index
,
:show
]
do
resources
:accounts
,
only:
[
:index
,
:show
,
:edit
,
:update
]
do
member
do
post
:subscribe
post
:unsubscribe
...
...
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