Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Respect the "hide" flag of page_layouts. #223

Merged
merged 1 commit into from

2 participants

@pascalj

This fixes #222. Simply skip elements that have a "hide" flag.

@tvdeyen tvdeyen merged commit 6b431de into AlchemyCMS:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 6, 2012
  1. @pascalj
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 0 deletions.
  1. +1 −0  lib/alchemy/page_layout.rb
  2. +4 −0 spec/page_layout_spec.rb
View
1  lib/alchemy/page_layout.rb
@@ -67,6 +67,7 @@ def self.get_layouts_for_select(language_id, layoutpage = false)
def self.selectable_layouts(language_id, layoutpage = false)
get_layouts.select do |layout|
+ next if layout["hide"]
used = layout["unique"] && has_a_page_this_layout?(layout["name"], language_id)
if layoutpage
layout["layoutpage"] == true && !used
View
4 spec/page_layout_spec.rb
@@ -27,5 +27,9 @@
end
end
+
+ it "should not display hidden page layouts" do
+ Alchemy::PageLayout.selectable_layouts(Factory(:language)).each { |e| e["hide"].should_not == true }
+ end
end
Something went wrong with that request. Please try again.