mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-22 05:18:51 +00:00
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.
16 lines
640 B
Plaintext
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]}'" } }
|