Class: Decidim::Votings::ContentBlocks::HighlightedVotingsCell
- Inherits:
-
Decidim::ViewModel
- Object
- Decidim::ViewModel
- Decidim::Votings::ContentBlocks::HighlightedVotingsCell
- Defined in:
- decidim-elections/app/cells/decidim/votings/content_blocks/highlighted_votings_cell.rb
Instance Method Summary collapse
- #decidim_votings ⇒ Object
- #highlighted_votings ⇒ Object
- #i18n_scope ⇒ Object
- #max_results ⇒ Object
- #show ⇒ Object
Instance Method Details
#decidim_votings ⇒ Object
27 28 29 |
# File 'decidim-elections/app/cells/decidim/votings/content_blocks/highlighted_votings_cell.rb', line 27 def decidim_votings Decidim::Votings::Engine.routes.url_helpers end |
#highlighted_votings ⇒ Object
17 18 19 20 21 |
# File 'decidim-elections/app/cells/decidim/votings/content_blocks/highlighted_votings_cell.rb', line 17 def highlighted_votings OrganizationPrioritizedVotings.new(current_organization, current_user) .query .limit(max_results) end |
#i18n_scope ⇒ Object
23 24 25 |
# File 'decidim-elections/app/cells/decidim/votings/content_blocks/highlighted_votings_cell.rb', line 23 def i18n_scope "decidim.votings.pages.home.highlighted_votings" end |
#max_results ⇒ Object
13 14 15 |
# File 'decidim-elections/app/cells/decidim/votings/content_blocks/highlighted_votings_cell.rb', line 13 def max_results model.settings.max_results end |
#show ⇒ Object
9 10 11 |
# File 'decidim-elections/app/cells/decidim/votings/content_blocks/highlighted_votings_cell.rb', line 9 def show render if highlighted_votings.any? end |