Class: Decidim::DecidimAwesome::ContentBlocks::AwesomeProcessesFormCell
- Inherits:
-
ViewModel
- Object
- ViewModel
- Decidim::DecidimAwesome::ContentBlocks::AwesomeProcessesFormCell
- Defined in:
- app/cells/decidim/decidim_awesome/content_blocks/awesome_processes_form_cell.rb
Instance Method Summary collapse
- #content_block ⇒ Object
- #i18n_scope ⇒ Object
- #process_group_options ⇒ Object
- #process_status_options ⇒ Object
- #process_type_options ⇒ Object
- #processes_for_select ⇒ Object
- #selection_criteria_options ⇒ Object
Instance Method Details
#content_block ⇒ Object
9 10 11 |
# File 'app/cells/decidim/decidim_awesome/content_blocks/awesome_processes_form_cell.rb', line 9 def content_block [:content_block] end |
#i18n_scope ⇒ Object
13 14 15 |
# File 'app/cells/decidim/decidim_awesome/content_blocks/awesome_processes_form_cell.rb', line 13 def i18n_scope "decidim.decidim_awesome.content_blocks.awesome_processes" end |
#process_group_options ⇒ Object
25 26 27 28 29 |
# File 'app/cells/decidim/decidim_awesome/content_blocks/awesome_processes_form_cell.rb', line 25 def groups = Decidim::ParticipatoryProcessGroup.where(organization: current_organization) [[t("any_group", scope: i18n_scope), 0]] + groups.map { |group| [translated_attribute(group.title), group.id] } end |
#process_status_options ⇒ Object
31 32 33 34 35 36 37 38 |
# File 'app/cells/decidim/decidim_awesome/content_blocks/awesome_processes_form_cell.rb', line 31 def [ [t("process_statuses.active", scope: i18n_scope), "active"], [t("process_statuses.all", scope: i18n_scope), "all"], [t("process_statuses.upcoming", scope: i18n_scope), "upcoming"], [t("process_statuses.past", scope: i18n_scope), "past"] ] end |
#process_type_options ⇒ Object
17 18 19 20 21 22 23 |
# File 'app/cells/decidim/decidim_awesome/content_blocks/awesome_processes_form_cell.rb', line 17 def [ [t("process_types.all", scope: i18n_scope), "all"], [t("process_types.processes", scope: i18n_scope), "processes"], [t("process_types.groups", scope: i18n_scope), "groups"] ] end |
#processes_for_select ⇒ Object
47 48 49 |
# File 'app/cells/decidim/decidim_awesome/content_blocks/awesome_processes_form_cell.rb', line 47 def processes_for_select reorder_by_saved_selection() end |
#selection_criteria_options ⇒ Object
40 41 42 43 44 45 |
# File 'app/cells/decidim/decidim_awesome/content_blocks/awesome_processes_form_cell.rb', line 40 def [ [t("selection_criteria_options.automatic", scope: i18n_scope), "automatic"], [t("selection_criteria_options.manual", scope: i18n_scope), "manual"] ] end |