Skip to content

Commit

Permalink
Indentation changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ddnexus committed Jun 19, 2024
1 parent 5e14bd6 commit 3f470ff
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions gem/lib/pagy/frontend.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,12 @@ def pagy_nav(pagy, id: nil, aria_label: nil, **vars)
def pagy_info(pagy, id: nil, item_name: nil)
id = %( id="#{id}") if id
p_count = pagy.count
key = if p_count.zero? then 'pagy.info.no_items'
elsif pagy.pages == 1 then 'pagy.info.single_page'
else 'pagy.info.multiple_pages' # rubocop:disable Lint/ElseLayout
key = if p_count.zero?
'pagy.info.no_items'
elsif pagy.pages == 1
'pagy.info.single_page'
else
'pagy.info.multiple_pages'
end

%(<span#{id} class="pagy info">#{
Expand All @@ -51,7 +54,7 @@ def pagy_info(pagy, id: nil, item_name: nil)
}</span>)
end

# Return a performance optimized lambda to generate the HtML anchor element (a tag)
# Return a performance optimized lambda to generate the HTML anchor element (a tag)
# Benchmarked on a 20 link nav: it is ~22x faster and uses ~18x less memory than rails' link_to
def pagy_anchor(pagy)
a_string = pagy.vars[:anchor_string]
Expand Down

0 comments on commit 3f470ff

Please sign in to comment.