Fix rubocop issues, introduce usage of frozen literal to improve performance
This commit is contained in:
parent
a91c3ef6ce
commit
fdc17bea58
96 changed files with 329 additions and 126 deletions
|
@ -1,2 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module AboutHelper
|
||||
end
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module AccountsHelper
|
||||
def pagination_options
|
||||
{
|
||||
previous_label: "#{fa_icon('chevron-left')} Prev".html_safe,
|
||||
next_label: "Next #{fa_icon('chevron-right')}".html_safe,
|
||||
previous_label: safe_join([fa_icon('chevron-left'), 'Prev'], ' '),
|
||||
next_label: safe_join(['Next', fa_icon('chevron-right')], ' '),
|
||||
inner_window: 1,
|
||||
outer_window: 0
|
||||
outer_window: 0,
|
||||
}
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module ApplicationHelper
|
||||
def active_nav_class(path)
|
||||
current_page?(path) ? 'active' : ''
|
||||
|
|
|
@ -1,6 +1,12 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module AtomBuilderHelper
|
||||
def stream_updated_at
|
||||
@account.stream_entries.last ? (@account.updated_at > @account.stream_entries.last.created_at ? @account.updated_at : @account.stream_entries.last.created_at) : @account.updated_at
|
||||
if @account.stream_entries.last
|
||||
(@account.updated_at > @account.stream_entries.last.created_at ? @account.updated_at : @account.stream_entries.last.created_at)
|
||||
else
|
||||
@account.updated_at
|
||||
end
|
||||
end
|
||||
|
||||
def entry(xml, is_root = false, &block)
|
||||
|
@ -98,7 +104,7 @@ module AtomBuilderHelper
|
|||
end
|
||||
|
||||
def in_reply_to(xml, uri, url)
|
||||
xml['thr'].send('in-reply-to', { ref: uri, href: url, type: 'text/html' })
|
||||
xml['thr'].send('in-reply-to', ref: uri, href: url, type: 'text/html')
|
||||
end
|
||||
|
||||
def link_mention(xml, account)
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module HomeHelper
|
||||
def default_props
|
||||
{
|
||||
token: @token,
|
||||
account: render(file: 'api/v1/accounts/show', locals: { account: current_user.account }, formats: :json)
|
||||
account: render(file: 'api/v1/accounts/show', locals: { account: current_user.account }, formats: :json),
|
||||
}
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module RoutingHelper
|
||||
extend ActiveSupport::Concern
|
||||
include Rails.application.routes.url_helpers
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module StreamEntriesHelper
|
||||
def display_name(account)
|
||||
account.display_name.blank? ? account.username : account.display_name
|
||||
|
|
|
@ -1,2 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module TagsHelper
|
||||
end
|
||||
|
|
|
@ -1,2 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module XrdHelper
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue