mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-17 00:07:24 +00:00
Removing some garbage, adding admin link
This commit is contained in:
@@ -1,15 +0,0 @@
|
||||
Darkswarm.controller "AccountSidebarCtrl", ($scope, $http, $location, SpreeUser, Navigation) ->
|
||||
$scope.path = "/account"
|
||||
Navigation.paths.push $scope.path
|
||||
|
||||
$scope.active = ->
|
||||
$location.path() == $scope.path
|
||||
|
||||
$scope.select = ->
|
||||
Navigation.navigate($scope.path)
|
||||
|
||||
$scope.emptyCart = (href, ev)->
|
||||
if $(ev.delegateTarget).hasClass "empties-cart"
|
||||
location.href = href if confirm "Changing your Hub will clear your cart."
|
||||
else
|
||||
location.href = href
|
||||
@@ -1,2 +0,0 @@
|
||||
Darkswarm.controller "SidebarCtrl", ($scope, $location, Sidebar) ->
|
||||
$scope.Sidebar = Sidebar
|
||||
@@ -1,20 +1,20 @@
|
||||
#account{"ng-controller" => "AccountSidebarCtrl"}
|
||||
.row
|
||||
.panel
|
||||
%p
|
||||
%strong= link_to "Manage my account", account_path
|
||||
- if enterprise_user?
|
||||
%strong= link_to "Enterprise admin", admin_path
|
||||
- if order = last_completed_order
|
||||
%dl
|
||||
%dt Current Hub:
|
||||
%dd= link_to current_distributor.name, main_app.shop_path
|
||||
%br
|
||||
%dt Last hub:
|
||||
%dd
|
||||
- if order.distributor != current_distributor
|
||||
= link_to "#{order.distributor.name}".html_safe, "",
|
||||
{class: distributor_link_class(order.distributor),
|
||||
"ng-click" => "emptyCart('#{main_app.shop_enterprise_path(order.distributor)}', $event)"}
|
||||
- else
|
||||
= order.distributor.name
|
||||
-##account{"ng-controller" => "AccountSidebarCtrl"}
|
||||
-#.row
|
||||
-#.panel
|
||||
-#%p
|
||||
-#%strong= link_to "Manage my account", account_path
|
||||
-#- if enterprise_user?
|
||||
-#%strong= link_to "Enterprise admin", admin_path
|
||||
-#- if order = last_completed_order
|
||||
-#%dl
|
||||
-#%dt Current Hub:
|
||||
-#%dd= link_to current_distributor.name, main_app.shop_path
|
||||
-#%br
|
||||
-#%dt Last hub:
|
||||
-#%dd
|
||||
-#- if order.distributor != current_distributor
|
||||
-#= link_to "#{order.distributor.name}".html_safe, "",
|
||||
-#{class: distributor_link_class(order.distributor),
|
||||
-#"ng-click" => "emptyCart('#{main_app.shop_enterprise_path(order.distributor)}', $event)"}
|
||||
-#- else
|
||||
-#= order.distributor.name
|
||||
|
||||
@@ -19,6 +19,11 @@
|
||||
%a
|
||||
%span.nav-primary{href: ""} Groups
|
||||
%li.divider
|
||||
- if spree_current_user.andand.has_spree_role? 'admin'
|
||||
%li
|
||||
%a
|
||||
%span.nav-primary{href: spree_admin_path} Admin
|
||||
%li.divider
|
||||
%section.top-bar-section
|
||||
%ul.right{"ng-controller" => "AuthenticationCtrl"}
|
||||
%li.divider
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
describe "SidebarCtrl", ->
|
||||
ctrl = null
|
||||
scope = null
|
||||
location = null
|
||||
|
||||
beforeEach ->
|
||||
module("Darkswarm")
|
||||
location =
|
||||
path: ->
|
||||
"/login"
|
||||
inject ($controller, $rootScope) ->
|
||||
scope = $rootScope
|
||||
ctrl = $controller 'SidebarCtrl', {$scope: scope, $location: location}
|
||||
scope.$apply()
|
||||
Reference in New Issue
Block a user