mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-20 04:59:16 +00:00
Adding darkswarm variant of home page, getting Angular skeleton into place, taking shit off window
This commit is contained in:
@@ -10,6 +10,8 @@
|
||||
#= require ../shared/bindonce.min.js
|
||||
#= require ../shared/ng-infinite-scroll.min.js
|
||||
#= require ../shared/angular-local-storage.js
|
||||
#= require ../search/jquery.backstretch.js
|
||||
#= require angular-backstretch.js
|
||||
#= require angular-flash.min.js
|
||||
#
|
||||
#= require ../shared/jquery.timeago
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
window.AccountSidebarCtrl = Darkswarm.controller "AccountSidebarCtrl", ($scope, $http, $location, SpreeUser, Navigation) ->
|
||||
Darkswarm.controller "AccountSidebarCtrl", ($scope, $http, $location, SpreeUser, Navigation) ->
|
||||
$scope.path = "/account"
|
||||
Navigation.paths.push $scope.path
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
window.AuthenticationActionsCtrl = Darkswarm.controller "AuthenticationActionsCtrl", ($scope, Navigation, storage) ->
|
||||
Darkswarm.controller "AuthenticationActionsCtrl", ($scope, Navigation, storage) ->
|
||||
$scope.toggleLogin = ->
|
||||
Navigation.navigate "/login"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
window.ForgotSidebarCtrl = Darkswarm.controller "ForgotSidebarCtrl", ($scope, $http, $location, SpreeUser, Navigation) ->
|
||||
Darkswarm.controller "ForgotSidebarCtrl", ($scope, $http, $location, SpreeUser, Navigation) ->
|
||||
$scope.spree_user = SpreeUser.spree_user
|
||||
$scope.path = "/forgot"
|
||||
$scope.sent = false
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
Darkswarm.controller "HubsCtrl", ($scope, Hubs) ->
|
||||
console.log Hubs.hubs[0]
|
||||
$scope.Hubs = Hubs
|
||||
$scope.hubs = Hubs.hubs
|
||||
@@ -1,4 +1,4 @@
|
||||
window.LoginSidebarCtrl = Darkswarm.controller "LoginSidebarCtrl", ($scope, $http, $location, SpreeUser, Navigation) ->
|
||||
Darkswarm.controller "LoginSidebarCtrl", ($scope, $http, $location, SpreeUser, Navigation) ->
|
||||
$scope.spree_user = SpreeUser.spree_user
|
||||
$scope.path = "/login"
|
||||
Navigation.paths.push $scope.path
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
window.SidebarCtrl = Darkswarm.controller "SidebarCtrl", ($scope, $location) ->
|
||||
Darkswarm.controller "SidebarCtrl", ($scope, $location) ->
|
||||
$scope.sidebarPaths = ["/login", "/signup", "/forgot", "/account"]
|
||||
|
||||
$scope.active = ->
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
window.SignupSidebarCtrl = Darkswarm.controller "SignupSidebarCtrl", ($scope, $http, $location, SpreeUser, Navigation) ->
|
||||
Darkswarm.controller "SignupSidebarCtrl", ($scope, $http, $location, SpreeUser, Navigation) ->
|
||||
$scope.spree_user = SpreeUser.spree_user
|
||||
$scope.path = "/signup"
|
||||
Navigation.paths.push $scope.path
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
window.Darkswarm = angular.module("Darkswarm", ["ngResource", "filters", 'mm.foundation', 'angularLocalStorage', 'pasvaz.bindonce', 'infinite-scroll', 'angular-flash.service']).config ($httpProvider, $tooltipProvider) ->
|
||||
window.Darkswarm = angular.module("Darkswarm", ["ngResource", "filters", 'mm.foundation', 'angularLocalStorage', 'pasvaz.bindonce', 'infinite-scroll', 'angular-flash.service', 'backstretch']).config ($httpProvider, $tooltipProvider) ->
|
||||
$httpProvider.defaults.headers.post['X-CSRF-Token'] = $('meta[name="csrf-token"]').attr('content')
|
||||
$httpProvider.defaults.headers.put['X-CSRF-Token'] = $('meta[name="csrf-token"]').attr('content')
|
||||
$httpProvider.defaults.headers['common']['X-Requested-With'] = 'XMLHttpRequest'
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
Darkswarm.directive "ofnDisableEnter", ()->
|
||||
restrict: 'A'
|
||||
link: (scope, element, attrs)->
|
||||
element.bind "keydown keypress", (e)->
|
||||
code = e.keyCode || e.which
|
||||
if code == 13
|
||||
e.preventDefault()
|
||||
|
||||
|
||||
4
app/assets/javascripts/darkswarm/services/hubs.js.coffee
Normal file
4
app/assets/javascripts/darkswarm/services/hubs.js.coffee
Normal file
@@ -0,0 +1,4 @@
|
||||
Darkswarm.factory 'Hubs', ($location, hubs) ->
|
||||
new class Hubs
|
||||
constructor: ->
|
||||
@hubs = hubs
|
||||
Reference in New Issue
Block a user