Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mastodon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pierre Boudes
mastodon
Commits
04582e3c
Commit
04582e3c
authored
5 years ago
by
Takeshi Umeda
Committed by
Eugen Rochko
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Remove some duplicate methods from StatusHelper and reflect changes to AccountHelper (#12545)
parent
f43f1e01
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/helpers/accounts_helper.rb
+2
-0
2 additions, 0 deletions
app/helpers/accounts_helper.rb
app/helpers/statuses_helper.rb
+0
-68
0 additions, 68 deletions
app/helpers/statuses_helper.rb
with
2 additions
and
68 deletions
app/helpers/accounts_helper.rb
+
2
−
0
View file @
04582e3c
...
...
@@ -62,6 +62,8 @@ module AccountsHelper
def
account_badge
(
account
,
all:
false
)
if
account
.
bot?
content_tag
(
:div
,
content_tag
(
:div
,
t
(
'accounts.roles.bot'
),
class:
'account-role bot'
),
class:
'roles'
)
elsif
account
.
group?
content_tag
(
:div
,
content_tag
(
:div
,
t
(
'accounts.roles.group'
),
class:
'account-role group'
),
class:
'roles'
)
elsif
(
Setting
.
show_staff_badge
&&
account
.
user_staff?
)
||
all
content_tag
(
:div
,
class:
'roles'
)
do
if
all
&&
!
account
.
user_staff?
...
...
This diff is collapsed.
Click to expand it.
app/helpers/statuses_helper.rb
+
0
−
68
View file @
04582e3c
...
...
@@ -4,74 +4,6 @@ module StatusesHelper
EMBEDDED_CONTROLLER
=
'statuses'
EMBEDDED_ACTION
=
'embed'
def
account_action_button
(
account
)
if
user_signed_in?
if
account
.
id
==
current_user
.
account_id
link_to
settings_profile_url
,
class:
'button logo-button'
do
safe_join
([
svg_logo
,
t
(
'settings.edit_profile'
)])
end
elsif
current_account
.
following?
(
account
)
||
current_account
.
requested?
(
account
)
link_to
account_unfollow_path
(
account
),
class:
'button logo-button button--destructive'
,
data:
{
method: :post
}
do
safe_join
([
svg_logo
,
t
(
'accounts.unfollow'
)])
end
elsif
!
(
account
.
memorial?
||
account
.
moved?
)
link_to
account_follow_path
(
account
),
class:
"button logo-button
#{
account
.
blocking?
(
current_account
)
?
' disabled'
:
''
}
"
,
data:
{
method: :post
}
do
safe_join
([
svg_logo
,
t
(
'accounts.follow'
)])
end
end
elsif
!
(
account
.
memorial?
||
account
.
moved?
)
link_to
account_remote_follow_path
(
account
),
class:
'button logo-button modal-button'
,
target:
'_new'
do
safe_join
([
svg_logo
,
t
(
'accounts.follow'
)])
end
end
end
def
minimal_account_action_button
(
account
)
if
user_signed_in?
return
if
account
.
id
==
current_user
.
account_id
if
current_account
.
following?
(
account
)
||
current_account
.
requested?
(
account
)
link_to
account_unfollow_path
(
account
),
class:
'icon-button active'
,
data:
{
method: :post
},
title:
t
(
'accounts.unfollow'
)
do
fa_icon
(
'user-times fw'
)
end
elsif
!
(
account
.
memorial?
||
account
.
moved?
)
link_to
account_follow_path
(
account
),
class:
"icon-button
#{
account
.
blocking?
(
current_account
)
?
' disabled'
:
''
}
"
,
data:
{
method: :post
},
title:
t
(
'accounts.follow'
)
do
fa_icon
(
'user-plus fw'
)
end
end
elsif
!
(
account
.
memorial?
||
account
.
moved?
)
link_to
account_remote_follow_path
(
account
),
class:
'icon-button modal-button'
,
target:
'_new'
,
title:
t
(
'accounts.follow'
)
do
fa_icon
(
'user-plus fw'
)
end
end
end
def
svg_logo
content_tag
(
:svg
,
tag
(
:use
,
'xlink:href'
=>
'#mastodon-svg-logo'
),
'viewBox'
=>
'0 0 216.4144 232.00976'
)
end
def
svg_logo_full
content_tag
(
:svg
,
tag
(
:use
,
'xlink:href'
=>
'#mastodon-svg-logo-full'
),
'viewBox'
=>
'0 0 713.35878 175.8678'
)
end
def
account_badge
(
account
,
all:
false
)
if
account
.
bot?
content_tag
(
:div
,
content_tag
(
:div
,
t
(
'accounts.roles.bot'
),
class:
'account-role bot'
),
class:
'roles'
)
elsif
account
.
group?
content_tag
(
:div
,
content_tag
(
:div
,
t
(
'accounts.roles.group'
),
class:
'account-role group'
),
class:
'roles'
)
elsif
(
Setting
.
show_staff_badge
&&
account
.
user_staff?
)
||
all
content_tag
(
:div
,
class:
'roles'
)
do
if
all
&&
!
account
.
user_staff?
content_tag
(
:div
,
t
(
'admin.accounts.roles.user'
),
class:
'account-role'
)
elsif
account
.
user_admin?
content_tag
(
:div
,
t
(
'accounts.roles.admin'
),
class:
'account-role admin'
)
elsif
account
.
user_moderator?
content_tag
(
:div
,
t
(
'accounts.roles.moderator'
),
class:
'account-role moderator'
)
end
end
end
end
def
link_to_more
(
url
)
link_to
t
(
'statuses.show_more'
),
url
,
class:
'load-more load-gap'
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment