mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Render only shop tabs within shop
The include directive was listening to all $location paths including `#login` which is unrelated to the shop tabs. Angular tried to load the template `shop/login.html` which doesn't exist. We now whitelist the templates that can be included by having an include tag for each shop tab/page.
This commit is contained in:
@@ -11,4 +11,5 @@
|
||||
.page{ "ng-class" => "{ selected: selected() == '#{tab[:name]}' }" }
|
||||
%a{ href: "##{tab[:name]}" }=tab[:title]
|
||||
|
||||
.page-view{ "ng-include" => '"shop/" + selected() + ".html"' }
|
||||
- shop_tabs.each do |tab|
|
||||
.page-view{ ng: {include: "'shop/#{tab[:name]}.html'", if: "selected() == '#{tab[:name]}'" } }
|
||||
|
||||
Reference in New Issue
Block a user