Skip to content

Commit

Permalink
Add missing templates from spree_backend
Browse files Browse the repository at this point in the history
  • Loading branch information
luisramos0 committed Dec 26, 2019
1 parent d100677 commit 14d0922
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
$(document).ready(function() {
alert("asdfasd")
if ($('#customer_autocomplete_template').length > 0) {
window.customerTemplate = Handlebars.compile($('#customer_autocomplete_template').text());
}
});
4 changes: 4 additions & 0 deletions app/assets/stylesheets/admin/all.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
@import 'plugins/font-awesome';
@import 'plugins/select2';

@import 'sections/image_settings';
@import 'sections/orders';
@import 'sections/products';

@import 'hacks/mozilla';
@import 'hacks/opera';
@import 'hacks/ie';
Expand Down
2 changes: 2 additions & 0 deletions app/services/permissions/order.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require 'open_food_network/permissions'

module Permissions
class Order
def initialize(user)
Expand Down
19 changes: 19 additions & 0 deletions app/views/spree/admin/orders/customer_details/_autocomplete.js.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<script type='text/template' id='customer_autocomplete_template'>
<div class='customer-autocomplete-item'>
<div class='customer-details'>
<h5>{{customer.email}}</h5>
{{#if bill_address.firstname }}
<strong>{{t 'bill_address' }}</strong>
{{bill_address.firstname}} {{bill_address.lastname}}<br>
{{bill_address.address1}}, {{bill_address.address2}}<br>
{{bill_address.city}}<br>
{{#if bill_address.state_id }}
{{bill_address.state.name}}
{{else}}
{{bill_address.state_name}}
{{/if}}
{{bill_address.country.name}}
{{/if}}
</div>
</div>
</script>

0 comments on commit 14d0922

Please sign in to comment.