Class: Decidim::ParticipatoryProcesses::Menu
- Inherits:
-
Object
- Object
- Decidim::ParticipatoryProcesses::Menu
- Defined in:
- lib/decidim/participatory_processes/menu.rb
Class Method Summary collapse
- .register_admin_menu_modules! ⇒ Object
- .register_admin_participatory_process_components_menu! ⇒ Object
- .register_admin_participatory_process_group_menu! ⇒ Object
- .register_admin_participatory_process_menu! ⇒ Object
- .register_admin_participatory_processes_manage_menu! ⇒ Object
- .register_admin_participatory_processes_menu! ⇒ Object
- .register_home_content_block_menu! ⇒ Object
- .register_menu! ⇒ Object
- .register_mobile_menu! ⇒ Object
- .register_participatory_process_admin_attachments_menu! ⇒ Object
Class Method Details
.register_admin_menu_modules! ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/decidim/participatory_processes/menu.rb', line 39 def self. Decidim. :admin_menu_modules do || .add_item :participatory_processes, I18n.t("menu.participatory_processes", scope: "decidim.admin"), decidim_admin_participatory_processes.participatory_processes_path, icon_name: "treasure-map-line", position: 2, active: is_active_link?(decidim_admin_participatory_processes.participatory_processes_path, :inclusive) || is_active_link?(decidim_admin_participatory_processes.participatory_process_groups_path, :inclusive) || is_active_link?(decidim_admin_participatory_processes.participatory_process_types_path), if: allowed_to?(:enter, :space_area, space_name: :processes) || allowed_to?(:enter, :space_area, space_name: :process_groups) end end |
.register_admin_participatory_process_components_menu! ⇒ Object
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
# File 'lib/decidim/participatory_processes/menu.rb', line 91 def self. Decidim. :admin_participatory_process_components_menu do || current_participatory_space.components.each do |component| = decidim_escape_translated(component.name) += content_tag(:span, component.primary_stat, class: "component-counter") if component.primary_stat.present? .add_item [component.manifest_name, component.id].join("_"), .html_safe, manage_component_path(component), active: is_active_link?(manage_component_path(component)) || is_active_link?(decidim_admin_participatory_processes.edit_component_path(current_participatory_space, component)) || is_active_link?(decidim_admin_participatory_processes.(current_participatory_space, component)) || participatory_space_active_link?(component), if: component.manifest.admin_engine && user_role_config.component_is_accessible?(component.manifest_name) end end end |
.register_admin_participatory_process_group_menu! ⇒ Object
179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 |
# File 'lib/decidim/participatory_processes/menu.rb', line 179 def self. Decidim. :admin_participatory_process_group_menu do || .add_item :edit_participatory_process_group, I18n.t("info", scope: "decidim.admin.menu.participatory_process_groups_submenu"), decidim_admin_participatory_processes.edit_participatory_process_group_path(participatory_process_group), position: 1, icon_name: "information-line", if: allowed_to?(:update, :process_group, process_group: participatory_process_group), active: is_active_link?(decidim_admin_participatory_processes.edit_participatory_process_group_path(participatory_process_group)) .add_item :edit_participatory_process_group_landing_page, I18n.t("landing_page", scope: "decidim.admin.menu.participatory_process_groups_submenu"), decidim_admin_participatory_processes.edit_participatory_process_group_landing_page_path(participatory_process_group), position: 2, icon_name: "layout-masonry-line", if: allowed_to?(:update, :process_group, process_group: participatory_process_group), active: is_active_link?(decidim_admin_participatory_processes.participatory_process_group_landing_page_path(participatory_process_group)) end end |
.register_admin_participatory_process_menu! ⇒ Object
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 |
# File 'lib/decidim/participatory_processes/menu.rb', line 109 def self. Decidim. :admin_participatory_process_menu do || .add_item :edit_participatory_process, I18n.t("info", scope: "decidim.admin.menu.participatory_processes_submenu"), decidim_admin_participatory_processes.edit_participatory_process_path(current_participatory_space), active: is_active_link?(decidim_admin_participatory_processes.edit_participatory_process_path(current_participatory_space)), icon_name: "information-line", if: allowed_to?(:update, :process, process: current_participatory_space) .add_item :edit_participatory_process_landing_page, I18n.t("landing_page", scope: "decidim.admin.menu.participatory_processes_submenu"), decidim_admin_participatory_processes.edit_participatory_process_landing_page_path(current_participatory_space), active: is_active_link?(decidim_admin_participatory_processes.participatory_process_landing_page_path(current_participatory_space)), icon_name: "layout-masonry-line", if: allowed_to?(:update, :process, process: current_participatory_space) .add_item :participatory_process_steps, I18n.t("steps", scope: "decidim.admin.menu.participatory_processes_submenu"), decidim_admin_participatory_processes.participatory_process_steps_path(current_participatory_space), active: is_active_link?(decidim_admin_participatory_processes.participatory_process_steps_path(current_participatory_space)), icon_name: "direction-line", if: allowed_to?(:read, :process_step) .add_item :components, I18n.t("components", scope: "decidim.admin.menu.participatory_processes_submenu"), decidim_admin_participatory_processes.components_path(current_participatory_space), active: is_active_link?(decidim_admin_participatory_processes.components_path(current_participatory_space), ["decidim/participatory_processes/admin/components", %w(index new edit)]), icon_name: "tools-line", if: allowed_to?(:read, :component), submenu: { target_menu: :admin_participatory_process_components_menu } .add_item :categories, I18n.t("categories", scope: "decidim.admin.menu.participatory_processes_submenu"), decidim_admin_participatory_processes.categories_path(current_participatory_space), active: is_active_link?(decidim_admin_participatory_processes.categories_path(current_participatory_space)), icon_name: "price-tag-3-line", if: allowed_to?(:read, :category) .add_item :attachments, I18n.t("attachments", scope: "decidim.admin.menu.participatory_processes_submenu"), decidim_admin_participatory_processes.(current_participatory_space), active: is_active_link?(decidim_admin_participatory_processes.(current_participatory_space)) || is_active_link?(decidim_admin_participatory_processes.(current_participatory_space)), icon_name: "attachment-2", if: allowed_to?(:read, :attachment_collection) || allowed_to?(:read, :attachment) .add_item :participatory_process_user_roles, I18n.t("process_admins", scope: "decidim.admin.menu.participatory_processes_submenu"), decidim_admin_participatory_processes.participatory_process_user_roles_path(current_participatory_space), active: is_active_link?(decidim_admin_participatory_processes.participatory_process_user_roles_path(current_participatory_space)), icon_name: "user-settings-line", if: allowed_to?(:read, :process_user_role) .add_item :participatory_space_private_users, I18n.t("private_users", scope: "decidim.admin.menu.participatory_processes_submenu"), decidim_admin_participatory_processes.participatory_space_private_users_path(current_participatory_space), active: is_active_link?(decidim_admin_participatory_processes.participatory_space_private_users_path(current_participatory_space)), icon_name: "spy-line", if: allowed_to?(:read, :space_private_user, current_participatory_space:) .add_item :moderations, I18n.t("moderations", scope: "decidim.admin.menu.participatory_processes_submenu"), decidim_admin_participatory_processes.moderations_path(current_participatory_space), active: is_active_link?(decidim_admin_participatory_processes.moderations_path(current_participatory_space)), icon_name: "flag-line", if: allowed_to?(:read, :moderation, current_participatory_space:) end end |
.register_admin_participatory_processes_manage_menu! ⇒ Object
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 |
# File 'lib/decidim/participatory_processes/menu.rb', line 198 def self. Decidim. :admin_participatory_processes_manage_menu do || .add_item :processes, I18n.t("menu.participatory_processes", scope: "decidim.admin"), decidim_admin_participatory_processes.participatory_processes_path, position: 1, icon_name: "treasure-map-line", if: allowed_to?(:read, :process_list), active: is_active_link?(decidim_admin_participatory_processes.participatory_processes_path) .add_item :import_process, I18n.t("actions.import_process", scope: "decidim.admin"), decidim_admin_participatory_processes.new_import_path, position: 2, icon_name: "upload-line", if: allowed_to?(:import, :process), active: is_active_link?(decidim_admin_participatory_processes.new_import_path) .add_item :participatory_process_types, I18n.t("menu.participatory_process_types", scope: "decidim.admin"), decidim_admin_participatory_processes.participatory_process_types_path, position: 3, icon_name: "price-tag-3-line", if: allowed_to?(:manage, :participatory_process_type), active: is_active_link?(decidim_admin_participatory_processes.participatory_process_types_path) end end |
.register_admin_participatory_processes_menu! ⇒ Object
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/decidim/participatory_processes/menu.rb', line 53 def self. Decidim. :admin_participatory_processes_menu do || .add_item :participatory_processes, I18n.t("menu.participatory_processes", scope: "decidim.admin"), decidim_admin_participatory_processes.participatory_processes_path, position: 1, icon_name: "home-8-line", if: allowed_to?(:enter, :space_area, space_name: :processes), active: is_active_link?(decidim_admin_participatory_processes.participatory_processes_path) .add_item :participatory_process_groups, I18n.t("menu.participatory_process_groups", scope: "decidim.admin"), decidim_admin_participatory_processes.participatory_process_groups_path, position: 2, icon_name: "home-8-line", if: allowed_to?(:enter, :space_area, space_name: :process_groups), active: is_active_link?(decidim_admin_participatory_processes.participatory_process_groups_path) end end |
.register_home_content_block_menu! ⇒ Object
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/decidim/participatory_processes/menu.rb', line 28 def self. Decidim. :home_content_block_menu do || .add_item :participatory_processes, I18n.t("menu.processes", scope: "decidim"), decidim_participatory_processes.participatory_processes_path, position: 10, if: Decidim::ParticipatoryProcess.where(organization: current_organization).published.any?, active: %r{^/process(es|_groups)} end end |
.register_menu! ⇒ Object
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/decidim/participatory_processes/menu.rb', line 6 def self. Decidim. :menu do || .add_item :participatory_processes, I18n.t("menu.processes", scope: "decidim"), decidim_participatory_processes.participatory_processes_path, position: 2, if: Decidim::ParticipatoryProcess.where(organization: current_organization).published.any?, active: %r{^/process(es|_groups)} end end |
.register_mobile_menu! ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/decidim/participatory_processes/menu.rb', line 17 def self. Decidim. :mobile_menu do || .add_item :participatory_processes, I18n.t("menu.processes", scope: "decidim"), decidim_participatory_processes.participatory_processes_path, position: 2, if: Decidim::ParticipatoryProcess.where(organization: current_organization).published.any?, active: %r{^/process(es|_groups)} end end |
.register_participatory_process_admin_attachments_menu! ⇒ Object
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/decidim/participatory_processes/menu.rb', line 73 def self. Decidim. :participatory_process_admin_attachments_menu do || .add_item :participatory_process_attachments, I18n.t("attachment_files", scope: "decidim.admin.menu.participatory_processes_submenu"), decidim_admin_participatory_processes.(current_participatory_space), active: is_active_link?(decidim_admin_participatory_processes.(current_participatory_space)), if: allowed_to?(:read, :attachment), icon_name: "attachment-line" .add_item :participatory_process_attachment_collections, I18n.t("attachment_collections", scope: "decidim.admin.menu.participatory_processes_submenu"), decidim_admin_participatory_processes.(current_participatory_space), active: is_active_link?(decidim_admin_participatory_processes.(current_participatory_space)), if: allowed_to?(:read, :attachment_collection), icon_name: "folder-line" end end |