-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add extra menu * safe split * add specs * fix specs * fix secrets file
- Loading branch information
1 parent
09cc537
commit 34fcaba
Showing
9 changed files
with
171 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<% | ||
components = participatory_space.components.published.or(Decidim::Component.where(id: self.try(:current_component))) | ||
items = components.map do |component| | ||
{ | ||
name: translated_attribute(component.name), | ||
url: main_component_path(component), | ||
active: is_active_link?(main_component_path(component), :inclusive) | ||
} | ||
end | ||
|
||
model, slug = ENV.fetch("EXTRA_ASSEMBLY_MENU_#{current_participatory_space.slug.upcase}", "").split("/") | ||
klass = model&.safe_constantize | ||
if klass | ||
space = klass.find_by(slug: slug) | ||
if space | ||
link = resource_locator(space).path | ||
items << { | ||
name: translated_attribute(space.title), | ||
url: link, | ||
active: is_active_link?(link, :inclusive) | ||
} | ||
end | ||
end | ||
%> | ||
<%= | ||
extended_navigation_bar(([ | ||
{ | ||
name: t(".assembly_menu_item"), | ||
url: decidim_assemblies.assembly_path(current_participatory_space), | ||
active: is_active_link?(decidim_assemblies.assembly_path(current_participatory_space), :exclusive) | ||
}, | ||
participatory_space.members.not_ceased.any? ? { | ||
name: t(".assembly_member_menu_item"), | ||
url: decidim_assemblies.assembly_assembly_members_path(current_participatory_space), | ||
active: is_active_link?(decidim_assemblies.assembly_assembly_members_path(current_participatory_space), :inclusive) | ||
} : nil | ||
] + items).compact) | ||
%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<% | ||
components = participatory_space.components.published.or(Decidim::Component.where(id: self.try(:current_component))) | ||
|
||
items = components.map do |component| | ||
{ | ||
name: translated_attribute(component.name), | ||
url: main_component_path(component), | ||
active: is_active_link?(main_component_path(component), :inclusive) | ||
} | ||
end | ||
|
||
model, slug = ENV.fetch("EXTRA_PROCESS_MENU_#{current_participatory_space.slug.upcase}", "").split("/") | ||
klass = model&.safe_constantize | ||
if klass | ||
space = klass.find_by(slug: slug) | ||
if space | ||
link = resource_locator(space).path | ||
items << { | ||
name: translated_attribute(space.title), | ||
url: link, | ||
active: is_active_link?(link, :inclusive) | ||
} | ||
end | ||
end | ||
%> | ||
<%= extended_navigation_bar([{ | ||
name: t(".process_menu_item"), | ||
url: decidim_participatory_processes.participatory_process_path(participatory_space), | ||
active: is_active_link?(decidim_participatory_processes.participatory_process_path(participatory_space), :exclusive) || | ||
is_active_link?(decidim_participatory_processes.all_metrics_participatory_process_path(participatory_space), :exclusive) | ||
}] + items) | ||
%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters