Inherit parent page layout & view templates #1581

Merged
merged 3 commits into from Apr 10, 2012

Projects

None yet

2 participants

@xyz
Contributor
xyz commented Apr 10, 2012

Page layout_template & view_template should be inherited from parent (if any).

@ugisozols
Member

It would be really nice if you could add some request specs for this.

@ugisozols ugisozols commented on an outdated diff Apr 10, 2012
.../refinery/admin/pages/_form_advanced_options.html.erb
@@ -36,7 +40,11 @@
<%= f.label :view_template, t('.view_template') %>
<%= refinery_help_tag t('.view_template_help') %>
</span>
- <%= f.select(:view_template, @valid_view_templates.map{|t| [t.titleize, t]}) %>
+ <% if @page.parent_id? %>
+ <%= f.select(:view_template, @valid_view_templates.map{|t| [t.titleize, t]}, {:selected => @page.parent.view_template } %>
@ugisozols
ugisozols Apr 10, 2012 Member

There's a missing ) at the end.

@xyz
Contributor
xyz commented Apr 10, 2012

Sorry, specs are beyond my reach at the moment.

@ugisozols ugisozols merged commit d5703c0 into refinery:master Apr 10, 2012
@ugisozols ugisozols added a commit that referenced this pull request Apr 10, 2012
@ugisozols ugisozols Add specs for #1581. 9804c0f
@ugisozols ugisozols added a commit that referenced this pull request Apr 10, 2012
@ugisozols ugisozols Add specs for #1581. 09becb0
@ugisozols ugisozols referenced this pull request Apr 10, 2012
Closed

Inherit parent layout #1580

@ugisozols
Member

Thanks @xyz for your work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment