Class: TagSidebar
Instance Method Summary
collapse
Methods inherited from Sidebar
#admin_state, apply_staging_on_active!, #content_partial, description, #description, #display_name, display_name, #fieldmap, #fields, #html_id, ordered_sidebars, #parse_request, path_name, #publish, purge, setting, short_name, #short_name, #to_locals_hash
Instance Method Details
#font_multiplier ⇒ Object
25
26
27
|
# File 'app/models/tag_sidebar.rb', line 25
def font_multiplier
80
end
|
#sizes ⇒ Object
14
15
16
17
18
19
20
21
22
23
|
# File 'app/models/tag_sidebar.rb', line 14
def sizes
return @sizes if @sizes
total = tags.reduce(0) { |sum, tag| sum + tag.content_counter }
average = total.to_f / @tags.size
@sizes = tags.reduce({}) do |h, tag|
size = tag.content_counter.to_f / average
h.merge tag => [[2.0 / 3.0, size].max, 2].min * 100
end
end
|