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>
angular.module("filters", []).filter "truncate", ->
(text, length, end) ->
text = text || ""
length = 10 if isNaN(length)
end = "..." if end is `undefined`
if text.length <= length or text.length - end.length <= length
text
else
String(text).substring(0, length - end.length) + end
Spree::OrderMailer.class_eval do
helper HtmlHelper
helper CheckoutHelper
def confirm_email(order, resend = false)
find_order(order)
subject = (resend ? "[#{t(:resend).upcase}] " : '')
subject += "#{Spree::Config[:site_name]} #{t('order_mailer.confirm_email.subject')} ##{@order.number}"
mail(:to => @order.email,
:from => @order.distributor.email || from_address,
:subject => subject,
Spree::OrderMailer.class_eval do
helper HtmlHelper
helper CheckoutHelper
def confirm_email(order, resend = false)
find_order(order)
subject = (resend ? "[#{t(:resend).upcase}] " : '')
subject += "#{Spree::Config[:site_name]} #{t('order_mailer.confirm_email.subject')} ##{@order.number}"
mail(:to => @order.email,
:from => @order.distributor.email || from_address,
:subject => subject,
%tr
Product
%tr
Product
%tr
Variant
for product in products:
%tr
Shop.factory 'Product', ($resource) ->
new class Product
@products: null
update: ->
@products = $resource("/shop/products").query()
all: ->
@products || @update()
describe('OrderCycle service', function() {
var $httpBackend, OrderCycle, mockProduct;
$httpBackend = null;
OrderCycle = null;
mockProduct = {
all: function() {}
};
beforeEach(function() {
module('Shop', function($provide) {
describe 'OrderCycle service', ->
$httpBackend = null
OrderCycle = null
Product = {
all: -> {}
}
beforeEach ->
module 'Shop', ($provide) ->
$provide.value('Product', Product);
describe 'OrderCycle service', ->
$httpBackend = null
OrderCycle = null
Product = {
all: -> {}
}
beforeEach ->
module 'Shop', ($provide) ->
$provide.value('Product', Product);
describe 'OrderCycle service', ->
$httpBackend = null
OrderCycle = null
Product = {
all: -> {}
}
beforeEach ($provide)->
module 'Shop'
$provide.value('Product', Product);