Skip to content

Instantly share code, notes, and snippets.

angular.module("Checkout").controller "SummaryCtrl", ($scope) ->
$scope.purchase = ()->
alert("catS")
<orderdetails ng-app="Checkout" ng-controller="SummaryCtrl">
<form accept-charset="UTF-8" action="#" class="edit_order" id="edit_order_2799" method="post" ng-submit="purchase()"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓"><input name="_method" type="hidden" value="put"><input name="authenticity_token" type="hidden" value="JgWuLJQFKuKnOHfaUPz4fMnewTeIDwKns0SZX/YUaSM="></div> <fieldset>
<legend>Your Order</legend>
<table>
<tbody><tr>
File to import not found or unreadable: foundation/variables.
Load paths:
Sass::Rails::Importer(/Users/willmarshall/Projects/openfoodweb/app/assets/stylesheets/darkswarm/sidebar.css.sass)
/Users/willmarshall/Projects/openfoodweb/app/assets/stylesheets
/Users/willmarshall/.rvm/gems/ruby-1.9.3-p392@openfoodnetwork/gems/compass-0.12.4/frameworks/blueprint/stylesheets
/Users/willmarshall/.rvm/gems/ruby-1.9.3-p392@openfoodnetwork/gems/compass-0.12.4/frameworks/compass/stylesheets
Compass::SpriteImporter
/Users/willmarshall/Projects/openfoodweb/lib/chili/eaterprises_feature/app/assets/stylesheets/eaterprises_feature
(in /Users/willmarshall/Projects/openfoodweb/app/assets/stylesheets/darkswarm/sidebar.css.sass)
# If I use active: '$location.path() == contact.path' this fails - can't use expressions?
%tab{heading: "Contact", active: "contact.active"}
= render "shop/shop/contact"
Darkswarm.controller "TabsCtrl", ($scope, $location) ->
$scope.active = (tab)->
$location.path() == tab
$scope.contact =
active: $scope.active("/contact")
path: "/contact"
Darkswarm.factory 'Order', ($resource, Product, order)->
new class Order
constructor: ->
@[name] = method for name, method of order # Clone all data from the order JSON object
# Here we default to the first shipping method if none is selected
@shipping_method_id ||= parseInt(Object.keys(@shipping_methods)[0])
@ship_address_same_as_billing ?= true
shippingMethod: ->
Darkswarm.controller "CheckoutCtrl", ($scope, Order, storage) ->
window.tmp = $scope
$scope.order = $scope.Order = Order
storage.bind $scope, "user", { defaultValue: true}
$scope.disable = ->
$scope.user = false
$scope.details = true
storage.bind $scope, "details"
Darkswarm.filter "date_in_words", ->
(date) ->
moment(date).fromNow()
Darkswarm.filter "sensible_timeframe", (date_in_wordsFilter)->
(date) ->
if moment().add('days', 2) < moment(date)
"Orders open"
else
"Closing in #{date_in_wordsFilter(date)}"
Darkswarm.directive "ofnModal", ($modal)->
restrict: 'E'
replace: true
transclude: true
template: "<a>{{title}}</a>"
scope:
title: "@"
link: (scope, elem, attrs)->
elem.on "click", ->
Darkswarm.directive "ofnModal", ($modal)->
restrict: 'E'
replace: true
transclude: true
template: "<a>{{title}}</a>"
scope:
title: "@"
link: (scope, elem, attrs, ctrl, transclude)->
console.log transclude()
Darkswarm.directive "ofnModal", ($modal)->
restrict: 'E'
replace: true
transclude: true
template: "<a>{{title}}</a>"
# If I do this then my cancel() function goes on the isolate scope
# But due to transclude my transclude() content is run against the original scope
# So I don't have access to modalInstance
#scope: