Files
openfoodnetwork/app/views/shopping_shared/_tabs.html.haml
Maikel Linke a21ef19529 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.
2020-03-19 15:37:13 +11:00

16 lines
640 B
Plaintext

- if (@order.andand.distributor || current_distributor) == current_distributor
- shop_tabs.each do |tab|
= render "shopping_shared/tabs/#{tab[:name]}"
#shop-tabs{ ng: { controller: "PagesetCtrl", init: "selectDefault('#{shop_tabs.first[:name]}')", cloak: true } }
.tab-buttons
.row
.columns.small-12.large-8
- shop_tabs.each do |tab|
.page{ "ng-class" => "{ selected: selected() == '#{tab[:name]}' }" }
%a{ href: "##{tab[:name]}" }=tab[:title]
- shop_tabs.each do |tab|
.page-view{ ng: {include: "'shop/#{tab[:name]}.html'", if: "selected() == '#{tab[:name]}'" } }