Class: Decidim::LikersListCell

Inherits:
ViewModel
  • Object
show all
Includes:
ApplicationHelper
Defined in:
app/cells/decidim/likers_list_cell.rb

Overview

This cell renders the list of likes.

Example:

cell("decidim/likers_list", my_component)

Constant Summary collapse

MAX_ITEMS_STACKED =
8

Constants included from AmendmentsHelper

AmendmentsHelper::TOTAL_STEPS

Instance Method Summary collapse

Methods included from ApplicationHelper

#add_body_classes, #cell, #edit_link, #extra_admin_link, #html_truncate, #layout_item_classes, #present, #prevent_timeout_seconds, #resolve_presenter_class, #text_initials

Methods included from CacheHelper

#cache

Methods included from AmendmentsHelper

#accept_and_reject_buttons_for, #action_button_card_for, #allowed_to_accept_and_reject?, #allowed_to_promote?, #amendments_enabled?, #amendments_form_field_for, #amendments_form_fields_label, #amendments_form_fields_value, #can_participate_in_restricted_space?, #can_react_to_emendation?, #current_step, #emendation_actions_for, #emendation_announcement_for, #promote_button_for, #render_emendation_body, #total_steps, #wizard_aside_back_url, #wizard_header_title

Methods included from RichTextEditorHelper

included, #text_editor_for

Methods included from ContextualHelpHelper

#floating_help

Methods included from DecidimFormHelper

#areas_for_select, #base_error_messages, #decidim_form_for, #decidim_form_slug_url, #editor_field_tag, #form_field_has_error?, #form_required_explanation, #name_with_locale, #tab_element_class_for, #translated_field_tag

Methods included from OmniauthHelper

#normalize_provider_name, #oauth_icon, #provider_name

Instance Method Details

#likers_countObject



23
24
25
# File 'app/cells/decidim/likers_list_cell.rb', line 23

def likers_count
  base_relation.count
end

#showObject



16
17
18
19
20
21
# File 'app/cells/decidim/likers_list_cell.rb', line 16

def show
  return render :empty if visible_likers.count.zero?
  return render :full if full_list?

  render
end