Compare commits

...

1195 Commits
v1.2 ... v1.8.3

Author SHA1 Message Date
Maikel Linke
984641e46c Merge remote-tracking branch 'origin/master' into uk/trial-length
Conflicts:
	config/locales/en.yml
2016-07-20 11:40:52 +10:00
Maikel Linke
ddb54d1924 Delete fee on payment method if payment invalid
PayPalExpress is always creating two payments. The first one is
invalidated and the second one succeeds. Without deleting the old fee on
the invalidated payment, the order lists the fee twice.
2016-07-15 17:43:26 +10:00
Maikel Linke
af6d0ec107 Remove unused code from order confirmation page 2016-07-13 13:54:55 +10:00
Maikel Linke
e693f71775 Inject only needed enterprises into order confirmation page 2016-07-13 13:54:32 +10:00
Maikel Linke
0ff1c95c3d Keep unreferenced entries when dereferencing in js 2016-07-13 12:08:11 +10:00
Maikel Linke
b5bc3a4ca3 Merge branch 'master' of github.com:openfoodfoundation/openfoodnetwork into enterprise-load 2016-07-13 10:01:16 +10:00
Maikel Linke
8e73a2e0d6 Dereference enterprises and taxons later 2016-07-06 16:20:07 +10:00
Rohan Mitchell
e373284934 Fix intermittent spec failure 2016-07-06 16:14:32 +10:00
Rohan Mitchell
b5a9a1b6bf Add translation for business_model_configuration 2016-07-06 16:14:25 +10:00
Rohan Mitchell
13c8f0a230 Improve spec reliability
It seems that the success message on the customers page is disappearing before the spec can
detect it. This seems unlikely since it's present for 3 s, but this is my best theory right now.
2016-07-06 15:29:04 +10:00
Maikel Linke
f733c7f207 Include shop enterprise on shop front 2016-07-06 12:45:12 +10:00
Rohan Mitchell
d3c423f7ce Only perform URL search once, not every time map tiles change 2016-07-06 11:56:41 +10:00
Maikel Linke
52f68dac33 Merge branch 'master' of github.com:openfoodfoundation/openfoodnetwork into enterprise-load 2016-07-06 11:35:26 +10:00
Maikel Linke
f984871b23 Inject only needed enterprises into cart and checkout 2016-07-06 11:14:13 +10:00
Rohan Mitchell
f09cd9e477 Allow groups to be searched by URL 2016-07-06 11:08:38 +10:00
Rohan Mitchell
d6f21b24da Add specs for producers and shops search by URL 2016-07-06 11:08:38 +10:00
Rohan Mitchell
34b2f72ae8 When query changed (typing or autocomplete), update URL. When page loads, perform query search. 2016-07-06 10:44:25 +10:00
Rohan Mitchell
e6bdd2303d Extract showing search result 2016-07-06 10:44:25 +10:00
Rohan Mitchell
a9a68151ec Syntax 2016-07-06 10:44:25 +10:00
Rohan Mitchell
f586dbc3e1 Extract OSM tile setup to own directive 2016-07-06 10:44:19 +10:00
Rohan Mitchell
54028f4e7e Split directive into functions 2016-07-01 15:31:32 +10:00
Rohan Mitchell
e8b83bef41 Simplify responding to search 2016-07-01 15:31:32 +10:00
Bing Xie
78b22c4a82 Fix incorrectly aligned columns 2016-06-30 21:38:10 +10:00
Continuous Integration
e252414263 Auto-merge from CI [skip ci] 2016-06-30 01:30:53 +10:00
Lynne Davis
320db21d5c Updating spec with $ (not £) for automated testing 2016-06-29 16:30:11 +01:00
Maikel Linke
c253d73d11 Refactoring with feedback on pr #1073 2016-06-29 15:46:51 +10:00
Maikel Linke
08fdc8a5bd Load producers of all or selected order cycles into shop 2016-06-29 12:57:09 +10:00
Rohan Mitchell
9cc0bb831a Show properties alongside taxons on producer fat view 2016-06-24 07:57:06 +10:00
Rohan Mitchell
a5a00e9cef Show taxons and properties on producer modal (seen on map, shop producer info) 2016-06-24 07:57:06 +10:00
Rohan Mitchell
4134cbfc9c Include producer properties on producer listing 2016-06-24 07:57:06 +10:00
Rohan Mitchell
58379a5e28 Extract property merging to lib class 2016-06-24 07:57:06 +10:00
Rohan Mitchell
aae1689a27 Show product properties on producers page 2016-06-24 07:57:06 +10:00
Rohan Mitchell
4338f632f6 Add scope: Spree::Property.applied_by 2016-06-24 07:57:06 +10:00
Rohan Mitchell
fa0cc6f2c8 Add spec for filtering producers by taxon 2016-06-24 07:57:06 +10:00
Maikel Linke
e284ad62b2 Inject only relative enterprises into shopfront
Other shops displayed in producer modals are lazy loaded when opening
their modal.
2016-06-17 17:15:16 +10:00
Rob Harrington
d28c0159ab Use have_selector x, count: y; instead of all(x).count.should == y 2016-06-17 16:44:02 +10:00
Rob Harrington
e40ecae681 Removing inline styles for links dropdown 2016-06-17 16:44:02 +10:00
Rob Harrington
1e142aa628 Refactoring OrderCycleFormApplicator logic for improved update speed 2016-06-17 16:44:02 +10:00
Rob Harrington
6586e67a5c Better messaging around deletion of customers 2016-06-17 14:47:04 +10:00
Rob Harrington
d9b3366a5c Auto-select shop on customers index when only one available 2016-06-17 11:28:20 +10:00
Rob Harrington
61969f5c84 Ensure CustomersController#update.json gives an appropriate response
pendingChanges submits an empty string when a field is blank (rather than undefined)
2016-06-16 22:42:53 +10:00
Rob Harrington
2a4737147f Tweaking the way new customer form error messages are display for latest version of AngularJS 2016-06-16 16:32:10 +10:00
Rob Harrington
a909f0ddb8 Merge remote-tracking branch 'origin/master' into pr/1033 2016-06-16 15:12:30 +10:00
Rob Harrington
25cdd4af8e Preventing shop from being changed when unsaved customer changes exist
Also making layout of filters on customer index more consistent with other pages
2016-06-16 15:10:16 +10:00
Maikel Linke
be7e46300c Merge branch 'master' of github.com:openfoodfoundation/openfoodnetwork into prod-log-warn 2016-06-15 11:56:29 +10:00
Continuous Integration
9ba07a2afb Merge remote-tracking branch 'origin/master' into HEAD 2016-06-15 11:26:02 +10:00
Bing Xie
a39d15d685 Fix failed adds a new tag rule js test 2016-06-15 10:51:34 +10:00
Rob Harrington
d424c2eb20 Enterprise form SaveBar becomes available when adding a new rule 2016-06-15 10:51:34 +10:00
Rob Harrington
c8c8f0d02d Removing old cancel button from bottom of OC forms 2016-06-15 10:51:34 +10:00
Rob Harrington
8221f1f193 Use scope. to ensure that tag rule sorting is applied 2016-06-15 10:51:34 +10:00
Bing Xie
c83952571f Fix failed test 2016-06-15 10:51:34 +10:00
Bing Xie
18a8efed5f Resize window to fix failed test 2016-06-15 10:51:34 +10:00
Bing Xie
82dc2a8c98 Update bulk products editing page 2016-06-15 10:51:34 +10:00
Bing Xie
001ae19b26 Update create and update order cycle page save-bar 2016-06-15 10:51:34 +10:00
Bing Xie
c003dcded9 Update editing enterprise page save-bar 2016-06-15 10:51:34 +10:00
Bing Xie
7aa8f2c73c Fix failed tests 2016-06-15 10:51:34 +10:00
Bing Xie
41837eb31d Tweak create order cycle spec 2016-06-15 10:51:34 +10:00
Bing Xie
860a537f30 Add save bar to bulk editing product page 2016-06-15 10:51:34 +10:00
Bing Xie
33fd88507d Fix failed tests 2016-06-15 10:51:34 +10:00
Bing Xie
d8bf66a6c9 Use save bar on enterprise editing page 2016-06-15 10:51:34 +10:00
Bing Xie
2065d81bb4 Use save bar directive in enterprise editing page 2016-06-15 10:51:34 +10:00
Bing Xie
7994e2594a Update create order cycle feature test 2016-06-15 10:51:34 +10:00
Bing Xie
baa6fda3e0 Use save bar in create order cycle page 2016-06-15 10:51:34 +10:00
David Ajnered
fb33be78dd #591 show selected hub dropdown on customers page and enable easy switch to different hub 2016-06-10 15:42:40 +02:00
Maikel Linke
db3637fe84 Allow removing customer codes 2016-06-10 18:14:19 +10:00
Maikel Linke
ee0a226388 Try to remove random failure from spec 2016-06-10 10:06:35 +10:00
Maikel Linke
5cd269411d Trigger order button instead of click 2016-06-10 09:46:56 +10:00
Maikel Linke
cb679a6aba Remove duplicate "What's this?" from order cycles overview 2016-06-10 09:18:26 +10:00
Maikel Linke
ad1ef877c0 Warn about duplicate customer codes
The admin customer page displays a warning you change a code to an
existing one.
2016-06-10 09:09:56 +10:00
Rob Harrington
c5ba0b8f8c Merge branch 'master' into 1014-image-diet 2016-06-08 15:12:33 +10:00
Rob Harrington
365c6b3a83 Streamlining button clicking on registration spec 2016-06-08 13:06:57 +10:00
Steve Pettitt
a504a10b52 Change to explicitly check complete state (default Spree::Order.complete scope checks only for presence of 'completed_at' timestamp) 2016-06-08 11:15:02 +10:00
Steve Pettitt
caf35d0ad7 Add a spec to exclude canceled orders (failing) 2016-06-08 11:15:02 +10:00
Paul Mackay
b718cf729a Set production log level to warn 2016-06-01 20:51:31 +01:00
Maikel Linke
489feb4e01 Longer default page size for feature specs 2016-06-01 16:28:43 +10:00
Maikel Linke
89c3758bae Avoid race conditions in feature specs 2016-06-01 16:15:44 +10:00
Maikel Linke
4bde890eaa Merge branch 'master' of github.com:openfoodfoundation/openfoodnetwork into error-pages 2016-06-01 15:22:34 +10:00
Continuous Integration
ee10a4b173 Merge remote-tracking branch 'origin/master' into HEAD 2016-06-01 12:16:10 +10:00
Mike iLL Kilmer
6f375306c2 Some US-Specific copy. (#1018)
Add locale en-US.yml
2016-06-01 12:13:03 +10:00
Rob Harrington
98f8f7b89f Adding new help-modal dialog, use for explaining tag rule UI 2016-05-28 01:16:07 +10:00
Rob Harrington
7028fbe288 Find current_customer via current_distributor and current_user rather than current_order
Moving available_payment_methods to enterprises_helper, as per available_shipping_methods
2016-05-28 00:31:59 +10:00
Rob Harrington
07384edb2d Can delete default tag rules 2016-05-27 22:00:08 +10:00
Rob Harrington
12e685bd92 Restricting number of tags for tag rules to one 2016-05-27 16:25:10 +10:00
Rob Harrington
6dd05ca4da Intermittent fail hunting 2016-05-27 16:25:10 +10:00
Rob Harrington
a1c7a44fa0 Tag Rules can be rearranged in UI to set priority 2016-05-27 16:25:10 +10:00
Rob Harrington
cb9e3b43f9 Tag attributes are auto-initialized via directive if not present on object 2016-05-27 16:25:10 +10:00
Rob Harrington
011c8c74d9 Updating remove button character for tags in ngTagsInput 2016-05-27 16:25:10 +10:00
Rob Harrington
38e37a4dfa Using new jasmine2 syntax in variant override spec 2016-05-27 16:25:10 +10:00
Rob Harrington
607b674c57 Refactoring tag rule logic, placing in TagRuleApplicator lib class 2016-05-27 16:25:10 +10:00
Rob Harrington
fa3b43a970 Adding default tag rules 2016-05-27 16:25:10 +10:00
Rob Harrington
bf0db2287b More structured layout for Tag Rules UI 2016-05-27 16:25:10 +10:00
Rob Harrington
339074a66e Making templates available to paymentMethods module 2016-05-27 16:25:10 +10:00
Rob Harrington
c568ac4d64 Re-adding button clicks removed in 885d489bc3 2016-05-27 16:25:10 +10:00
Rob Harrington
3d7786e185 Optional autocomplete for tag rules directive 2016-05-27 16:25:10 +10:00
Rob Harrington
9b12b86053 Simplifying supplier and distributor row counts 2016-05-27 16:25:10 +10:00
Rob Harrington
84817b0124 Fixing specs broken by faster PhantomJS 2016-05-27 16:25:10 +10:00
Rob Harrington
5624fa0c5e Adding FilterOrderCycles tag rules to UI 2016-05-27 16:25:10 +10:00
Rob Harrington
10434f5ee3 Renaming class 2016-05-27 16:25:10 +10:00
Rob Harrington
e32e3ddf70 Applying FilterOrderCycles rules in the frontend 2016-05-27 16:25:10 +10:00
Rob Harrington
70e6428c1f Adding FilterOrderCycle tag rule 2016-05-27 16:25:10 +10:00
Rob Harrington
9dc1294ec5 Outgoing exchanges can be tagged
Using panels infrastructure to display tags and products interfaces
2016-05-27 16:25:10 +10:00
Rob Harrington
e81858c0dc Renaming PanelToggleRow to PanelCtrl 2016-05-27 16:25:10 +10:00
Rob Harrington
8035b3f24a Refactoring admin table panels infrastructure
Updating enterprise index
2016-05-27 16:25:10 +10:00
Rob Harrington
d201e4a039 Tweaking styling for JQuery Dialog box in admin section 2016-05-27 16:25:10 +10:00
Rob Harrington
e999b5715a Adding FilterPaymentMethods rules to tag rule UI 2016-05-27 16:25:10 +10:00
Rob Harrington
3fb6fba0f0 Adding payment method tag rule logic to Spree::Order.available_payment_methods 2016-05-27 16:25:10 +10:00
Rob Harrington
e21735b037 Removing naughty save_screenshot call from payment method spec 2016-05-27 16:25:10 +10:00
Rob Harrington
e553b8c590 Adding filter payment method tag rule logic 2016-05-27 16:25:10 +10:00
Rob Harrington
4d83bf2135 Payment methods can be tagged 2016-05-27 16:25:10 +10:00
Rob Harrington
385fd91e70 Adding angularjs payment method controller, updating payment method edit form 2016-05-27 16:25:10 +10:00
Rob Harrington
2d666caaf2 Nitpicking 2016-05-27 16:23:26 +10:00
Rob Harrington
c61cb1bdcd Renaming paymentMethodCtrl to paymentMethodsCtrl 2016-05-27 16:23:26 +10:00
Rob Harrington
eedb2854ec Adding FilterProducts rules to tag rule UI 2016-05-27 16:23:26 +10:00
Rob Harrington
1cb51b5c71 CodeClimate fixes for filter-products branch 2016-05-27 16:23:26 +10:00
Rob Harrington
48d4c8733d When we load up incomplete orders, make sure that they have a user associated if the user is logged in
Also associate customer ONLY if one already exists. This is required to prevent unauthorised access to customer-only shopfronts.
2016-05-27 16:23:26 +10:00
Rob Harrington
302bdfd628 Implementing FilterProducts rules in the frontend 2016-05-27 16:23:26 +10:00
Rob Harrington
cc6ef7b8f5 Load uncached products json into shop when in testing or development environment 2016-05-27 16:23:26 +10:00
Rob Harrington
50738f28e9 Refactoring tag rule application
To allow rules to be loaded and counted before being checked for relevance
2016-05-27 16:23:26 +10:00
Rob Harrington
8b8da33ffc Further refinements to FilterProducts tag rule 2016-05-27 16:23:26 +10:00
Rob Harrington
17fa0d2baf Adding tag rule logic for filtering products 2016-05-27 16:23:26 +10:00
Rob Harrington
3f8420b0e9 Adding tags to variant overrides 2016-05-27 16:23:26 +10:00
Maikel Linke
ddc7e86e6c Update xero report spec 2016-05-27 15:00:54 +10:00
Maikel Linke
8a77062888 Include transaction fees in reports 2016-05-27 14:40:22 +10:00
Maikel Linke
e3b43243cc Add line_items getter to Payment
The calculator of a payment method calls `line_items` on the payment.
The code got copied from Spree::Shipment.
2016-05-27 11:30:07 +10:00
Maikel
61a4228e6b Auto-merged master into uk/trial-length on deployment. 2016-05-25 18:56:17 +10:00
Lynne Davis
f0a2098826 Adding text generation to new business model features 2016-05-25 09:45:47 +01:00
Maikel Linke
a624a57bfb Pass current order to PaymentMethodSerializer 2016-05-25 17:12:47 +10:00
Maikel Linke
0af8377844 Add payment method fees to order during checkout
The fee is displayed as "Transaction fee".
2016-05-25 14:56:52 +10:00
Maikel Linke
e4f855b64a Display calculator in payment method edit form 2016-05-25 14:56:52 +10:00
Maikel Linke
16b80a2f1b Extend PaymentMethod with calculated_adjustments 2016-05-25 14:56:52 +10:00
Maikel Linke
21b8445753 Include job name in failure message 2016-05-25 11:58:57 +10:00
Maikel Linke
63432c2acc Resize tested page to find all products 2016-05-25 11:45:18 +10:00
Maikel Linke
03f98af60b Merge remote-tracking branch 'origin/master' into uk/spree-google-analytics 2016-05-25 10:05:09 +10:00
Rob Harrington
852a12db61 Remove caching of global npm phantomjs install 2016-05-25 08:10:20 +10:00
Rob Harrington
b804a70469 Columns service updates state of columns (especially id) when data received from server
Also showing saving status
2016-05-25 08:10:20 +10:00
Rob Harrington
924d155012 Using correct syntax for attributes on columns 2016-05-25 08:10:20 +10:00
Rob Harrington
604418d699 Install phantomjs with npm 2016-05-25 08:10:20 +10:00
Rob Harrington
b9f6cb8800 Adding translations for all column names 2016-05-25 08:10:20 +10:00
Rob Harrington
f2de498d61 Show saved status of column preferences 2016-05-25 08:10:20 +10:00
Rob Harrington
55da83d0c0 Removing obsolete BOM controller (replaced by LineItemsCtrl) 2016-05-25 08:10:20 +10:00
Rob Harrington
1d8719b474 Default column visibility can be set per user using ColumnPreferences model 2016-05-25 08:10:20 +10:00
Rob Harrington
3647b17110 Removing save_screenshot call 2016-05-25 08:10:20 +10:00
Rob Harrington
533a94267a Refactoring save-bar 2016-05-25 08:10:20 +10:00
Rob Harrington
ecb9646ccb Using new syntax for save-bar on customers page 2016-05-25 08:10:20 +10:00
Rob Harrington
162b11dcc5 Updating spec to new Jasmine syntax 2016-05-25 08:10:20 +10:00
Rob Harrington
93a4f19b40 Hash Navigation works on with Group and Shopping page tabs 2016-05-25 08:10:20 +10:00
Rob Harrington
92d8ee1a36 Making sure that hash navigation works with auth tabs 2016-05-25 08:10:20 +10:00
Rob Harrington
4b8146dd00 Fixing translation error on final registration page 2016-05-25 08:10:20 +10:00
Rob Harrington
abc906186e Using ngSrc correctly in frontend 2016-05-25 08:10:20 +10:00
Rob Harrington
564c1a3650 Improvements to customers page
Create customer from dialog

Limiting the number of products shown as once

Adding SaveBar and StatusMessage
2016-05-25 08:10:20 +10:00
Rob Harrington
c44f9d2537 Making text (and links) within shopfront message more legible 2016-05-25 08:10:20 +10:00
Rob Harrington
7e932f091d Use have_current_path rather than current_path.should == 2016-05-25 08:10:20 +10:00
Rob Harrington
2c9697ff4e Adding -nc option to wget of PhantomJS, so that we only download it if needed 2016-05-25 08:10:20 +10:00
Rob Harrington
6bfe1be045 Update spec looking for matching img src 2016-05-25 08:10:20 +10:00
Rob Harrington
efaf728737 Upgrading ngTagsInput 2016-05-25 08:10:20 +10:00
Rob Harrington
ddcfe1535a Making TagRule autocomplete available to models other than Customer
Incorporate ng admin.tags module and rails TagController into existing admin.tagRules module + TagRuleController
2016-05-25 08:10:20 +10:00
Rob Harrington
9e0b97dc9c Upgrading textAngular 2016-05-25 08:10:20 +10:00
Rob Harrington
245db8971a Fixing specs broken by faster PhantomJS 2016-05-25 08:10:20 +10:00
Rob Harrington
0586a71071 Bumping Poltergeist and Capybara versions 2016-05-25 08:10:20 +10:00
Rob Harrington
2146a55c3b Linking to PhantomJS installed on PATH 2016-05-25 08:10:20 +10:00
Rob Harrington
a0254f30cd Adding package.json with npm dev dependencies for js specs 2016-05-25 08:10:20 +10:00
Rob Harrington
7a498362b3 Upgrading AngularJS specs to Jasmine 2 syntax 2016-05-25 08:10:20 +10:00
Rob Harrington
cfbfe8416f WIP (AngularJS 1.5.5 upgrade): updating npm karma packages for travis 2016-05-25 08:10:20 +10:00
Rob Harrington
1b0897d53a Bump to AngularJS to 1.5.5 2016-05-25 08:10:20 +10:00
Rob Harrington
9d1ca6eaca Renaming customers form to prevent conflict with customers array 2016-05-25 08:10:20 +10:00
Rob Harrington
39a062e90a WIP (Angular 1.4 Upgrade): Moving controllers for login tabs to prevent multiple directives asking for isolate scope 2016-05-25 08:10:20 +10:00
Rob Harrington
af5eec7094 WIP (Angular 1.4 Upgrade): Adding filters to ofn-select2 and using on order create/edit UI 2016-05-25 08:10:20 +10:00
Rob Harrington
668bffcd84 Bumping AngularJS to 1.4.8 2016-05-25 08:10:20 +10:00
Rob Harrington
02d093f6b6 Loading selectors into product modal to display proprties and taxons 2016-05-25 08:10:20 +10:00
Rob Harrington
383f7c57aa Wait for login before visiting CMS 2016-05-25 08:10:20 +10:00
Rob Harrington
10133a13f2 Make sure that changes are saved before attempting to click link 2016-05-25 08:10:20 +10:00
Rob Harrington
8838a89ecc Don't typecast product and variant on_hand from DOM when it is 'On demand' 2016-05-25 08:10:20 +10:00
Rob Harrington
cf94d67caf Preventing default submit behaviour for order cycle form submission buttons 2016-05-25 08:10:20 +10:00
Rob Harrington
97e53900ad Updating translation to start with a capital letter 2016-05-25 08:10:20 +10:00
Rob Harrington
9fc7908af5 Removing '?' to meet expectations of js spec 2016-05-25 08:10:20 +10:00
Rob Harrington
7bc118b598 Final steps to remove bindonce 2016-05-25 08:10:20 +10:00
Rob Harrington
1d837c32ee Replacing bindonce with native Angularjs syntax in admin 2016-05-25 08:10:20 +10:00
Rob Harrington
e5ca494db8 Replacing bindonce with native Angularjs syntax in Darkswarm
Involved changing bo-text -> ng-bind, bo-href-i -> ng-href, bo-src-i -> ng-src and ng-html -> ng-bind-html
2016-05-25 08:10:20 +10:00
Rob Harrington
5de9eed48a Fixing broken instagram link 2016-05-25 08:10:20 +10:00
Rob Harrington
fe739f6a8d angular-foundation tabs directive on shop pages is closed by default 2016-05-25 08:10:20 +10:00
Rob Harrington
02be661163 Bumping angularjs version to 1.3.15 2016-05-25 08:10:20 +10:00
David Leuliette
22ae668c74 Diet for images 2016-05-23 19:50:48 +02:00
Rob Harrington
fc69adb135 Fixing producer emails spec 2016-05-23 10:40:46 +10:00
elf Pavlik
4e4175ee4c fixed i18n on admin edit groups 2016-05-22 19:18:58 -05:00
elf Pavlik
aa04da48f3 fixed i18n on admin edit enterprise 2016-05-22 18:40:42 -05:00
Rob Harrington
a2d875655c Nothing 2016-05-20 14:13:10 +10:00
Rob Harrington
6a610ff7a4 Merge remote-tracking branch 'origin/master' into uk/trial-length 2016-05-20 12:22:47 +10:00
Rob Harrington
5d3adc0bdb Fixing producer emails so that they calculate tax correctly
Also listing items by full_name rather than by variant, to catch cases where line item weights/volumes have been adjusted
2016-05-20 11:01:33 +10:00
Rob Harrington
6a3f6e7bfa Revert "Add line item included_tax_amount method to multiply by quantity"
This reverts commit 547fcf49e0.
2016-05-20 09:46:31 +10:00
Rob Harrington
d043de08cd Revert "Temporarily comment out tax column"
This reverts commit 858beb97c5.
2016-05-20 09:42:19 +10:00
Steve Pettitt
858beb97c5 Temporarily comment out tax column 2016-05-18 08:49:05 +01:00
Maikel Linke
379bad9f46 Merge branch 'master' of github.com:openfoodfoundation/openfoodnetwork into error-pages 2016-05-18 15:54:58 +10:00
Maikel Linke
041d9814a7 Remove redundant CSS and jpg 2016-05-18 15:54:20 +10:00
Steve Pettitt
c66ac0827e Add translations to plain text part 2016-05-16 21:35:40 +01:00
Steve Pettitt
419402c554 Add some HTML email specs 2016-05-16 21:30:56 +01:00
Steve Pettitt
93f0a7c58d Remove debug statement 2016-05-15 23:25:19 +01:00
Steve Pettitt
38316bae3f Add Stroudco wording to en-GB 2016-05-15 23:24:59 +01:00
Steve Pettitt
bd4debe91b Merge branch 'uk/order_cycle_report' of https://github.com/openfoodfoundation/openfoodnetwork into uk/order_cycle_report 2016-05-15 23:13:17 +01:00
Steve Pettitt
08eaff1c24 Formatting changes 2016-05-15 23:10:38 +01:00
Steve Pettitt
547fcf49e0 Add line item included_tax_amount method to multiply by quantity 2016-05-14 11:00:13 +01:00
Steve Pettitt
3a813cb612 Merge master 2016-05-14 10:09:31 +01:00
Rohan Mitchell
da57e04a50 Merge branch 'fix-groups-map' of https://github.com/bingxie/openfoodnetwork into fix-groups-map 2016-05-13 16:02:22 +10:00
Bing Xie
ba2d5548ff Fix groups map view 2016-05-13 15:44:34 +10:00
Maikel
a4e5e49a08 Auto-merged master into uk-order-cycle-report on deployment. 2016-05-13 11:28:15 +10:00
Rohan Mitchell
027976626c Add spec for error summing Spree::Money 2016-05-13 11:19:44 +10:00
Rohan Mitchell
9f56494c4c Simplify 2016-05-13 10:36:23 +10:00
Steve Pettitt
ab37cd2577 Fix specs, need to add new for HTML 2016-05-13 10:30:21 +10:00
Steve Pettitt
559f7afc60 HTML order cycle report email, text customisable in translations 2016-05-13 10:30:21 +10:00
Steve Pettitt
ef418c7f50 Change to use total rather than display_total (which returns a Spree::Money object) 2016-05-13 10:30:21 +10:00
Steve Pettitt
c80255e9ab Add total to producer emails 2016-05-13 10:30:21 +10:00
Rohan Mitchell
7b994adc23 Merge branch 'use-save-bar' of https://github.com/bingxie/openfoodnetwork into use-save-bar
Conflicts:
	app/assets/javascripts/admin/order_cycles/controllers/edit.js.coffee
	app/assets/javascripts/templates/admin/save_bar.html.haml
	app/views/admin/order_cycles/edit.html.haml
	app/views/admin/variant_overrides/_products.html.haml
	app/views/spree/admin/orders/bulk_management.html.haml
2016-05-13 10:05:39 +10:00
Bing Xie
f8ec0d316a Save bar can support cancel button 2016-05-12 11:04:40 +10:00
Bing Xie
7040e4baae Resize window to fix failed test 2016-05-12 10:45:41 +10:00
Bing Xie
fed3ae9e85 Make the page long enough to avoid the save bar overlaying the form 2016-05-12 10:45:41 +10:00
Bing Xie
89ae77dfd9 Make the save bar look better 2016-05-12 10:45:41 +10:00
Bing Xie
7bf6881cb2 Tweaks 2016-05-12 10:45:41 +10:00
Bing Xie
ed1a06495b Remove unused test code 2016-05-12 10:45:41 +10:00
Bing Xie
e5d2e5010b Fix failed tests 2016-05-12 10:45:41 +10:00
Bing Xie
3760a34b2b Add save_bar to the order cycles simple editing form 2016-05-12 10:45:41 +10:00
Bing Xie
26bb1a9beb Update AdminEditOrderCycleCtrl unit tests 2016-05-12 10:45:41 +10:00
Bing Xie
d59dea29ab Fix failed test for the default form 2016-05-12 10:45:41 +10:00
Bing Xie
78b4a35d12 Keep the action with save button 2016-05-12 10:45:41 +10:00
Bing Xie
7fc37e4737 Tweak save_bar css 2016-05-12 10:45:41 +10:00
Bing Xie
2214c83ec7 Use save_bar on order cycle update form 2016-05-12 10:45:41 +10:00
Bing Xie
d10719330d Extend save_bar directive to support more buttons 2016-05-12 10:45:41 +10:00
Bing Xie
38efa218d0 Use save bar on order cycle form 2016-05-12 10:45:41 +10:00
Rohan Mitchell
8c747f02b5 Merge branch 'use-save-bar' of https://github.com/bingxie/openfoodnetwork into use-save-bar 2016-05-11 14:41:41 +10:00
Rob H
6c625297f2 Merge pull request #934 from oeoeaio/uk/trial-length
More intuitive logic for minimum billable turnover
2016-05-11 12:36:54 +10:00
Maikel
8a47d49dfc Auto-merged master into uk/order_cycle_report on deployment. 2016-05-11 08:20:05 +10:00
Steve Pettitt
d5a7e907a3 Fix specs, need to add new for HTML 2016-05-10 23:11:14 +01:00
Steve Pettitt
6ecf896fa2 HTML order cycle report email, text customisable in translations 2016-05-10 23:04:06 +01:00
Paul Mackay
6dd989484a Switch to using the Spree GA tracker code 2016-05-10 05:32:40 +01:00
Bing Xie
a37820a963 Resize window to fix failed test 2016-05-06 14:55:16 +10:00
Continuous Integration
f90e7d3239 Merge remote-tracking branch 'origin/master' into HEAD 2016-05-06 13:58:37 +10:00
Bing Xie
08f0011244 Make the page long enough to avoid the save bar overlaying the form 2016-05-06 12:43:50 +10:00
Maikel Linke
3e231da472 Translate subjects of enterprise emails
Minor text change

Fix #906

Thanks to Nicolas Blanc:
https://github.com/openfoodfoundation/openfoodnetwork/pull/937
2016-05-06 11:31:15 +10:00
Bing Xie
064e3c426e Make the save bar look better 2016-05-06 11:00:34 +10:00
Continuous Integration
f0b80b47f1 Auto-merge from CI [skip ci] 2016-05-05 23:23:34 +10:00
Paul Mackay
22a6661b51 Improved layout and image for 404 and 500 error pages 2016-05-05 14:21:16 +01:00
Steve Pettitt
7f1fc56f78 Change to use total rather than display_total (which returns a Spree::Money object) 2016-05-04 07:58:23 +01:00
Bing Xie
3cac9c452f Tweaks 2016-05-04 14:56:21 +10:00
Bing Xie
57ec7bb9a9 Remove unused test code 2016-05-04 12:45:23 +10:00
Bing Xie
8b5e5105a8 Fix failed tests 2016-05-04 12:45:23 +10:00
Bing Xie
1833f0dd5d Add save_bar to the order cycles simple editing form 2016-05-04 12:45:23 +10:00
Bing Xie
019e16c5ba Update AdminEditOrderCycleCtrl unit tests 2016-05-04 12:45:23 +10:00
Bing Xie
885d489bc3 Fix failed test for the default form 2016-05-04 12:45:23 +10:00
Bing Xie
63b644551c Keep the action with save button 2016-05-04 12:45:23 +10:00
Bing Xie
70ce58f5e1 Tweak save_bar css 2016-05-04 12:45:23 +10:00
Bing Xie
33d0f9fc1b Use save_bar on order cycle update form 2016-05-04 12:45:23 +10:00
Bing Xie
00858656b5 Extend save_bar directive to support more buttons 2016-05-04 12:45:23 +10:00
Bing Xie
ef0e41e624 Use save bar on order cycle form 2016-05-04 12:45:23 +10:00
Rohan Mitchell
a11696b85e Include BugHerd script only if configured, and with configured API key 2016-05-04 12:13:03 +10:00
Rohan Mitchell
9ac6de4215 Admin can set bugherd API key 2016-05-04 11:42:07 +10:00
Steve Pettitt
bed7ec5953 Add total to producer emails 2016-05-01 12:59:55 +01:00
Rob Harrington
1d7308bf5d More intuitive logic for minimum billable turnover 2016-04-29 18:03:32 +10:00
Maikel Linke
4d6a21254f Merge remote-tracking branch 'origin/master' into openstreetmap-tiles 2016-04-29 16:40:54 +10:00
Maikel Linke
fa5fa9e228 Auto-complete tags on customers page
- new controller serving tags for an enterprise as JSON
- customers page suggesting these tags
- emphasising tags that have rules
2016-04-29 15:18:17 +10:00
Rohan Mitchell
36a4aab020 Adjust styling to blend 2016-04-29 15:07:55 +10:00
Rohan Mitchell
42a327211e Merge branch 'openstreetmap-tiles' of https://github.com/bingxie/openfoodnetwork into openstreetmap-tiles 2016-04-29 14:36:47 +10:00
Rohan Mitchell
88e9eb59cf Do not allow invalid quantity to reach model, triggering server update 2016-04-29 11:56:48 +10:00
Rohan Mitchell
65895752da Remove cruft 2016-04-29 11:49:30 +10:00
Rohan Mitchell
8996acf314 Fix spec 2016-04-27 15:25:05 +10:00
Rohan Mitchell
1384140e41 Notify when stock limit reached on cart rather than silently capping 2016-04-27 15:10:54 +10:00
Rohan Mitchell
1220ff8a06 Notify when stock limit reached on shopfront rather than silently capping 2016-04-27 15:05:44 +10:00
Rohan Mitchell
f691636c75 Fix spec 2016-04-27 14:47:45 +10:00
Bing Xie
824a29624f Tweak the map UI 2016-04-27 14:17:29 +10:00
Bing Xie
daa5b00a2a Uses openstreetmap tiles 2016-04-27 13:50:15 +10:00
Rohan Mitchell
36f4df2931 Allow max value in cart of what's on hand 2016-04-27 12:27:24 +10:00
Rohan Mitchell
cf40e0432a When cart is updated with insufficient stock, show amount in cart, not amount entered 2016-04-27 12:27:24 +10:00
Rohan Mitchell
8f8a1191cb Remove stock cap on max_quantity 2016-04-27 12:27:24 +10:00
Steve Pettitt
2b921542a5 Code styling 2016-04-26 04:24:44 +01:00
Steve Pettitt
ad6037ac63 Fix user spec, check config is set 2016-04-26 04:21:50 +01:00
Steve Pettitt
43d6e49c3a Fix spec 2016-04-26 03:31:56 +01:00
Steve Pettitt
53d50f16d6 Merge current master 2016-04-26 03:18:27 +01:00
Steve Pettitt
7f38f1dd1c Exclude Accounts & Billing distributor 2016-04-26 03:14:13 +01:00
Maikel Linke
2367b73d3a Revert "Associate new users with existing customer records"
This reverts commit a25f4fdf44.

Since email addresses are not validated, these associations would allow
an attacker to signup with the email address of another person and view
their orders.
2016-04-22 14:55:43 +10:00
Maikel Linke
23e598f2f8 Destroy customer without flash notice 2016-04-22 14:55:43 +10:00
Maikel
7bec139987 Auto-merged master into products-caching-add-to-cart on deployment. 2016-04-22 10:58:26 +10:00
Rohan Mitchell
a26266159c Fix timing issue: change in client-side value during server update 2016-04-22 10:47:20 +10:00
Rob Harrington
28d40bf27d Fixing font styling on enterprise name in shop product summary 2016-04-21 21:27:52 +10:00
Rohan Mitchell
779be7c5a0 Extract params parsing into single method 2016-04-21 16:37:15 +10:00
Rohan Mitchell
6cba935a65 Add close button to out of stock modal 2016-04-21 11:26:30 +10:00
Rohan Mitchell
06d7665bf9 Prospective fix for intermittent spec fail 2016-04-21 09:54:56 +10:00
Rohan Mitchell
5151779f80 When update is for another line item, still update all stock levels and show warnings 2016-04-21 09:36:23 +10:00
Rohan Mitchell
3dcfa810fd Display out of stock banner when viewing cart directly 2016-04-21 09:36:23 +10:00
Rohan Mitchell
9b3139dba9 When there's an out of stock product in the cart, visiting the shopfront returns user to the cart 2016-04-21 09:36:23 +10:00
Rohan Mitchell
b2d78e7df6 Set allow_backorders explicitly for consistency in CI 2016-04-21 09:36:23 +10:00
Rohan Mitchell
dac90c8003 Fix specs 2016-04-21 09:36:23 +10:00
Rohan Mitchell
35117f7af4 Show a modal when available stock levels have reduced 2016-04-21 09:36:23 +10:00
Rohan Mitchell
5e39b11c2f Spec out of stock handling for group buy 2016-04-21 09:36:23 +10:00
Rohan Mitchell
cfe062918b When a variant goes out of stock, disable the input and grey out the row 2016-04-21 09:36:23 +10:00
Rohan Mitchell
8695dea0a5 Remove variant from cart when it becomes out of stock 2016-04-21 09:36:23 +10:00
Rohan Mitchell
792e17c385 When removing variant from order, if not found then do nothing 2016-04-21 09:36:23 +10:00
Rohan Mitchell
6fbbe580c5 After adding an item to the cart, when less quantity available, reduce quantity and reset client-side stock level 2016-04-21 09:36:23 +10:00
Rohan Mitchell
8a62d26af4 After adding an item to the cart, when out of stock, remove from cart and reset client-side stock level 2016-04-21 09:36:23 +10:00
Rohan Mitchell
fee0f90a1b After adding products to cart, return status of cart and available stock levels 2016-04-21 09:36:22 +10:00
Rohan Mitchell
292d027498 When adding an item to cart with not enough stock, add as much as we can without erroring 2016-04-21 09:36:22 +10:00
Rohan Mitchell
a1bcdc616f Extract add-to-cart inputs into partials 2016-04-21 09:36:22 +10:00
Rohan Mitchell
17f69bd182 Remove trailing whitespace 2016-04-21 09:36:22 +10:00
Rohan Mitchell
d45b525497 When there's an out of stock product in the cart, placing order returns user to the cart 2016-04-21 09:36:22 +10:00
Rohan Mitchell
243f59c87d When there's an out of stock product in the cart, checkout returns user to cart 2016-04-21 09:36:22 +10:00
Rohan Mitchell
9e321a63c0 Don't put master in order cycle - we don't do that no more 2016-04-21 09:36:22 +10:00
Lynne
f986c5898e Updating en-GB file to reflect recent additions (#909) 2016-04-16 12:23:26 +10:00
Lynne Davis
8dd2d17cd5 Merge branch 'uk/trial-length' of https://github.com/openfoodfoundation/openfoodnetwork into uk/trial-length 2016-04-15 18:51:14 +01:00
Lynne Davis
a0e9163d27 Reverting clever syntax since I clearly don't understand it 2016-04-15 18:50:37 +01:00
Lynne Davis
cc7d27b030 fixing conflicts 2016-04-15 17:05:18 +01:00
Lynne Davis
cbd0ace098 Code tidying and currency symbol internationalisation 2016-04-15 16:56:09 +01:00
Lynne Davis
6884f5533e Missing Specs 2016-04-15 16:56:09 +01:00
Lynne Davis
30ed6df38d Adding super admin configuration for the minimum billable turnover functionality 2016-04-15 16:56:09 +01:00
Lynne Davis
240be2be0f Updating specs to explore the cases around zero turnover with fixed rate and minimum billable turnover 2016-04-15 16:56:09 +01:00
Lynne Davis
ae88a9c2e1 Updating spec with minimum_billable_turnover preference 2016-04-15 16:56:09 +01:00
Lynne Davis
af4c8bee94 Adding preference def for minimum_billable_turnover 2016-04-15 16:56:09 +01:00
Lynne Davis
44ac44e1dd Updating Bill Calculator to include a minimum billable turnover. Shopfronts are not charged if their tunrover is under the minimum billable. 2016-04-15 16:55:07 +01:00
Lynne Davis
4033a78887 Removing incorrect angular watch 2016-04-15 16:55:07 +01:00
Lynne Davis
51629cd0c0 Adding translations for shop front trials 2016-04-15 16:55:06 +01:00
Lynne Davis
4fc33c7da2 Fixing wild typo 2016-04-15 16:51:07 +01:00
Lynne Davis
abfb8149d9 Adding configurable Shop Trial Length in business model 2016-04-15 16:51:07 +01:00
Lynne Davis
a1ebd18b7c Updating en-GB file to reflect recent additions 2016-04-15 10:55:31 +01:00
Steve Pettitt
0b820361de Merge master 2016-04-15 08:29:52 +01:00
Steve Pettitt
fc719230a3 Add failed payments, update spec 2016-04-15 08:26:12 +01:00
Maikel Linke
49febc6333 Store customer email as lower case 2016-04-15 15:35:43 +10:00
Maikel Linke
48f1794d70 Allow admin user to create customers 2016-04-15 14:34:29 +10:00
Maikel Linke
e17b609517 Apply code standards 2016-04-15 14:31:54 +10:00
Maikel Linke
a25f4fdf44 Associate new users with existing customer records 2016-04-15 11:57:18 +10:00
Maikel Linke
831df0b222 Create and delete customers in admin interface
Removed Customers service and extended CustomerResource.
2016-04-15 11:12:22 +10:00
Maikel Linke
ecd32819a6 Remove unused matcher 2016-04-15 11:12:22 +10:00
Maikel Linke
9e4610f9bd Customers: enable change of hub if no customers
Fix #588.

And show search bar even when no customers are shown. Previously, the
search bar disappeared when you entered a search without results.
2016-04-15 11:12:22 +10:00
Maikel Linke
df5b554f24 Merge branch 'issue-878' of https://github.com/elf-pavlik/openfoodnetwork into locale-patches 2016-04-15 09:49:14 +10:00
Maikel Linke
ef0d6bd4d6 Merge branch 'master' of github.com:openfoodfoundation/openfoodnetwork into state_translation_override
Conflicts:
	spec/lib/open_food_network/order_cycle_management_report_spec.rb
2016-04-15 08:27:09 +10:00
elf Pavlik
f15e948085 small i18n fixes #878 2016-04-14 16:10:21 -05:00
Rohan Mitchell
53e6d391e3 Fix intermittent fail on insignificant result ordering 2016-04-14 09:40:55 +10:00
Maikel Linke
a2c58c7ca1 Match array without order in ocm spec
That spec was randomly failing.
2016-04-13 16:59:54 +10:00
Maikel Linke
0ac87b9e55 Override spree_i18n payment_state, shipment_state 2016-04-13 16:50:01 +10:00
Rohan Mitchell
59b564c4be Report job queue status via API 2016-04-13 16:48:24 +10:00
Rohan Mitchell
193580d5d9 Enqueue jobs directly via SQL rather than loading full Rails stack 2016-04-13 16:48:24 +10:00
Rohan Mitchell
eb846e27fd Run a job queue heartbeat every 5 minutes 2016-04-13 16:48:24 +10:00
Maikel Linke
e3ed831e30 Merge branch 'state_translation_override' of https://github.com/stveep/openfoodnetwork into state_translation_override 2016-04-13 16:42:28 +10:00
Maikel Linke
e6b1d545a3 Merge branch 'default-logos' of https://github.com/bingxie/openfoodnetwork into default-logos 2016-04-13 15:12:01 +10:00
Steve Pettitt
b79b0d7586 Merge branch 'master' of https://github.com/openfoodfoundation/openfoodnetwork into uk/state_translation_override 2016-04-11 22:31:56 +01:00
Steve Pettitt
39e3374ece Add comment 2016-04-11 22:27:47 +01:00
Steve Pettitt
1483023769 Add a sweet warning sign 2016-04-10 22:48:38 +01:00
Steve Pettitt
bc048a943c Show all payments, format unsuccessful payments grey, add 'invalid' translation. 2016-04-10 22:23:39 +01:00
Steve Pettitt
4414a3f287 Fix spelling mistake 2016-04-09 10:05:45 +01:00
Steve Pettitt
27fdfb60af Override incorrect Spree GB translations for state/county 2016-04-09 09:41:21 +01:00
Bing Xie
852dce2dff Add default logos and home_hero 2016-04-08 14:41:44 +10:00
Maikel Linke
b050f27a84 Default logos for new installations 2016-04-06 16:10:32 +10:00
Rob Harrington
44077a2c6f Fixing styling (bottom margin for save-bar) on inventory page 2016-04-06 15:43:55 +10:00
Rob Harrington
0ed97d820c Removing unrequired Spree::Order#with_payment_method_name scope 2016-04-02 01:04:09 +11:00
Rob Harrington
9b5bfdeb00 Allowing Order Management Report to filter by multiple payment / shipping methods at once
Also switched to using id rather than name to filter
2016-04-02 01:04:09 +11:00
Lynne Davis
f8e3f29d1a More bug fixes. Spec updated to reflect changes 2016-04-02 01:04:09 +11:00
Lynne Davis
d844dc8e1b Bug fixes to Order Cycle Reports 2016-04-02 01:04:09 +11:00
Rob Harrington
6c5aaef86e Removing ability to create order discount rules
Issue with application of tax to discounted items is yet to be resolved
2016-04-01 21:31:36 +11:00
Rob Harrington
d8c17d160a Applying shipping method rules in checkout 2016-04-01 19:48:25 +11:00
Rob Harrington
c099711f97 Removing dialogOptions library, not required anymore 2016-04-01 19:48:25 +11:00
Rob Harrington
d278b72289 Updating Tag Rules UI to allow management of new FilterShippingMethods rule type 2016-04-01 19:48:25 +11:00
Rob Harrington
82bc26fe90 Splitting tag rule feature specs out into their own spec file 2016-04-01 19:48:25 +11:00
Rob Harrington
47df106237 Refactor tragsWithTranslation directive to handle dynamic attr names 2016-04-01 19:48:25 +11:00
Rob Harrington
f70b1f4572 Refactoring tag rule model and adding new rule type: FilterShippingMethod 2016-04-01 19:48:25 +11:00
Rob Harrington
ed134bac84 Removing unrequired initSelection option from ofn-select2 2016-04-01 19:48:25 +11:00
Rob Harrington
33aad10e73 Adding dialogOptions library for adding responsiveness to jquery dialog 2016-04-01 19:48:25 +11:00
Rob Harrington
3d78b375c6 Moving angularjs tag rule logic into its own module 2016-04-01 19:48:25 +11:00
Rob Harrington
f9acee2be4 Shipping methods can be tagged 2016-04-01 19:48:25 +11:00
Rob Harrington
86c80124fc Moving tags-with-translation directive to admin.utils 2016-04-01 19:48:25 +11:00
Rob Harrington
443e232ea4 Renaming angular admin.shipping_methods and admin.payment_methods modules 2016-04-01 19:48:25 +11:00
Rob Harrington
c74c274a9e Renaming shippingMethodCtrl to shippingMethodsCtrl 2016-04-01 19:48:25 +11:00
Rob Harrington
f902474591 Relevant DiscountOrder tag rules are applied to orders on update 2016-04-01 19:48:25 +11:00
Rob Harrington
bf72864c2b Tag Rules can be deleted 2016-04-01 19:48:25 +11:00
Rob Harrington
4c2552e0bf Enterprise users can create tag rules 2016-04-01 19:48:25 +11:00
Rob Harrington
066190c16f First cut at an interface for updating tag rules 2016-04-01 19:48:25 +11:00
Rob Harrington
3aea387b9a First iteration of a model for tag rules 2016-04-01 19:44:17 +11:00
Maikel Linke
d12c486dd2 Use new spree_paypal_express branch to hide password 2016-04-01 15:48:21 +11:00
Maikel Linke
97bcbb81b9 Change text of register call in the dropdown
Unified code for the dropdown and the footer.
Both contain the register call and are both pointing to the register
path now. The footer still pointed to the global site before.
2016-04-01 14:39:43 +11:00
Maikel Linke
04f661f646 Merge branch 'master' of github.com:openfoodfoundation/openfoodnetwork into hide-closed-shops
Conflicts:
	config/locales/en.yml
2016-04-01 13:02:53 +11:00
Maikel Linke
c4f92fd4cc Hide closed shops by default, add "show" button 2016-04-01 11:45:24 +11:00
Maikel Linke
813dff8af2 Merge branch 'master' of github.com:openfoodfoundation/openfoodnetwork into require-login 2016-04-01 11:04:36 +11:00
Maikel Linke
db0b345241 Add "Show all on map" button under shops 2016-03-31 15:24:43 +11:00
Maikel Linke
21be27d722 Remove duplicate filtering of visible enterprises
Increase readability of enterprises_controller.js.coffee.
2016-03-31 15:00:22 +11:00
Maikel Linke
3d31a37dd3 Remove unused method Enterprise::find_near 2016-03-31 15:00:22 +11:00
Maikel Linke
17f168ed06 Merge branch 'master' of github.com:openfoodfoundation/openfoodnetwork into uk/account-balances
Applied code conventions.

Conflicts:
	config/locales/en.yml
2016-03-30 13:30:44 +11:00
Maikel Linke
de35940341 Apply coding standards 2016-03-30 09:45:45 +11:00
stveep
d67db76b88 Formatting credit/debit green/red 2016-03-28 20:35:14 +01:00
stveep
5a6caa294e Revert to Arel query and separate filtering 2016-03-28 20:13:30 +01:00
Maikel Linke
c4f499d518 Allow admins and managers to see restricted shops 2016-03-25 12:04:26 +11:00
Lynne Davis
7b75fab7a1 Code tidying and currency symbol internationalisation 2016-03-24 16:57:56 +00:00
Maikel Linke
5149c5118b Change text and style for shops requiring login 2016-03-24 21:42:21 +11:00
Maikel Linke
df36386757 Require customer instead of user
If a shop requires a login, then a customer needs to be logged in, not
just any user.
2016-03-24 18:24:46 +11:00
Maikel Linke
31302fb930 Translate unsaved products message correctly 2016-03-23 17:57:22 +11:00
Maikel
d51cfccd7e Auto-merged master into i18n-hackathon on deployment. 2016-03-23 10:09:36 +11:00
Maikel Linke
79ad05d405 i18n group image help text 2016-03-23 10:01:04 +11:00
elf Pavlik
6d0dc438a7 i18n fixes after @sstead feedback in #799 2016-03-21 16:55:57 -06:00
Maikel
ca0c677d46 Auto-merged master into uk/account-balances on deployment. 2016-03-19 07:16:41 +11:00
Steve Pettitt
276d3026c8 Adding specs for orders by ditributor query 2016-03-18 20:05:52 +00:00
Maikel Linke
41970ecf07 Use auth directive for Login button
Use the auth directive instead of the AuthenticationCtrl for the Login
button in the menu and on checkout.
2016-03-18 17:08:32 +11:00
Maikel Linke
2a9e35355e Add auth directive to use AuthenticationService
The auth directive binds to all elements with the auth attribute. It
adds a click event that opens the login/register/password modal.
2016-03-18 16:46:29 +11:00
Maikel Linke
a48b992ec0 Shops can require users to login
Enterprise users have a new option to restrict their shopfronts to
logged in users only. If a guest visits one of these shopfornts, the
guest is prompted to login and is not shown any products.

Closes #849.
2016-03-18 16:46:28 +11:00
Maikel Linke
599e39ce16 Merge branch 'master' of github.com:openfoodfoundation/openfoodnetwork into uk/filter-producers-for-map 2016-03-18 13:41:45 +11:00
Maikel Linke
d07daede68 Merge remote-tracking branch 'origin/master' into uk/filter-producers-for-map 2016-03-18 11:04:42 +11:00
Rohan Mitchell
16741598fd Merge branch 'master' into products-caching
Conflicts:
	spec/features/admin/variant_overrides_spec.rb
2016-03-18 09:59:56 +11:00
Lynne Davis
56a6593dd6 Missing Specs 2016-03-17 13:40:25 +00:00
Lynne Davis
096962b778 Adding super admin configuration for the minimum billable turnover functionality 2016-03-17 12:54:03 +00:00
Lynne Davis
2d97bc49bd Updating specs to explore the cases around zero turnover with fixed rate and minimum billable turnover 2016-03-17 12:36:38 +00:00
Lynne Davis
da10b5decf Updating spec with minimum_billable_turnover preference 2016-03-17 12:24:34 +00:00
Lynne Davis
430c6c0642 Adding preference def for minimum_billable_turnover 2016-03-17 12:22:27 +00:00
Lynne Davis
bfaefa4dc9 Updating Bill Calculator to include a minimum billable turnover. Shopfronts are not charged if their tunrover is under the minimum billable. 2016-03-17 11:15:06 +00:00
Lynne Davis
b43e770420 Removing incorrect angular watch 2016-03-16 14:17:43 +00:00
Lynne Davis
3a083723f0 Merge branch 'uk/trial-length' of https://github.com/openfoodfoundation/openfoodnetwork into uk/trial-length 2016-03-16 12:36:25 +00:00
Lynne Davis
ba49a5a783 Adding translations for shop front trials 2016-03-16 12:35:45 +00:00
Maikel
4adf332480 Auto-merged master into uk/trial-length on deployment. 2016-03-16 22:42:50 +11:00
Lynne Davis
d9d5d9cda5 Fixing wild typo 2016-03-16 11:38:00 +00:00
Lynne Davis
a4efd3d44c Adding configurable Shop Trial Length in business model 2016-03-16 11:35:31 +00:00
Maikel Linke
6eb6a01339 Filter incomplete payments on database level
Using explicit `LEFT OUTER JOIN ... ON ...` to query only completed
payments for the order overview of consumers.

They were filtered in Ruby before.
2016-03-16 11:12:09 +11:00
Maikel
388b25ddf9 Auto-merged master into uk/account-balances on deployment. 2016-03-12 09:11:42 +11:00
Steve Pettitt
e81ef564e3 Capitalize Spree state translations 2016-03-11 22:01:09 +00:00
Steve Pettitt
e1fdd3a210 Apply style guide 2016-03-11 21:59:22 +00:00
Maikel Linke
2546603a67 Remove what_is_this from locale
It got replaced by admin.whats_this.
Changed views to use the new key.
2016-03-11 17:08:13 +11:00
Maikel Linke
e81343c8e4 Merge remote-tracking branch 'origin/master' into i18n-hackathon 2016-03-11 16:50:48 +11:00
Maikel Linke
51f94119ff Restore links_dropdown 2016-03-11 16:39:07 +11:00
Maikel Linke
ac88817a34 Add translation for unsaved_changes_warning 2016-03-11 15:46:29 +11:00
Maikel Linke
2a3b3b6dd2 Merge remote-tracking branch 'origin/master' into i18n-hackathon
Conflicts:
	app/assets/javascripts/admin/enterprise_fees.js
	app/assets/javascripts/admin/enterprises/controllers/side_menu_controller.js.coffee
	app/views/admin/shared/_columns_dropdown.html.haml
	app/views/admin/variant_overrides/_header.html.haml
	app/views/admin/variant_overrides/_products.html.haml
	spec/features/admin/bulk_order_management_spec.rb
	spec/features/admin/variant_overrides_spec.rb
2016-03-11 15:38:28 +11:00
Maikel Linke
711f525d98 Remove   from locale en.yml 2016-03-11 14:45:43 +11:00
Maikel Linke
21a7942de6 Merge remote-tracking branch 'origin/master' into indicate-required-fields-for-new-enterprise-form 2016-03-11 14:14:45 +11:00
Maikel Linke
b7320a0bd7 Translate "Price" in Bulk Order Management 2016-03-11 12:48:35 +11:00
Maikel Linke
5225686d8f Re-merge bulk order view 2016-03-11 12:23:12 +11:00
Maikel Linke
3e5f53b082 Rename i18n key what_is_this 2016-03-11 12:13:17 +11:00
Maikel Linke
3595685f9a Merge text change in LineItemsCtrl into en.yml 2016-03-11 11:46:06 +11:00
Steve Pettitt
b324207121 Merge current master 2016-03-10 21:48:13 +00:00
Steve Pettitt
fe3c0b8d29 Move data processing to model, add payment method preload 2016-03-10 21:42:42 +00:00
Maikel Linke
02cc5adf78 Revert false HAML indent 2016-03-09 19:04:37 +11:00
Maikel Linke
02cbad2697 Remove duplicate lines from merging 2016-03-09 18:49:35 +11:00
Maikel Linke
071ee9ab54 Add brackets to t call in js line items controller
The missing brackets made all columns of the bulk order management
invisible.

Also removed trailing whitespaces.
2016-03-09 18:39:23 +11:00
Maikel Linke
61fb34e738 Use user's email address as enterprise.email
During registration, use the given email address only as public visible
profile email address. Set the internal notification email address
`enterprise.email` to the owner's email address. That can be changed
later.
2016-03-09 14:52:52 +11:00
Maikel
f2c8ea9722 Auto-merged master into uk/account-balances on deployment. 2016-03-09 14:43:05 +11:00
Maikel Linke
b6406b54b4 Apply code style 2016-03-09 14:40:04 +11:00
Maikel Linke
9ce5c45799 Update gem nokogiri to 1.6.7.2
Previous versions had security vulnerabilities. See:
http://rubysec.com/advisories/CVE-2015-5312/
2016-03-09 14:34:25 +11:00
Maikel Linke
f1cc3a7b0d Apply code style following Rubocop 2016-03-09 14:32:41 +11:00
Maikel Linke
d925c2aefc Translate Spree payment, shipment and order states
- Copied translations for payment_states, shipment_states and order_states
into locale en.yml.

- Enabled global Javascript function `translate` to deal with scopes like
'spree.shipment_states'.

- Removed `humanize` call from order serializer and added translation
scopes to accounts page.

- Test OrderSerializer for untranslated attributes

- Require spec helper in serializer specs
2016-03-09 14:29:54 +11:00
Rohan Mitchell
7e65b3176d Add retry to failing payment method spec 2016-03-09 14:20:48 +11:00
Rohan Mitchell
9645ec727b Refresh products cache when inventory items are changed 2016-03-09 14:07:04 +11:00
Rohan Mitchell
6f29a8b642 Refresh cache when inventory setting product_selection_from_inventory_only is changed 2016-03-09 13:29:33 +11:00
Rohan Mitchell
27d7b3026b Move OpenFoodNetwork::ProductsCacheIntegrityChecker.active_exchanges to Exchange model 2016-03-09 12:28:09 +11:00
Maikel Linke
c1647ccd2c Set public enterprise.email_address at registration
Sets the public email address to the given email address as well as the
internal enterprise.email (notification email address).

The field is not mandatory any more since enterprise.email is populated
from the owner's email address if no value was given.
2016-03-04 17:50:04 +11:00
Maikel Linke
28e2d4041f Hide create-enterprise-group button from non-admins
Only admin users can create groups. The button was still displayed for
users that owned a group.

Unused HTML attributes were removed from that button as well.
2016-03-04 14:24:24 +11:00
Rohan Mitchell
780ec598d6 Use preferred_currency instead of preferences[:currency]. Use constant for currency instead of config var.
Conflicts:
	spec/models/spree/shipping_method_spec.rb
2016-03-04 11:53:32 +11:00
Rohan Mitchell
73b53e02fc Exclude performance specs from CI, which were modifying Spree::Config.currency 2016-03-04 11:42:27 +11:00
Rohan Mitchell
1440544b2d Use persisted models 2016-03-04 11:41:49 +11:00
Maikel Linke
6300f87987 Use have_no_selector in VO spec 2016-03-04 10:23:13 +11:00
Rohan Mitchell
bc2223fb8e Fix intermittent spec fails: currency inconsistencies on CI and retry on VOs 2016-03-04 10:15:57 +11:00
Maikel Linke
b5d4f8b781 Merge remote-tracking branch 'origin/master' into groups 2016-03-04 09:36:46 +11:00
Steve Pettitt
939356ef26 Update spec with nulls 2016-03-03 07:18:49 +00:00
Steve Pettitt
4966290f87 Check missing lat/long instead of zero 2016-03-03 06:41:59 +00:00
Rohan Mitchell
422061f137 Merge branch 'master' into products-caching
Conflicts:
	app/controllers/shop_controller.rb
	app/models/enterprise_fee.rb
	app/models/order_cycle.rb
	app/models/variant_override.rb
	db/schema.rb
	lib/open_food_network/products_renderer.rb
	spec/lib/open_food_network/products_renderer_spec.rb
2016-03-03 09:42:52 +11:00
Rohan Mitchell
7e6d544180 Do not serialize product count_on_hand - reduce coupling between variant create and products JSON 2016-03-03 09:33:32 +11:00
Steve Pettitt
c1d068aeb9 Add/modify karma specs 2016-03-02 20:07:39 +00:00
Steve Pettitt
6a2319e16d Remove producers without lat + long from map 2016-03-02 19:08:57 +00:00
Rob Harrington
0d65838e5d Adding a second migration to auto-add variants to inventories
(I stuffed up the first one, oops)
2016-03-02 17:09:39 +11:00
Maikel Linke
587d06dced Merge remote-tracking branch 'origin/master' into groups
Conflicts:
	db/schema.rb
2016-03-02 15:31:35 +11:00
Rob Harrington
465649475d Revoke ability to overide variants based on shared management/ownership (ie. only explicit permissions) 2016-03-02 12:10:49 +11:00
Rob Harrington
aff346071f Automatically selecting a hub on inventory page when it is the only option 2016-03-02 12:10:49 +11:00
Rob Harrington
3f466e86b6 Renaming 'Override Variant Details' permission to 'Add Products To Inventory'
Style changes to make enterprise relationships page more useable
2016-03-02 12:10:49 +11:00
Rob Harrington
4bf27982f4 Applying variant override permissions when they are added or removed
Also remove variant overrides with revoked permissions from the default scope
2016-03-02 12:10:49 +11:00
Rob Harrington
8e1b4e299c Adding column 'permission_revoked_at' to VOs
And a migration to flag any VOs which should not be permitted, update previous migration so that new enterprise relationships don't try to revoke variant overrides
2016-03-02 12:10:49 +11:00
Rob Harrington
51d77d5781 Adding migration to explicitly grant VO permission where it is currently implicitly granted via managers/owners
In preparation for removing implicitly granted permissions
2016-03-02 12:10:49 +11:00
Rob Harrington
186d1c1f26 Revoking ability to create variant overrides via OC permission 2016-03-02 12:10:49 +11:00
Rob Harrington
e00fe824ac Updating text for inventory only product selection setting for enterprises 2016-03-02 12:10:49 +11:00
Rob Harrington
b2657ddc72 Adding data migration to populate inventories of enterprises that are already using variant overrides 2016-03-02 12:10:49 +11:00
Rob Harrington
4de0a5c220 Renaming 'Variant Overrides' index page to 'Inventory' 2016-03-02 12:10:22 +11:00
Rob Harrington
ed40ebace6 Existing Exchange Variants must be explicitly set to true by form data to remain in an exchange when an order cycle is updated 2016-03-02 12:10:22 +11:00
Rob Harrington
1d83809866 Bugfix: Spree::Variant#not_hidden_for scope was broken
Was getting confused by presence of inventory items for other enterprises when none existed for a given variant/enterprise combo
2016-03-02 12:10:22 +11:00
Rob Harrington
6ee4e4190e New product count for inventory takes permissions into account 2016-03-02 12:10:22 +11:00
Rob Harrington
f280b96215 Hiding a variant from inventory prevents it being available on the shopfront
User preferences around inventory-only product selection immediately affect the shopfront
2016-03-02 12:10:22 +11:00
Rohan Mitchell
e16ca82e76 Extract product JSON rendering to lib class. Fix HTML stripping that never actually worked. 2016-03-02 12:10:22 +11:00
Rob Harrington
77e74c5642 OC Coordinators can opt to restrict products in an order cycle to those in their inventory only 2016-03-02 12:10:22 +11:00
Rob Harrington
f288c09380 Moving inventory settings to their own section within the enterprise edit form 2016-03-02 12:10:22 +11:00
Rob Harrington
488daed8f3 Translating variant overrides / inventory page 2016-03-02 12:10:22 +11:00
Rob Harrington
f05f88c1cb Adding global config to allow shop users to only select from inventory variants in OC interface 2016-03-02 12:10:22 +11:00
Rob Harrington
28b143da73 WIP: Splitting Variant overrides into views 2016-03-02 12:10:22 +11:00
Rob Harrington
8f37aa0522 WIP: Adding Loading flash to variant overrides page 2016-03-02 12:10:22 +11:00
Rob Harrington
7008d26f68 WIP: Alerting user to presence of new variant for inventory, new variants can be filtered + limited 2016-03-02 12:10:22 +11:00
Rob Harrington
f06d909c23 WIP: Adding infrastructure to show/hide variants + overrides using inventory items 2016-03-02 12:10:22 +11:00
Rob Harrington
095b420997 WIP: Adding InventoryItem model for managing contents of inventories 2016-03-02 12:10:22 +11:00
Rob Harrington
59745fbc73 EnterpriseFees can inherit tax_category from product 2016-03-02 11:56:46 +11:00
Rob Harrington
caa8818f02 Adding option to 'Inherit From Product' for enterprise_fee tax categories 2016-03-02 11:56:46 +11:00
Rob Harrington
a66582a8fb WIP: Using directive for EnterpriseFee index select elements, to properly bind data to the model 2016-03-02 11:56:46 +11:00
Rob Harrington
0bd9dc7af0 Enterprise Fees: Splitting ng controllers and directives into separate files, reanming module and coffee-ising 2016-03-02 11:56:46 +11:00
Rob Harrington
69ee1a98a7 EnterpriseFeeCalculator return empty list when retrieving applicators without distributor or order_cycle being present 2016-03-02 11:56:46 +11:00
Rob Harrington
137003c671 Correct calculation of tax on EnterpriseFees with TaxRates where included_in_price=false 2016-03-02 11:56:46 +11:00
Rohan Mitchell
4a7a40425a Fix problems in rake file 2016-03-02 11:38:42 +11:00
Maikel
81ec3fef60 Auto-merged master into products-caching on deployment. 2016-03-02 11:12:40 +11:00
Maikel Linke
7cb64e8804 Merge remote-tracking branch 'origin/master' into groups 2016-03-02 11:12:33 +11:00
Maikel Linke
39708d773d Merge branch 'transifex' into groups
Just to keep master up-to-date.
2016-03-02 11:11:43 +11:00
Rohan Mitchell
ec55af5b8a Display products cache integrity checker results on cache settings admin page 2016-03-02 11:05:03 +11:00
Rohan Mitchell
2abee3fcdd Extract integrity checking to lib class 2016-03-02 11:01:41 +11:00
Maikel Linke
23a1c2a772 Remove scroll bar from enterprise modal description
Multiple scroll bars within a modal were confusing. The inner scroll bar
for the long enterprise description got removed. The general modal
scroll bar persists.

Fix #806 Full profile modal about section copy display improvement
2016-03-02 10:42:40 +11:00
Rohan Mitchell
f394cf559c Fix integrity checker rake task name 2016-03-02 08:49:36 +11:00
elf Pavlik
54ecdb670d fixed failing i18n test in variant overrides 2016-02-28 19:58:16 +00:00
elf Pavlik
68db9b9926 fixing faling tests 2016-02-28 19:58:03 +00:00
Nicolas Blanc
cb33ede9dc Revert "elf-pavlik@ee52f1d"
This reverts commit a8d7732a39.
2016-02-28 19:54:44 +00:00
Nicolas Blanc
a8d7732a39 elf-pavlik@ee52f1d 2016-02-28 19:23:26 +00:00
Maikel Linke
1770cbb6bf Display footer_email in confirmation emails correctly
A bug introduced in a9c37c162e caused the
creation of confirmation emails for shops to fail. The email template
got fixed now and the email address from the database is displayed if
present.
2016-02-26 16:09:14 +11:00
Rohan Mitchell
21ce7ab30a Fix integrity checker error message, add task to warm products cache 2016-02-26 13:04:55 +11:00
Rohan Mitchell
d89e9620ac Fix output of cache integrity checker errors 2016-02-26 12:05:49 +11:00
Rohan Mitchell
45a7b13e9a Refresh cache when option type destroyed 2016-02-26 10:09:16 +11:00
Rohan Mitchell
8928e461d4 Refresh cache when option type changed 2016-02-26 09:59:16 +11:00
Nicolas Blanc
4621f625a0 new validation6 02/25/2016 2016-02-25 12:36:21 +00:00
Nicolas Blanc
5e71790cd1 new validation5 02/25/2016 2016-02-25 11:04:21 +00:00
Rohan Mitchell
b5204a4820 Refresh cache when option value changed or destroyed 2016-02-25 11:08:53 +11:00
Steve Pettitt
b84f49a1c3 Satisfy style police 2016-02-24 20:39:26 +00:00
Steve Pettitt
8e88cd6255 Localise dates 2016-02-24 20:33:37 +00:00
Steve Pettitt
c07fefde1a Change non-js translations to be done in rails 2016-02-24 20:23:13 +00:00
Maikel Linke
098d313163 Using should syntax in payment method spec 2016-02-24 16:33:31 +11:00
Maikel Linke
a7e3b2d9df Update enterprise email tests 2016-02-24 16:21:18 +11:00
Rohan Mitchell
71862e00a7 Perform products cache refresh when producer property changed or destroyed 2016-02-24 16:11:59 +11:00
Maikel Linke
68f3d0951a Merge branch 'groups' into indicate-required-fields-for-new-enterprise-form
Conflicts:
	app/views/admin/enterprises/_new_form.html.haml
2016-02-24 15:36:25 +11:00
Maikel Linke
4feb7c893b Introduce contact email address for enterprises
Add a new column email_address to enterprises.
Use this new field for public display of contact details.
The old field enterprise.email is still used internally.
It is still displayed on orders and emails sent to customers.
A new enterprise has the owner's email address by default now.

Fix GH #757
2016-02-24 15:14:07 +11:00
Rohan Mitchell
1b62dd06b8 Add products cache integrity checker 2016-02-24 15:05:03 +11:00
Rohan Mitchell
687fb6f0aa Enqueue RefreshProductsCacheJob with lower than default priority 2016-02-24 15:05:03 +11:00
Rohan Mitchell
98961fef74 Trigger cache refresh when producer property changed or destroyed 2016-02-24 15:05:03 +11:00
Rohan Mitchell
8b070fddbb Refresh products cache when exchange fee is changed or destroyed 2016-02-24 15:05:03 +11:00
Rohan Mitchell
8af6866ae4 Refresh products cache when exchange is changed or destroyed 2016-02-24 15:05:03 +11:00
Rohan Mitchell
146797ea61 Generalise method for reuse 2016-02-24 15:05:03 +11:00
Rohan Mitchell
8bd5a36aaf Remove enterprise fee destruction cache callback - responsibility to be handled by dependent models 2016-02-24 15:05:03 +11:00
Rohan Mitchell
a64a501dbb Smarter job queuing: Do not enqueue a RefreshProductsCacheJob if there's already one waiting to run 2016-02-24 15:05:03 +11:00
Rohan Mitchell
0a90a48b04 Refresh products cache when coordinator fees are changed or destroyed 2016-02-24 15:05:03 +11:00
Rohan Mitchell
540687515e Reify coordinator_fees HABTM join table as CoordinatorFee model using HMT 2016-02-24 15:05:03 +11:00
Rohan Mitchell
62c6530ca9 Do not refresh products cache when price destroyed - variant destruction is main (only?) trigger, it causes refresh 2016-02-24 15:05:03 +11:00
Rohan Mitchell
f78826c9c7 Fix rare case where price is saved without variant 2016-02-24 15:05:03 +11:00
Rohan Mitchell
2f602f2a57 Shop controller uses CachedProductsRenderer 2016-02-24 15:05:02 +11:00
Rohan Mitchell
fa543fed63 Deal with unset distribution 2016-02-24 15:05:02 +11:00
Rohan Mitchell
235c463849 Hide wrapped exception, too 2016-02-24 15:05:02 +11:00
Rohan Mitchell
ff493c21d4 Log a warning on cache MISS 2016-02-24 15:05:02 +11:00
Rohan Mitchell
d0b7b4ee50 Add CachedProductsRenderer - wraps ProductsRenderer using Rails cache 2016-02-24 15:05:02 +11:00
Rohan Mitchell
339f3fc2f0 Refresh products cache when price is changed or destroyed 2016-02-24 15:05:02 +11:00
Rohan Mitchell
d8d803546b Refresh products cache when master variants or images are changed or destroyed 2016-02-24 15:05:02 +11:00
Rohan Mitchell
6d80d91873 Refresh products cache when taxons or classifications are changed or destroyed 2016-02-24 15:05:02 +11:00
Rohan Mitchell
7c4e9e5838 Refresh products cache when product properties are changed 2016-02-24 15:05:02 +11:00
Rohan Mitchell
f756749e02 Fix specs 2016-02-24 15:05:02 +11:00
Rohan Mitchell
3bcd3257a1 Perform refresh of products cache when supplier fee is changed 2016-02-24 15:05:02 +11:00
Rohan Mitchell
fbedff4eca Perform refresh of products cache when distributor fee is changed 2016-02-24 15:05:02 +11:00
Rohan Mitchell
af7e3380d3 Perform refresh of products cache when coordinator fee is changed 2016-02-24 15:05:02 +11:00
Rohan Mitchell
0c65d1ddd8 Trigger products cache refresh when enterprise fee changed or destroyed 2016-02-24 15:05:02 +11:00
Rohan Mitchell
378a703cc3 Order cycles are undated unless they have both open and close dates defined 2016-02-24 15:05:02 +11:00
Rohan Mitchell
fe41430d1e Rerefesh products cache when an order cycle is changed 2016-02-24 15:05:02 +11:00
Rohan Mitchell
1ec329284c Refresh products cache when a variant override is destroyed 2016-02-24 15:05:02 +11:00
Rohan Mitchell
b7a88fd03b Perform refresh of products cache for variant override change 2016-02-24 15:05:02 +11:00
Rohan Mitchell
5f188650d8 Trigger cache refresh on VariantOverride save/destroy 2016-02-24 15:05:01 +11:00
Rohan Mitchell
c98e44c5a1 Perform refresh of products cache on product change 2016-02-24 15:05:01 +11:00
Rohan Mitchell
0c0c98a0b0 Refresh products cache on product change 2016-02-24 15:05:01 +11:00
Rohan Mitchell
6d39cc39c6 When a variant is destroyed, update product cache 2016-02-24 15:05:01 +11:00
Rohan Mitchell
a0a61b65cb Refresh the appropriate product caches when a variant is changed 2016-02-24 15:05:01 +11:00
Rohan Mitchell
5d20b4fb51 Add OrderCycle scopes: not_closed, dated 2016-02-24 15:05:01 +11:00
Rohan Mitchell
3621c34bd5 Job calls ProductsRenderer with object instances rather than ids 2016-02-24 15:05:01 +11:00
Rohan Mitchell
eba636c929 When variant is changed/destroyed, trigger product cache refresh 2016-02-24 15:05:01 +11:00
Rohan Mitchell
0d0eb6117f Add job to cache products JSON 2016-02-24 15:05:01 +11:00
Rohan Mitchell
6df8f73bb0 Make method naming more explanatory 2016-02-24 15:05:01 +11:00
Rohan Mitchell
b0207f2b49 Clean up specs 2016-02-24 15:05:01 +11:00
Rohan Mitchell
920d3bb974 Do not show knapsack time offset warnings unless in CI 2016-02-24 15:05:01 +11:00
Rohan Mitchell
0d5d015d88 Extract product JSON rendering to lib class. Fix HTML stripping that never actually worked. 2016-02-24 15:05:01 +11:00
Rohan Mitchell
6193bb896b Sanitize input for ofnTaxonAutocomplete and userSelect directives 2016-02-24 11:26:38 +11:00
Rohan Mitchell
4314bfb99c Fix karma fail due to file load order change 2016-02-24 11:26:38 +11:00
Rohan Mitchell
ae03170984 Sanitize input for ofn-select2 2016-02-24 11:26:38 +11:00
Rohan Mitchell
977ff7b35d Fix compatibility issues with new version of select2 2016-02-24 11:26:37 +11:00
Rohan Mitchell
1e288e5f14 Further styling for select2 after upgrade 2016-02-24 11:26:37 +11:00
Rohan Mitchell
9747b0cf96 Upgrade select2-rails 2016-02-24 11:26:37 +11:00
Rohan Mitchell
258e84fc0a Replace with-tip with ofn-with-tip: misc 2016-02-24 11:26:37 +11:00
Rohan Mitchell
17cda86dfa Replace with-tip with ofn-with-tip: enterprise groups 2016-02-24 11:26:37 +11:00
Rohan Mitchell
bdd6d3ba6b Replace with-tip with ofn-with-tip: business model configuration 2016-02-24 11:26:37 +11:00
Rohan Mitchell
d699f8321a Replace with-tip with ofn-with-tip: dashboard 2016-02-24 11:26:37 +11:00
Rohan Mitchell
b4976a5445 Replace with-tip with ofn-with-tip: enterprise forms 2016-02-24 11:26:37 +11:00
Rohan Mitchell
e2722710de Clean up syntax 2016-02-24 11:26:37 +11:00
Rohan Mitchell
45d4dd6b88 Add ofnWithTip directive to sanitise HTML going into tooltips 2016-02-24 11:26:37 +11:00
Rohan Mitchell
d79a6d7e19 Escape HTML entities in JSON 2016-02-24 11:26:37 +11:00
Rohan Mitchell
6a2e07064b Fix stomped spree JS file 2016-02-24 11:26:37 +11:00
Nicolas Blanc
52d5b8936e new validation4 02/22/2016 2016-02-22 14:54:31 +00:00
Nicolas Blanc
c91eb9f345 new validation3 02/22/2016 2016-02-22 14:31:31 +00:00
Nicolas Blanc
44508f0f1e new validation2 02/22/2016 2016-02-22 13:38:19 +00:00
Nicolas Blanc
1738db9e1f new validation 02/22/2016 2016-02-22 13:00:27 +00:00
Steve Pettitt
f7387048b0 Remove cruft and 2nd active table, to stop constant hover 2016-02-21 12:40:53 +00:00
Steve Pettitt
92cfcb8fc9 remove debug statement 2016-02-20 21:22:10 +00:00
Nicolas Blanc
614f83799e new test 2016/02/20 2016-02-20 19:23:22 +00:00
Steve Pettitt
d39b62aa31 Fallback to a default tractor logo if missing 2016-02-20 19:00:37 +00:00
Steve Pettitt
ec3e158781 Merge current master 2016-02-20 17:24:57 +00:00
Steve Pettitt
d5e51dada6 Don't serialize payment ID (not used) 2016-02-20 17:22:26 +00:00
Steve Pettitt
23e774bede Styling, fewer columns in small/medium screen, logo resize 2016-02-20 17:20:43 +00:00
Maikel Linke
0cb5dfbbe0 delete old sidebar partials 2016-02-19 16:29:19 +11:00
Maikel Linke
6ba534fb58 Show noticeboard in mobile menu 2016-02-19 15:16:24 +11:00
Maikel Linke
38cac3a3c4 Explicitly referencing main_app.discourse_login_path
Fixes #830.
2016-02-19 11:23:38 +11:00
Maikel Linke
82182d24e7 Merge remote-tracking branch 'origin/master' into discourse-sso 2016-02-19 11:02:59 +11:00
stveep
83d248469f Running balances 2016-02-16 20:32:09 +00:00
Lynne Davis
2d620071f0 Fxing conflicts 2016-02-11 16:14:44 +00:00
Paul Mackay
50c657133a Change "&" to "and"
There are very few places where ampersands are appropriate.

Minor typo in footer.
2016-02-09 10:01:51 +00:00
Paul Mackay
fb7fb62f79 Add SCSS lint config 2016-02-09 06:11:13 +00:00
Paul Mackay
98e5df6aac Add Rubocop config file 2016-02-09 06:00:05 +00:00
Paul Mackay
ee168bcbfb Add codeclimate config file 2016-02-08 21:07:42 +00:00
Paul Mackay
8cdf2254d8 Fix to make shell block highlight correctly 2016-02-06 20:07:57 +00:00
Paul Mackay
57a929d718 #268: add notes in README about creating OFN user 2016-02-06 20:05:23 +00:00
Paul Mackay
2b0788ec9c #737: add link to dev wiki 2016-02-06 11:13:17 +00:00
Paul Mackay
c7f6d4e4fe Add Travis badge, link to wiki, UK contributors 2016-02-06 11:09:53 +00:00
Paul Mackay
979baf80dd Rename README to have consistent short file extension 2016-02-06 10:50:01 +00:00
Maikel Linke
3db79aa6b2 Prevent body from scrolling when a modal is open 2016-02-05 15:18:18 +11:00
Rob Harrington
2ebad800b2 Try again: using :site_meta_description for translation of global site meta description 2016-02-05 14:57:18 +11:00
Rob Harrington
dbe7fbc760 Using :meta_description for translation of global site description 2016-02-05 14:17:42 +11:00
Transifex-Openfoodnetwork
ad2e10c33e Updating translations for fr.yml and nb.yml 2016-02-05 14:17:42 +11:00
Maikel Linke
ac413937f3 Merge remote-tracking branch 'origin/master' into groups 2016-02-05 11:05:40 +11:00
Rohan Mitchell
48b02db70d Order cycles are undated unless they have both open and close dates defined 2016-02-05 09:27:25 +11:00
Maikel Linke
eef62d4128 fix hub filter style 2016-02-04 16:34:03 +11:00
Maikel Linke
f5ff5bd5b0 Merge remote-tracking branch 'origin/master' into groups 2016-02-04 16:12:57 +11:00
Maikel Linke
bd19bf5f3c Refactoring filter selectors
The FilterSelectorsService is now able to create multiple independent
lists of selectors. These lists are explicitly given to the
filter-selector directive.

For example a group's page has one set for the group's producers and one
set for the group's shops.
2016-02-04 16:08:19 +11:00
Steve Pettitt
0ad3d8f351 WIP: styling updates 2016-02-02 23:21:04 +00:00
Nicolas Blanc
2be005d344 i18n from berlin hackathon 2016-01-31 12:16:33 +00:00
Steve Pettitt
79808acd9f Merge branch 'uk/account-balances' of https://github.com/openfoodfoundation/openfoodnetwork into uk/account-balances 2016-01-31 11:00:18 +00:00
Steve Pettitt
dcb07237d8 Spec worked, links didn't :) 2016-01-31 11:00:07 +00:00
Maikel
381fb6291e Auto-merged master into uk/account-balances on deployment. 2016-01-31 21:35:44 +11:00
Steve Pettitt
e3b9ce4d80 Delegate url helper to pass specs 2016-01-31 10:28:19 +00:00
Nicolas Blanc
fb557dd682 Merge branch 'hackweek/i18n' of https://github.com/elf-pavlik/openfoodnetwork into elf-pavlik-hackweek/i18n 2016-01-31 09:16:33 +00:00
Steve Pettitt
4438cbd5d0 Merge branch 'uk/account-balances' of https://github.com/openfoodfoundation/openfoodnetwork into uk/account-balances 2016-01-30 19:53:53 +00:00
Steve Pettitt
ec6b0f873e style credit/debit, spec updates 2016-01-30 19:53:37 +00:00
Steve Pettitt
92d830b884 Table styling 2016-01-30 17:56:04 +00:00
Maikel
3c8df7c4aa Auto-merged master into delivery_email_updates on deployment. 2016-01-30 05:04:11 +11:00
Lynne Davis
c0afa6be49 Bug fix 2016-01-29 17:57:10 +00:00
Maikel Linke
d0cb9008a2 Delete unused shopfront haml 2016-01-29 16:09:34 +11:00
Transifex-Openfoodnetwork
e551a6b9f5 Updating translations for fr.yml and nb.yml 2016-01-29 14:18:48 +11:00
Rohan Mitchell
533124fe91 Display receival instructions when editing order cycle 2016-01-29 12:17:20 +11:00
Steve Pettitt
5b73b80e81 sorting orders in reverse date order 2016-01-28 23:10:27 +00:00
Steve Pettitt
ccd66bba9c Credit/debit formatting, use filters for money formatting, use full page width for table 2016-01-28 22:42:45 +00:00
Lynne Davis
02616a8ac7 Updates based on testing on staging 2016-01-27 18:43:01 +00:00
Steve Pettitt
aa8457c40f Fix order serializer spec: change from id to number 2016-01-26 19:03:19 +00:00
Lynne Davis
a9c37c162e Update email footer to use instance email and social media contacts 2016-01-26 13:14:29 +00:00
Maikel
93de2e4b02 Auto-merged master into delivery_email_updates on deployment. 2016-01-26 11:01:47 +11:00
Lynne Davis
a0f51af355 Correcting name tag for order conf email 2016-01-25 23:50:53 +00:00
Maikel
3dd3cfa7ec Auto-merged master into uk/account-balances on deployment. 2016-01-25 04:43:25 +11:00
Steve Pettitt
295ee47c3a Merge branch 'uk/account-balances' of https://github.com/openfoodfoundation/openfoodnetwork into uk/account-balances 2016-01-24 17:34:43 +00:00
Steve Pettitt
c9a8d7efa5 Message for users with no orders 2016-01-22 19:49:03 +00:00
Maikel Linke
1f1b0bd783 styling groups blurb 2016-01-22 16:20:07 +11:00
Maikel Linke
d562f6537e Cleaner opengraph meta tags 2016-01-20 15:42:01 +11:00
Maikel Linke
1c46b8dccb check_github_status.sh can check for user defined statuses
You can call it like this:

    ./script/ci/check_github_status.sh "pending|success"

It will check if the status is pending or success.
2016-01-20 14:58:21 +11:00
Maikel Linke
8c1a16b371 groups blurb text 2016-01-20 14:00:46 +11:00
Maikel Linke
ea796d4f94 Taxon filter for group hubs 2016-01-20 13:32:08 +11:00
Maikel Linke
d5aea1b00d Taxon filter for group producers 2016-01-20 13:32:08 +11:00
Maikel Linke
fd9de730c8 group producer style adjustment 2016-01-20 13:32:08 +11:00
Maikel Linke
fbdeb557ca Loading only visible enterprises for group 2016-01-20 13:32:08 +11:00
Rohan Mitchell
07d691fc97 Only apply cart scrolling to non-mobile devices 2016-01-15 16:54:56 +11:00
Maikel
eeb31f65c3 Auto-merged master into combined/cart-fit-to-screen_preserve-max-quantity on deployment. 2016-01-15 16:15:09 +11:00
Rohan Mitchell
046d0f0d19 Merge branch 'preserve-max-quantity' into combined/cart-fit-to-screen_preserve-max-quantity 2016-01-15 16:07:25 +11:00
ludivinecp
a611e73bed Opengraph facebook: images and description for shops and groups and home => ok 2016-01-15 14:03:33 +11:00
Maikel Linke
aea766327c Add say_no and say_yes to locale 2016-01-15 12:07:43 +11:00
Maikel Linke
f68f7ea2b6 Fix display of "Total" 2016-01-15 12:07:43 +11:00
Maikel
ddf6eef370 Auto-merged master into ng-vo-inventory-reset on deployment. 2016-01-15 09:21:54 +11:00
Rob Harrington
9979e31220 Final tidy up after rebasing default_inventory and ng-vo onto origin/master
Fixes a few VO feature specs and a few interface tweaks
2016-01-15 09:07:51 +11:00
Rob Harrington
669642292b Refactoring VariantOverridesController#bulk_reset to only reset VOs for a specified hub 2016-01-15 09:07:51 +11:00
stveep
ecf1aac5cb Added failure message to VO reset 2016-01-15 09:07:51 +11:00
Rob Harrington
4103ed0ba7 Combining variant override controller specs 2016-01-15 09:07:51 +11:00
Rob Harrington
0bbae19b41 Variant Overrides Index: User can manually reset inheritance 2016-01-15 09:07:51 +11:00
Rob Harrington
607a66b6c6 WIP: Fixing a few broken VO specs 2016-01-15 09:07:50 +11:00
Steve Pettitt
a3f7ff19b0 Add new VO fields to shopping spec 2016-01-15 09:07:50 +11:00
Steve Pettitt
0f4479aceb Back to original (current master) Rspec version 2016-01-15 09:07:50 +11:00
Steve Pettitt
1d38866f86 Add migration file to git repo 2016-01-15 09:07:50 +11:00
Steve Pettitt
e423e890e0 Changed name enable_reset to resettable in Variant Overrides table & updated views, specs accordingly 2016-01-15 09:07:50 +11:00
Steve Pettitt
25454d3e97 Added new fields to fix VO deletion feature specs 2016-01-15 09:07:49 +11:00
Steve Pettitt
75127f2a63 Fix feature specs for VO reset 2016-01-15 09:07:49 +11:00
Rob Harrington
94785d4157 Fixing authorization for VariantOverridesController#bulk_reset 2016-01-15 09:07:49 +11:00
Rob Harrington
d01da727f0 Removing :bulk_update action from actions allowed on nil object, using collection_actions methods on controller instead 2016-01-15 09:07:49 +11:00
Steve Pettitt
5a62098b95 Cleaning up and attempt to add feature spec 2016-01-15 09:07:49 +11:00
Steve Pettitt
0ee078e232 Added toggle to enable/disable reset stock. Updated specs 2016-01-15 09:07:48 +11:00
Steve Pettitt
2921958788 Variant override controller spec added 2016-01-15 09:07:48 +11:00
Steve Pettitt
34c603a9c3 Added angular service tests for variant overrides stock reset 2016-01-15 09:07:48 +11:00
Steve Pettitt
6c0dd7e25f Adding 'default_stock' to VariantOverride 2016-01-15 09:07:48 +11:00
Rob Harrington
53d97dab08 WIP: Adding view and routes for resetting variant_overrides count_on_hand 2016-01-15 09:07:48 +11:00
Rob Harrington
3b7700131c Specify controller specs as such 2016-01-15 09:07:47 +11:00
Rob Harrington
14c8683535 Updating active_model_serializers 2016-01-15 09:07:47 +11:00
Continuous Integration
e070168c4a Auto-merge from CI [skip ci] 2016-01-15 03:30:02 +11:00
Rob Harrington
cc4dc068ab Adding variant SKU field to BPE 2016-01-13 18:49:34 +11:00
Rob Harrington
64cd52e067 Adding SKU and on demand to a few VO specs 2016-01-13 18:49:34 +11:00
Rob Harrington
4553bc2997 Moving SaveBar directive and StatusMessage service into admin.utils module 2016-01-13 18:49:33 +11:00
Rob Harrington
521f227f74 Adding sku and on_demand to VariantOverride 2016-01-13 18:49:33 +11:00
Rob Harrington
cab6871de3 Pulling bulk actions dropdown out into partial 2016-01-13 18:49:33 +11:00
Rob Harrington
7cd8f35ac8 Tidying up styling and use of skeleton columns on index pages 2016-01-13 18:49:33 +11:00
Rob Harrington
2b70ddb23c Adding columns toggle to variant overrides index 2016-01-13 18:49:33 +11:00
Rob Harrington
9eaec6061e Pulling columns dropdown out into a shared partial 2016-01-13 18:49:32 +11:00
Rob Harrington
54e7677888 Integrating StatusMessages into save-bar, adding to variant overrides index 2016-01-13 18:49:32 +11:00
Rob Harrington
c781113a65 Adding filters to variant overrides interface 2016-01-13 18:49:32 +11:00
Rob Harrington
4237a83028 Moving components required for variant overrides into appropriate modules 2016-01-13 18:49:32 +11:00
Rob Harrington
f11e878e7f WIP: Reorganising variant overrides javascript files 2016-01-13 18:49:31 +11:00
Maikel
68e2b9a0b9 Auto-merged master into preserve-max-quantity on deployment. 2016-01-13 16:57:31 +11:00
Rohan Mitchell
406338ea05 Remove cruft 2016-01-13 16:45:14 +11:00
Rohan Mitchell
2c3ff37980 Split order cycles controller into parts 2016-01-13 16:45:03 +11:00
Maikel Linke
c33835e751 fixup whitespace 2016-01-13 16:23:14 +11:00
Maikel
826d045532 Auto-merged master into cart-fit-to-screen on deployment. 2016-01-13 16:12:41 +11:00
Maikel Linke
c4b0245399 Merge branch 'master' of https://github.com/marito59/openfoodnetwork into marito59-master 2016-01-13 16:07:21 +11:00
Maikel Linke
0c434c197b Making Travis fail if karma fails 2016-01-13 16:07:04 +11:00
Rohan Mitchell
a07eabca55 Fit cart to screen and allow scrolling so we can always access all of it 2016-01-13 16:00:43 +11:00
Maikel Linke
1cfb5a7feb Merge branch 'master' of https://github.com/blancnic/openfoodnetwork into blancnic-master 2016-01-13 15:06:11 +11:00
Maikel Linke
00af6ef9de cleanup knapsack integration 2016-01-13 15:05:48 +11:00
Maikel Linke
7a998663b2 Knapsack report and test splitting 2016-01-13 15:05:48 +11:00
Maikel Linke
749061d60a knapsack report generation 2016-01-13 15:05:48 +11:00
Steve Pettitt
667d1c5428 More reliable spec 2016-01-10 16:16:30 +00:00
Steve Pettitt
f5db1cd921 Images, first attempt at column formatting 2016-01-10 15:53:14 +00:00
Nicolas Blanc
770a8d0b17 #771-minor-bug-on-Firefox
Z-index:1 solved problem on Firefox. It works on Chrome too.
2016-01-10 09:54:35 +01:00
Steve Pettitt
262a8e75f9 slugs 2016-01-10 07:58:04 +00:00
stveep
81b688f0e8 Merge branch 'master' of https://github.com/openfoodfoundation/openfoodnetwork into uk/account-balances 2016-01-07 13:26:13 +00:00
stveep
698d36180d Move query from injector to User instance method 2016-01-07 13:25:15 +00:00
Maikel Linke
46382e669f more verbose example of Discourse config 2016-01-07 22:44:03 +11:00
Maikel Linke
217fa9a57c UI integration of Discourse login 2016-01-07 19:01:09 +11:00
Christian
01bf64e6b0 Allow delayed_job to use the locale defined for application
delayed_job requires a different configuration variable for locale than
the application.

See
https://stackoverflow.com/questions/8478597/rails-3-set-i18n-locale-is-not-working
for reference
2016-01-07 07:15:18 +01:00
Christian
839bf8794f Fix a hard cocded string on Order summary screen
Created an order_pickup_time entry in locale files.
2016-01-07 07:06:26 +01:00
Rohan Mitchell
037c524df2 Preserve max quantity when reloading shopfront 2016-01-07 16:35:54 +11:00
Rohan Mitchell
71569324f4 Serialise cart updates - do not submit another until the previous has completed 2016-01-07 13:53:37 +11:00
Maikel Linke
030f4f63ed SingleSignOn controller with routes and config 2016-01-07 12:58:30 +11:00
Rohan Mitchell
257b5a9eef Move premature Spree::Order#update prevention up a level, for even greater efficiency gains 2016-01-07 12:09:57 +11:00
Rohan Mitchell
ac650ebd46 Add support for mirroring Norway's database 2016-01-07 10:56:56 +11:00
Rohan Mitchell
e24027a8d0 Speed up add to cart: Update the order once per fee calculation, rather than for every line item x fee 2016-01-07 10:52:36 +11:00
Rohan Mitchell
a27e593924 Fix deprecation notices 2016-01-07 10:51:39 +11:00
Maikel Linke
09086b8dd8 Reference implementation of SSO from Discourse 2016-01-06 15:39:41 +11:00
stveep
6992d66202 Add payments data, reformat dates 2016-01-01 09:37:21 -05:00
Maikel Linke
9342ceb968 Adding translation notes to en.yml 2015-12-24 11:44:13 +11:00
Maikel
324f58a636 Updating translations for es.yml, fr.yml and nb.yml 2015-12-24 11:44:12 +11:00
Maikel Linke
20b3ad2cd6 Transifex configuration file
This configuration file enables easy use of the Transifex client to
download and upload translations.
2015-12-24 11:44:12 +11:00
Christian
823a6bff5b Use config to get logo in mails
Use ContentConfig.footer_logo to get localized logo file instead of
defaut AUS logo.
2015-12-24 11:31:47 +11:00
Maikel Linke
59c51f9e7c Fixing typo in locale: email_payment_method 2015-12-24 11:09:37 +11:00
stveep
f9435a3c34 Starting i18n 2015-12-23 14:39:56 +00:00
stveep
59adf88cad Feature spec 2015-12-22 22:59:07 +00:00
stveep
48896ab3d8 More serializer specs 2015-12-22 15:09:24 +00:00
stveep
668c6ff74f Order serializer spec 2015-12-21 23:22:15 +00:00
stveep
da0810382b Sorting by most orders, currency symbol, hide until clicked, reformatting table headers 2015-12-21 22:19:00 +00:00
stveep
90e627ad60 Data manipulation and balance calc in rails instead 2015-12-21 17:40:36 +00:00
stveep
7e50cc9ce8 Data organisation in angular, basic table structure and balance calculation. 2015-12-21 14:12:38 +00:00
Emmanuel
5e081ce3ee Translations of validation messages in app/models 2015-12-21 10:11:08 +01:00
elf Pavlik
2a4f3f9ae4 making test pass 2015-12-21 10:11:08 +01:00
knopfler81
ed48b691e1 translations in app/assets/javascripts/admin 2015-12-21 10:11:08 +01:00
Emmanuel
30141bd488 few translations in app/assets/javascripts/admin/ 2015-12-21 10:11:08 +01:00
victor goutay
e16e3fba40 translations in app/assets/javascripts/admin/ 2015-12-21 10:11:08 +01:00
ludivinecp
69ab113201 translations in app/assets/javascripts/admin/ 2015-12-21 10:11:07 +01:00
Florian Vallen
7192f12a49 first js translation for admin interface 2015-12-21 10:11:07 +01:00
Florian Vallen
ec6962ea2c Implements i18n translation for admin interface
it takes the i18n.js files from darkswarm.
This should be changed later and added to the
shared js folder.
At best, the namespacing for yml files should work
just as they work together with ruby, so

general:
  sure: sure?

should point to t(general.sure)
2015-12-21 10:11:07 +01:00
elf Pavlik
8a390dd237 fixing test failing after i18n changes 2015-12-21 10:11:07 +01:00
julienFR88
5290d0be6b add translation in /cache/code/ofn/openfoodnetwork/app/views/spree/admin 2015-12-21 10:11:07 +01:00
Edem
6cd7fbb455 all string translated in admin bulk orders management 2015-12-21 10:11:07 +01:00
Edem
8ccf527e01 all strings in app/views/spree/admin/overview/* translated! 2015-12-21 10:11:06 +01:00
Edem
d2ec4fcf88 Everything string translated in admin/entreprise_relationships 2015-12-21 10:11:06 +01:00
julienFR88
8fa293f561 my admin interface translations 2015-12-21 10:10:58 +01:00
apprenti
b58306aad8 my first translations 2015-12-21 09:47:18 +01:00
Edem
2a2f8f3531 admin entreprise_group are translated! 2015-12-21 09:47:18 +01:00
stveep
16ab8f04c3 Angularise /account page: Order service/controller, rough layout 2015-12-18 17:06:04 +00:00
Maikel Linke
61a58bca7d Travis can trigger the Github deploy API
And other build tools like Buildkite can listen to the deploy event.
2015-12-18 10:41:25 +11:00
Rob Harrington
e67e22ee73 Merge remote-tracking branch 'Em-AK/682-xero-report-defaults' into customer-name-security
Conflicts:
	lib/open_food_network/xero_invoices_report.rb
2015-12-17 14:22:16 +11:00
Rob Harrington
7a23f671a2 Restricting access to orders within Sales Tax Report
Managers of suppliers should not be able to generate sales tax reports for orders they only supply products for
2015-12-17 14:21:30 +11:00
Rob Harrington
d115eb816e Restricting access to orders within Xero Invoices Report
Managers of suppliers should not be able to generate xero invoices for orders they supply products for
2015-12-17 14:21:30 +11:00
Rob Harrington
4b5e33d5b0 Implementing new permissions for producers in reports_controller_spec 2015-12-17 14:21:30 +11:00
Rob Harrington
c579d302d5 Fixing customer info security for orders and distributors report 2015-12-17 14:21:30 +11:00
Rob Harrington
2f2ebf419c Fixing customer info security for packing reports 2015-12-17 14:21:30 +11:00
Rob Harrington
2f13ab6adf Fixing customer info security for orders and fulfillments report 2015-12-17 14:21:29 +11:00
Rob Harrington
b121984e76 Fixing customer info security for bulk coop report 2015-12-17 14:21:29 +11:00
Continuous Integration
23b9dd5c71 Auto-merge from CI [skip ci] 2015-12-17 13:02:37 +11:00
Maikel Linke
bc6110c178 Re-defining in_distributor scope as method to allow chaining 2015-12-17 12:42:28 +11:00
Rob Harrington
72f7e545dc Making sure bill > 0 for finalize account invoice spec 2015-12-17 12:04:24 +11:00
Rob Harrington
e0da49e4df Formatting dates for account invoices in rails time zone 2015-12-17 11:34:06 +11:00
Rob Harrington
b004060679 Printing invoices doesn't fail when order has no order cycle 2015-12-17 11:33:18 +11:00
Maikel Linke
ea68619f0b Use bundled rails to prepare imported database 2015-12-17 10:31:31 +11:00
Rob Harrington
555f639026 Fixing unstable update_account_invoice specs
Rounding first then summing != summing first then rounding
2015-12-17 09:16:19 +11:00
Rob Harrington
26a2f1a280 Adjustments on account invoices are created based on presence of a bill
Rather than of turnover
2015-12-16 23:10:47 +11:00
Rob Harrington
83e3fb98f7 Only display billable period adjustments where the amount in > 0
Rather than where the bill (which is calculated according to current settings) is > 0
2015-12-16 19:18:59 +11:00
Rob Harrington
bac4fcbd8f Make sure that adjustments for billable periods have a valid order to attach to when creating/updating 2015-12-16 19:18:59 +11:00
Rob Harrington
ecd11702c3 Fixing up enterprise user account page 2015-12-16 19:18:59 +11:00
Rob Harrington
fe0652e243 When updating a line_item quantity from 0, final_weight_volume is recalculated from the variants unit value 2015-12-16 19:18:59 +11:00
Rob Harrington
f49722ba90 Fixing broken BMC specs 2015-12-16 19:18:58 +11:00
Rob Harrington
0370723edd Attempt to add a sensible name and contact number to Account Invoice addresses 2015-12-16 19:18:58 +11:00
Rob Harrington
d46712de84 Obsolete BillablePeriods only deleted if their associated order is not already complete 2015-12-16 19:18:58 +11:00
Rob Harrington
199a3c38f9 Bill is capped before tax is applied, like we say it is 2015-12-16 19:18:58 +11:00
Rob Harrington
0ed8cf973d Adding an example bill calculator to business model config edit page
To allow super admin to see the effects of any changes they make to BMC settings
2015-12-16 19:18:58 +11:00
Rob Harrington
76d4f74f6b Ammending BillablePeriod spec to be ensure tax is charged correctly 2015-12-16 19:18:58 +11:00
Rob Harrington
ca3c464fda Reorganising busines model config settings, moving account invoice tax rate in busines model config settings 2015-12-16 19:18:57 +11:00
Rob Harrington
85f61364f8 BillablePeriods use global config to calculate bills 2015-12-16 19:18:57 +11:00
Rob Harrington
c1d04af5cc Implementing monthly billing description logic in required pages 2015-12-16 19:18:57 +11:00
Rob Harrington
5b72f53738 Adding helper for describing monthly billing charges 2015-12-16 19:18:57 +11:00
Rob Harrington
da325780b1 Adding BMC link to configurations menu 2015-12-16 19:18:57 +11:00
Rob Harrington
a40a03905f Reorganising BMC edit view 2015-12-16 19:18:57 +11:00
Rob Harrington
044e423543 Adding update logic to business model config controller 2015-12-16 19:18:57 +11:00
Rob Harrington
cb9b61f393 WIP: Adding an edit view for BMC variables 2015-12-16 19:18:56 +11:00
Rob Harrington
58031408f1 Adding basic business model configuration variables to app config 2015-12-16 19:18:56 +11:00
Rob Harrington
e20b06bb97 Adding basic route and controller for business model configuration 2015-12-16 19:18:56 +11:00
Rob Harrington
cc4f9dd09b Making lettuceshare report spec more robust 2015-12-16 18:14:19 +11:00
Rob Harrington
18ea0c1717 Pulling VariantOverride scoping down into products and inventory report base 2015-12-16 14:23:43 +11:00
Rob Harrington
2bb85eb8e0 Revert "Add SKU to LettuceShare report"
This reverts commit 15ea64b409.
2015-12-16 13:42:58 +11:00
Rob Harrington
5d28a7fdf8 Adding SKU to Products and Inventory reports (except lettuceshare) 2015-12-16 13:37:19 +11:00
Rob Harrington
befc558224 Pulling product_and_variant_name down into VariantAndLineItemNaming, renaming to product_and_full_name
Also allowing this method to be used in reports (Xero), to reflect appropriate name for weight/volume adjusted line items
2015-12-16 11:55:24 +11:00
Rob Harrington
c91f1301f0 Adding preferences to enterprises for sorting of order cycles in shopfront list 2015-12-16 11:55:23 +11:00
Rob Harrington
e6a51bb49d Adding actions dropdown to admin order view/pages 2015-12-16 11:55:23 +11:00
Rob Harrington
ae0ad73b4a Printable Invoices Improvements for Food Connect
Adding cusotmer instructions, hiding tax column when not present, order cycle name appears at top of invoice and items are sorted by product name
2015-12-16 11:55:23 +11:00
Continuous Integration
b7edf5e046 Auto-merge from CI [skip ci] 2015-12-16 10:58:03 +11:00
Em-AK
81f244025f Update due_date in feature test
due_date = invoice_date + 1 month
2015-12-13 18:42:27 +01:00
Em-AK
fcc328f00a Display default xero invoice dates
fixes #682

* pre-fill the invoice_date and due_date in the xero report generation form
* increase the default period between invoice_date and due_date to 1 month in
XeroInvoiceReport
2015-12-13 16:42:32 +01:00
Maikel Linke
758b1f8e64 using in_stock? to filter variants in lettuceshare report 2015-12-11 15:12:28 +11:00
Maikel Linke
bb58473b90 Consider variant overrides in LettuceShare report 2015-12-11 15:12:28 +11:00
Maikel Linke
1d46c2febd LettuceShare report: display only if count_on_hand > 0
Use the inventory of a distributor if selected.
2015-12-11 15:12:27 +11:00
Maikel Linke
15ea64b409 Add SKU to LettuceShare report 2015-12-11 15:12:27 +11:00
Maikel Linke
6787709693 LettuceShare report: total in unit value column and total blank 2015-12-11 15:12:27 +11:00
Rohan Mitchell
a3874d42af Spec moved to OpenFoodNetwork::LastUsedAddress 2015-12-11 13:25:40 +11:00
Rohan Mitchell
3f8d470d23 When admin associates user with an order, look up last used address 2015-12-11 13:06:59 +11:00
Rohan Mitchell
ae3061df80 All orders specs use JS 2015-12-11 13:06:59 +11:00
Rohan Mitchell
5579fa5e0b Extract last used address finding into service object 2015-12-11 13:06:59 +11:00
Rohan Mitchell
e33ede0ec2 Include order cycle status in new order form 2015-12-11 13:06:58 +11:00
Rohan Mitchell
76d4fbccf9 Use select2 for order cycle selection 2015-12-11 13:06:58 +11:00
Rohan Mitchell
60e971ad63 Take variant overrides into account for price when admin adds line item to order 2015-12-11 13:06:57 +11:00
Rohan Mitchell
222b390b31 Fix error display 2015-12-11 13:06:57 +11:00
Rohan Mitchell
932ac45ea5 Do not show form until distribution has been chosen 2015-12-11 13:06:57 +11:00
Rohan Mitchell
80ebaece2d Sort distribution choices by name 2015-12-11 13:06:57 +11:00
Rohan Mitchell
3419198635 Disable distributors that do not have an order cycle 2015-12-11 13:06:57 +11:00
Rohan Mitchell
1026b81d0c Do not show order cycle choice until distributor is chosen 2015-12-11 13:06:57 +11:00
Rohan Mitchell
c74463404d Only show order cycle options that include the chosen distributor 2015-12-11 13:06:57 +11:00
Rohan Mitchell
2081744cf6 Fix spec 2015-12-11 13:06:57 +11:00
Rohan Mitchell
cbaf2a0cb3 Angularise edit order form 2015-12-11 13:06:57 +11:00
Rohan Mitchell
6e7b6b5dfc Tidy render partial calls and hash syntax 2015-12-11 13:06:57 +11:00
Rohan Mitchell
815694de31 Move orders/edit template from Spree 2015-12-11 13:06:57 +11:00
Rohan Mitchell
2daceb1111 Angularise new order form 2015-12-11 13:06:57 +11:00
Rohan Mitchell
eb07680f1f Inject shops and order cycles 2015-12-11 13:06:57 +11:00
Rohan Mitchell
47c23c986a Move distribution fields from override to partial 2015-12-11 13:06:56 +11:00
Rohan Mitchell
742e2279ae Tidy render partial calls 2015-12-11 13:06:56 +11:00
Rohan Mitchell
eaae16a486 Copy orders/new template from Spree 2015-12-11 13:06:56 +11:00
Continuous Integration
ae945ace9d Auto-merge from CI [skip ci] 2015-12-11 11:09:54 +11:00
Rohan Mitchell
9d5606a4fd Fix enterprise index page 500 2015-12-11 10:06:07 +11:00
Maikel Linke
cd7721a127 Using date and time of current timezone
Using Time.zone.now and Date.current instead of Time.now and Date.today.
This should make all specs timezone independent.
2015-12-10 11:38:41 +11:00
Rohan Mitchell
ee447c9ce6 Move blankOption service to admin.utils module 2015-12-10 09:35:27 +11:00
Rohan Mitchell
eba2aae353 Copy StatusMessage to admin.utils module, eventually to be moved here 2015-12-10 09:32:04 +11:00
Rohan Mitchell
c1a80b1e8f Require confirmation when saving an order cycle without distributors 2015-12-10 09:17:25 +11:00
Rohan Mitchell
6998df25e0 Fix indentation 2015-12-10 09:17:25 +11:00
Rohan Mitchell
921210012a Swap in StatusMessage service for custom message display in order cycles interface 2015-12-10 09:17:25 +11:00
Rohan Mitchell
8d270e919f Sort exchanges for display when editing an order cycle 2015-12-10 09:17:25 +11:00
Rohan Mitchell
1e397a41ae Refactor to simplify outgoing_exchange_variant_ids 2015-12-10 09:17:25 +11:00
Rohan Mitchell
243ef4ee16 When an outgoing exchange includes a variant that is not in an incoming exchange, remove it from the outgoing exchange 2015-12-10 09:17:25 +11:00
Rohan Mitchell
ea6974d438 Add OrderCycle#supplied_variants 2015-12-10 09:17:25 +11:00
Rohan Mitchell
ccb23cd186 Do not allow re-adding exchange 2015-12-10 09:17:25 +11:00
Rohan Mitchell
d4ee20455e Remove enterprise options from list when added 2015-12-10 09:17:25 +11:00
Rohan Mitchell
ef603a070e Add methods to check for novel suppliers and distributors in an order cycle 2015-12-10 09:17:25 +11:00
Rohan Mitchell
1a4448c6d2 Do not allow adding blank enterprises 2015-12-10 09:17:25 +11:00
Rohan Mitchell
a78d8fa6af Build exchange form on front-end 2015-12-10 09:17:25 +11:00
Rohan Mitchell
8c0a82f26f Provide issues summary for enterprises, pass enterprises through to controller 2015-12-10 09:17:25 +11:00
Rohan Mitchell
93c42d24c7 Extract issue detection into service object 2015-12-10 09:17:25 +11:00
Rohan Mitchell
036ffeb634 Enterprise service splits enterprises into hubs and producers 2015-12-10 09:17:25 +11:00
Rohan Mitchell
3dcbdad088 Show/hide all products 2015-12-10 09:17:25 +11:00
Rohan Mitchell
7820c31976 Show supplier as secondary in information hierarchy 2015-12-10 09:17:25 +11:00
Rohan Mitchell
d314f07887 Use flexbox to more neatly lay out order cycle products 2015-12-10 09:17:25 +11:00
Rohan Mitchell
2efaedc225 Add .exchange-products container div, fill full row with products 2015-12-10 09:17:25 +11:00
Rohan Mitchell
c5e2ed5aa1 Order outgoing products by name 2015-12-10 09:17:24 +11:00
Rohan Mitchell
8f917817b8 Fix broken styles 2015-12-10 09:17:24 +11:00
Rohan Mitchell
a2c0088c91 Do not show flash message if we're performing an async update without reload 2015-12-10 09:17:24 +11:00
Rohan Mitchell
9fef0a9909 When order cycle is updated, display message instead of reloading the page 2015-12-10 09:17:24 +11:00
Rohan Mitchell
29bfac5f54 Order cycle interface may update or update and close 2015-12-10 09:17:24 +11:00
Maikel Linke
efa7c215e2 Removing usage of SimpleCov 2015-12-04 14:51:44 +11:00
Maikel Linke
1589bd9ac3 Use mail() instead of devise_mail
The EnterpriseMailer used `devise_mail` to send confirmation
instructions. That call is more complicated than `mail` and added an
unwanted reply-to header.
2015-12-04 10:37:55 +11:00
Maikel Linke
a810a6e2b7 fix succeed_if_master_merged 2015-12-04 10:37:55 +11:00
Maikel Linke
c4fb4a8510 Removing Suburbs from the code
Suburbs are not used any more. Removing the last code bits should avoid
confusion and save a tiny bit of test time.
2015-12-04 10:37:55 +11:00
Maikel Linke
d67a5aba0e Remove script/delayed_job.sh
This version was dependent on the Australian environment. It is better
to call delayed_job directly from monit. The deployment repository has
been updated.
2015-12-04 10:37:55 +11:00
Maikel Linke
d5c4da3bf0 Not using Paperclip's to avoid HTTP calls to S3 2015-12-04 10:37:55 +11:00
Maikel Linke
261a464b50 Fixing display of shop list in group producer modal 2015-12-04 10:37:55 +11:00
Maikel Linke
0f2ae79e05 Fixing "Shop for" label on groups producer modal 2015-12-04 10:37:55 +11:00
Maikel Linke
caffdee047 Removing depricated sensor parameter for Google Maps 2015-12-04 10:37:55 +11:00
Rohan Mitchell
d320b2e7d4 Merge branch 'fix-delayed-job' into combined/producer-emails-simplify_fix-delayed-job 2015-12-02 15:06:38 +11:00
Rohan Mitchell
e8ccd35363 Simplify producer email to make it more generic 2015-12-02 15:05:49 +11:00
Rohan Mitchell
bd854bf2dd Remove receival_time from exchange, just use receival_instructions 2015-12-02 15:05:49 +11:00
Rohan Mitchell
10edb2b056 Fix delayed job startup - prevent error caused by double load 2015-12-02 10:48:50 +11:00
Rob H
86f1afae92 derp 2015-11-29 18:10:49 +11:00
Rob H
1cffd35968 Fixing up specs pertaining to full_name generation for line_items 2015-11-29 17:52:01 +11:00
Rob H
baeacfb8a9 LineItem inherits display_name from variant
Allows line_items to be named correctly.
2015-11-29 17:25:28 +11:00
Rob Harrington
7ecf5df26a Updating line items through admin controller causes enterprise fees to be recalculated 2015-11-27 15:06:49 +11:00
Rob Harrington
a5a886c51f Only test for coordination when orders actually have order_cycles 2015-11-25 15:27:27 +11:00
Rob Harrington
96aace971f Merge remote-tracking branch 'origin/master' into line_item_naming 2015-11-25 15:13:56 +11:00
Rob Harrington
6c254c534f Upgrade fog to resolve 'Digest::Digest is deprecated; use Digest' warning 2015-11-25 15:13:25 +11:00
Rob Harrington
b341c1ef8a Ensure that dates in BOM AJAX requests have timezones 2015-11-25 15:06:15 +11:00
Rob Harrington
7e6b43266f Making sure that price and final_weight_volume can be updated (by distributor or coordinator) 2015-11-25 14:23:55 +11:00
Maikel
3975eef0c4 Merge pull request #716 from openfoodfoundation/uk/i18n
#715: Add missing strings for en-GB locale.
2015-11-24 18:36:32 +11:00
Paul Mackay
a2a87cc68f #715: Add missing strings for en-GB locale. 2015-11-23 16:44:39 +00:00
Rob Harrington
4bdc1bc418 LineItem final_weight_volume is updated whenever quantity is changed, though can be set directly 2015-11-18 16:22:36 +11:00
Rob Harrington
33454a7090 Adding server validation errors messages to BOM interface 2015-11-18 14:32:29 +11:00
Rob Harrington
6268b7cc7e Printing/sending an invoice uses the same template for generating a pdf 2015-11-18 10:02:51 +11:00
Rob Harrington
75846a4d1f Merge branch 'master' into line_item_naming 2015-11-16 10:38:42 +11:00
Rob Harrington
c199e22190 Make a few BOM specs more robust 2015-11-16 10:31:41 +11:00
Rob Harrington
3b2bdb8397 Change the way changes to underlying model are watched and updated for select2 elements 2015-11-16 10:31:22 +11:00
Rob Harrington
767671c3b4 New pattern: blank Options for index drop down filters are added within service
Rather than in the controller after data is loaded
2015-11-16 10:30:44 +11:00
Rob Harrington
76414dedff Bumping coffee-script version 2015-11-16 10:27:32 +11:00
Rob Harrington
ae7fb91a9a Only reloading line_items and orders on BOM, $timeout for adding blankOption
$timeout required for adding a blank option to lists of suppliers,
distributors and orderCycles to prevent spec failures related to the
use of select2
2015-11-13 15:59:33 +11:00
Maikel Linke
229070a76b Merge branch 'master' of github.com:openfoodfoundation/openfoodnetwork into i18n 2015-11-13 15:20:58 +11:00
Maikel Linke
8bfe459241 i18n fixes of html display 2015-11-13 14:22:17 +11:00
Rohan Mitchell
bb6fb2f5e8 Merge branch 'sell-food-link' into combined/add-to-cart-speed_and_sell-food-link 2015-11-13 14:03:32 +11:00
Rohan Mitchell
6de44877c8 Update link for uber-style sell food dropdown 2015-11-13 14:03:14 +11:00
Rohan Mitchell
b6f3e6eca6 Fix broken spec 2015-11-13 14:03:07 +11:00
Rohan Mitchell
a86cc96452 Use pluck instead of map 2015-11-13 14:03:07 +11:00
Rohan Mitchell
178e5f59e6 Update cart by applying differences rather than clear-and-readd every time 2015-11-13 14:03:07 +11:00
Rohan Mitchell
7fffa03d8d Fix bug: set difference comparison of string with number 2015-11-13 14:03:07 +11:00
Rohan Mitchell
888e4d80ef Add reliable way to check if cart is dirty. Previous way returned true when cart empty. 2015-11-13 14:03:07 +11:00
Rohan Mitchell
d3c7c46800 Add method to remove a variant from an order 2015-11-13 14:03:07 +11:00
Rohan Mitchell
c432ed9e08 Build list of variants removed from the cart when overwriting 2015-11-13 14:03:07 +11:00
Rohan Mitchell
e175149e76 Add method to check whether a passed-in cart value varies from the cart 2015-11-13 14:03:07 +11:00
Rohan Mitchell
1b5901317d Separate concerns: reading products hash and adding items to cart 2015-11-13 14:03:07 +11:00
Rohan Mitchell
2f4b5bad26 Make benchmark more realistic 2015-11-13 14:03:07 +11:00
Rohan Mitchell
64e8927ae9 Add benchmark: add to cart 2015-11-13 14:03:07 +11:00
Rohan Mitchell
c932d20ef5 Extract multi-sample benchmarking into a helper method 2015-11-13 14:03:07 +11:00
Maikel Linke
5d5fda3a25 Merge remote-tracking branch 'origin/master' into i18n
Conflicts:
	config/locales/en.yml
2015-11-13 10:07:29 +11:00
Rob Harrington
a96cdd5ee7 Merge branch 'master' into line_item_naming
Conflicts:
	app/views/admin/order_cycles/edit.html.haml
2015-11-13 09:54:26 +11:00
Rob Harrington
4191e2b6f0 Changing the way select filters are reset on BOM to try and fix specs 2015-11-13 09:44:57 +11:00
Rob Harrington
88fd9f72e6 Retry uncooperative BOM feature spec 2015-11-13 09:14:20 +11:00
Rob Harrington
3d36ebe2e6 Some Ransack trickery to get OrderCycles#index to load only recent OR undated OCs when no orders_close_at predicate is passed in 2015-11-12 18:29:19 +11:00
Rob Harrington
6966fbba7c Present date limits being set in line items controller .js unless orderCycleFilter has actually been set 2015-11-12 17:40:35 +11:00
Rob Harrington
2310bc95bc Committing changes to version used to bundle Gemfile.lock 2015-11-12 17:34:22 +11:00
Rob Harrington
27a5791e26 Fixing Angular Specs for line items controller 2015-11-12 17:33:12 +11:00
Rob Harrington
be8038e9d0 Merge branch 'master' into line_item_naming
Conflicts:
	lib/open_food_network/order_cycle_management_report.rb
	lib/open_food_network/packing_report.rb
2015-11-12 14:40:11 +11:00
Rob Harrington
1556d38b1e Admin Enterprise#update.json renders updated enterprises using index serializer 2015-11-12 14:30:43 +11:00
Rob Harrington
4e4de65cba Fetch undated order cycles by default for index actions 2015-11-12 12:08:39 +11:00
Rob Harrington
6e8d807408 Fixing spec using text-angular broken by upgrade of poltergeist 2015-11-12 11:35:22 +11:00
Rob Harrington
095466cb43 Fixing syntax error for new method for OCs controller 2015-11-12 10:34:09 +11:00
Rob Harrington
2719c699d7 Updating line items index spec 2015-11-12 10:06:41 +11:00
Rob Harrington
34030276d7 Cleaning up line items index (BOM) 2015-11-12 10:06:21 +11:00
Rob Harrington
330977186e Using confirm-change and select2-min-search directive for line items index 2015-11-12 10:05:14 +11:00
Rob Harrington
fc57255b40 Adding save-bar to line items index 2015-11-12 10:04:18 +11:00
Rob Harrington
266820742d Using request monitor on line items index (BOM) 2015-11-12 10:03:28 +11:00
Rob Harrington
722471a111 Allow use of completed_at for orders index ransacking
Needed to override original Spree method to allow intuitive use of
completed_at_gt and completed_at_lt
2015-11-12 10:01:35 +11:00
Rob Harrington
86b5e810e5 Only try to dereference attrs when enough information is present 2015-11-12 09:59:46 +11:00
Rob Harrington
f8a31e8864 Resetting select filters in a way that actually works 2015-11-12 09:58:55 +11:00
Rob Harrington
639472b917 WIP: Adding a request monitoring service to handle loading status 2015-11-12 09:57:02 +11:00
Rob Harrington
193325f81b Improve formatting around saving on line items index (BOM) 2015-11-12 09:52:10 +11:00
Rob Harrington
5a7cac652c Adding confirm-link directive 2015-11-12 09:49:36 +11:00
Rob Harrington
b5aaf36bd2 Create directive for scaling by a factor and then formatting as currency 2015-11-12 09:48:43 +11:00
Rob Harrington
c5a26249ea Removing unneeded directives 2015-11-12 09:47:37 +11:00
Rob Harrington
69ead3c829 Line items serialiser gives a sensible value for max_quantity 2015-11-12 09:47:12 +11:00
Rob Harrington
93caa4a11d Bumping poltergeist version to 1.7.0 2015-11-12 09:45:14 +11:00
Rohan Mitchell
e20d8d3e95 Merge branch 'master' into folklabs-producer-emails 2015-11-11 14:20:25 +11:00
Rohan Mitchell
fb3e292e20 Formatting 2015-11-11 11:53:04 +11:00
Rohan Mitchell
f499dd627a with_tax_included_in_price handles exceptions gracefully 2015-11-11 11:53:04 +11:00
Rohan Mitchell
8e1bade355 Move adjustment specs to their own spec file 2015-11-11 11:53:04 +11:00
Rohan Mitchell
a32321df68 Clarify label 2015-11-11 11:53:04 +11:00
Rohan Mitchell
5a29311137 Choose a more sensible default tax rate: one that calculates to the same amount as the current adjustment tax 2015-11-11 11:53:04 +11:00
Rohan Mitchell
3e7a12cca1 Rename spec support method for faster tab completion on save_and_open_page 2015-11-11 11:53:04 +11:00
Rohan Mitchell
81a6e07d5c Admin can remove tax on an adjustment 2015-11-11 11:53:04 +11:00
Rohan Mitchell
727ecae62b Admin can modify a taxed adjustment on an order 2015-11-11 11:53:04 +11:00
Rohan Mitchell
85e45fa558 Use select2 2015-11-11 11:53:04 +11:00
Rohan Mitchell
83c0093665 Admin can include tax when creating an adjustment 2015-11-11 11:53:04 +11:00
Rohan Mitchell
46a9304ae1 Extract compute_tax from EnterpriseFeeApplicator to Spree::TaxRate model 2015-11-11 11:53:04 +11:00
Rohan Mitchell
d794981ecf Add form field to set tax when creating adjustment on order. Display tax included in adjustments on order interface. 2015-11-11 11:53:04 +11:00
Rohan Mitchell
6476ce6ba9 Make spec more resilient 2015-11-10 15:05:45 +11:00
Maikel Linke
a06b452e7e updated norwegian locale 2015-11-07 16:42:35 +11:00
Maikel Linke
0b6cbb43d6 updated locale nb.yml 2015-11-06 11:56:25 +11:00
Rob Harrington
27903a46e6 Adding new save-bar directive for handling save actions for index pages 2015-11-06 09:53:31 +11:00
Rob Harrington
330882c689 Pulling out styling for red buttons in admin into more generic .red class 2015-11-06 09:52:48 +11:00
Rob Harrington
b1bac703ed WIP: BOM Refactor, delete line_items using ngResource, updating data requests in line_items_controller 2015-11-05 17:50:18 +11:00
Rob Harrington
bf6bd2dc68 Hack down routes available for Admin::LineItemsController 2015-11-05 17:18:32 +11:00
Rob Harrington
eb7b2e7a3b Use ams_prefix not ams_suffix! 2015-11-05 17:17:45 +11:00
Rob Harrington
73c80cb5e5 Ordering index orders within query 2015-11-05 17:11:13 +11:00
Rob Harrington
6769c2c729 Can pass params for order or line items into LineItemsController#index 2015-11-05 17:07:47 +11:00
Rob Harrington
afef9e3211 WIP: BOM Refactor, building order_cycle fetch and update logic with ngResource 2015-11-05 15:13:19 +11:00
Rob Harrington
a9e5f2912f WIP: Fixing Orders service specs 2015-11-05 14:48:26 +11:00
Rob Harrington
66d1e4297e WIP: Renaming admin.order_cycles to admin.orderCycles for consistency 2015-11-05 14:40:42 +11:00
Maikel Linke
5e59048705 i18n typo 2015-11-05 14:39:33 +11:00
Rob Harrington
4d4e2d4abd WIP: Moving order_cycle controller into order_cycles folder 2015-11-05 14:38:01 +11:00
Rob Harrington
db4e8382e4 Oops, updating template to make order filtering work 2015-11-05 14:05:14 +11:00
Rob Harrington
51762753f4 WIP: BOM Refactor, adding json route for OrderCyclesController#index, loading OCs based on show_more or specific order_close_at_gt 2015-11-05 14:04:29 +11:00
Rob Harrington
2483eef4be WIP: BOM Refactor, removing obsolete OrderCycle.recently_closed scope, ordering closed OCs 2015-11-05 14:02:04 +11:00
Maikel Linke
38d2616ea0 No need to empty cache if I18n asset depends on locale 2015-11-05 12:50:11 +11:00
Rohan Mitchell
5db64b6f21 Update travis config and README with new ruby version 2015-11-05 12:48:22 +11:00
Maikel Linke
0505a45de5 Invalidate I18n asset if locale changes 2015-11-05 12:47:15 +11:00
Rob Harrington
e96fa967b8 WIP: BOM refactor, rebuilding bulk orders controller as line items controller using new AJAX routes 2015-11-05 11:54:36 +11:00
Maikel Linke
8b29612614 Merge remote-tracking branch 'origin/master' into i18n 2015-11-05 11:54:06 +11:00
Maikel Linke
90d52151b6 Updated fr.yml 2015-11-05 11:53:38 +11:00
Rohan Mitchell
6666de96b2 Update ruby version used in CI 2015-11-05 11:24:12 +11:00
Rob Harrington
b7d92786d0 Bumping ruby version to 2.1.5 2015-11-05 11:09:22 +11:00
Rob Harrington
d731d4e803 Making sure flash is a hash so that is can be used to initialize OpenStuct 2015-11-05 11:09:21 +11:00
Rob Harrington
2277b9f5a6 Changing ruby version in version manager config 2015-11-05 11:09:21 +11:00
Rob Harrington
aef8b9648e Initial upgrade of Gemfile 2015-11-05 11:09:21 +11:00
Rohan Mitchell
65589d25c6 Display more verbose product and variant name 2015-11-05 09:50:00 +11:00
Rohan Mitchell
5ffad4d343 Fix quantity calculation 2015-11-05 09:43:44 +11:00
Rob Harrington
50a551a87e Coffeescript! 2015-11-04 18:35:14 +11:00
Rob Harrington
1494389d34 WIP: BOM Refactor, organising admin.products files in appropriate folders 2015-11-04 18:28:53 +11:00
Rob Harrington
b43049af47 WIP: BOM Refactor, building line_item fetch and update logic with ngResource 2015-11-04 18:16:17 +11:00
Rob Harrington
f563f04f1c WIP: BOM Refactor, building order fetch and update logic with ngResource, updating rails routes 2015-11-04 16:35:56 +11:00
Rob Harrington
ae7e744644 WIP: BOM Refactor, adding for_line_items action to enterprises controller 2015-11-04 15:02:29 +11:00
Rob Harrington
625e0888ea Adding logic to Admin::BaseController to standardise rendering of data with AMS 2015-11-04 12:10:50 +11:00
Rohan Mitchell
a3d638df67 Merge branch 'master' into folklabs-producer-emails 2015-11-04 11:15:01 +11:00
Rohan Mitchell
9227df54b6 Display detail rows for admin adjustments 2015-11-01 15:19:03 +11:00
Rohan Mitchell
015f3eb9ac Display summary rows for admin adjustments 2015-11-01 13:42:59 +11:00
Maikel Linke
fd747f9012 Updated French locale 2015-10-30 12:20:12 +11:00
Lynne Davis
7350dbb75e Adding tweaks that have been missed from merges 2015-10-30 11:54:06 +11:00
Rohan Mitchell
94e1264aef Add rspec-retry for inconsistently failing spec 2015-10-29 16:01:39 +11:00
Maikel Linke
aec3980a93 Merge remote-tracking branch 'origin/master' into i18n 2015-10-29 14:56:17 +11:00
Maikel Linke
4eed222f18 Fixed several i18n issues reported by Myriam 2015-10-29 14:55:38 +11:00
Rohan Mitchell
f63a80300b Merge branch 'master' into folklabs-producer-emails 2015-10-29 11:49:24 +11:00
Rohan Mitchell
87cf3eda41 Amend 'Detailed orders breakdown' heading with missing content 2015-10-29 11:48:12 +11:00
Rob Harrington
02423d3a41 Using rails time zone account invoice job specs 2015-10-28 16:51:18 +11:00
Rob Harrington
cb1f79f59a Updating front end order details, invoices and pdfs to display names of line_items as opposed to variants 2015-10-28 15:42:14 +11:00
Rob Harrington
18a7317185 Merge branch 'account-invoices' into line_item_naming
Conflicts:
	app/models/spree/line_item_decorator.rb
2015-10-28 13:42:27 +11:00
Rob Harrington
c5810fc003 Improving BOM form validation 2015-10-28 13:08:50 +11:00
Rob Harrington
f60b6994eb Wrapping line_item update with order.update_distribution_charge inside lock 2015-10-28 13:08:50 +11:00
Rob Harrington
50b3635e7e Locking line_items on API update 2015-10-28 13:08:50 +11:00
Rob Harrington
ab7bfd10c5 Revert "Renaming options_text to unit_text so that we can use method from included VariantAndLineItemNaming module"
This reverts commit e86e08b72e939fee61eddd41d56081395666a877.

Conflicts:
	lib/open_food_network/order_and_distributor_report.rb
	spec/features/admin/variants_spec.rb
	spec/lib/open_food_network/order_and_distributor_report_spec.rb
2015-10-28 13:08:50 +11:00
Rob Harrington
cdb0c2db33 Admin Orders show page uses line_item.full_name to describe line_items 2015-10-28 13:07:32 +11:00
Rob Harrington
21e5895a8a Group Buy panel on BOM takes changes to final_weight_volumes into account 2015-10-28 13:07:32 +11:00
Rob Harrington
33e1322a44 Adding form validation to BOM 2015-10-28 13:07:32 +11:00
Rob Harrington
b08556ec7f WIP: Making final_weight_volume adjustment a bit nicer 2015-10-28 13:07:31 +11:00
Rob Harrington
a71999ba84 Weight only returned for products whose variant_unit is 'weight' 2015-10-28 13:07:31 +11:00
Rob Harrington
2d468f5022 Fixing attr_accessible for line_items (broken in previous commit) 2015-10-28 13:07:31 +11:00
Rob Harrington
eba13a0dd7 Line items inherit units from variants upon creation 2015-10-28 13:07:31 +11:00
Rob Harrington
1946bac8e4 Fixing report spec that cares about table title case 2015-10-28 13:07:31 +11:00
Rob Harrington
e52f7165c3 Overriding any last references to options_text in the spree codebase 2015-10-28 13:07:31 +11:00
Rob Harrington
6dfae1b014 Whitespace crusader 2015-10-28 13:07:31 +11:00
Rob Harrington
40972cc6ec Updating reports to use naming information from line_items directly, rather than from the original variant 2015-10-28 13:07:31 +11:00
Rob Harrington
795830d94d Renaming options_text to unit_text so that we can use method from included VariantAndLineItemNaming module 2015-10-28 13:07:31 +11:00
Rob Harrington
039fcb80eb Extracting variant and option_value naming out into a lib class that is now shared between line items and variants, line_items have option_values 2015-10-28 13:06:10 +11:00
Rob Harrington
6a70c162bb Account invoice jobs run according to rails config time zone rather than system time zone 2015-10-23 12:33:05 +11:00
Maikel Linke
0fd29dd32e use expect in bulk_order_management_spec 2015-10-22 13:43:15 +11:00
Maikel Linke
bbeeb8a493 Merge remote-tracking branch 'origin/master' into i18n 2015-10-22 11:03:42 +11:00
Maikel Linke
6c1619ba60 i18n more content 2015-10-22 11:03:35 +11:00
Maikel Linke
df34f6ef8e using default_locale for precompiled assets 2015-10-22 10:50:29 +11:00
Maikel Linke
dc8166ec84 New CI script to check test state via GitHub API 2015-10-21 16:29:41 +11:00
Rob Harrington
ef08977dbe Prevent invoices from being sent unless the distributor of an order has set their ABN 2015-10-21 16:23:48 +11:00
Rob Harrington
9b2653aa2d Updating order invoice template to be more legally compliant 2015-10-21 15:52:14 +11:00
Maikel Linke
adf0a84669 Use ! version of find_by_permalink to recover on missing resource 2015-10-21 15:42:28 +11:00
Maikel Linke
7163664725 updated locales fr and nb 2015-10-21 14:36:02 +11:00
Maikel Linke
2053fbecda Merge branch 'i18n-replace-strings-in-js' into i18n
Conflicts:
	.travis.yml
	app/views/spree/order_mailer/confirm_email_for_customer.html.haml
	config/locales/en.yml
2015-10-21 14:09:43 +11:00
Maikel Linke
6781051fe6 enabling Travis container-based infrastucture 2015-10-21 10:27:16 +11:00
Maikel Linke
2357f46a4e CI scripts use env vars
The CI scripts are configurable through the environment. They had
hardcoded configurations before. The Australian BuildKite setup will
need global environment variables like this:

STAGING_SSH_HOST=ofn-staging2
STAGING_CURRENT_PATH=/home/openfoodweb/apps/openfoodweb/current
STAGING_SERVICE=unicorn_openfoodweb
STAGING_DB_HOST=localhost
STAGING_DB_USER=openfoodweb
STAGING_DB=openfoodweb_production
PRODUCTION_REMOTE=production:/home/openfoodweb/apps/openfoodweb/current
2015-10-21 10:04:29 +11:00
Maikel Linke
8bd78eb139 spec_helper for lib/open_food_network/permissions_spec.rb 2015-10-21 10:04:29 +11:00
Maikel Linke
f152e4054c Remove obsolete deface 2015-10-21 10:04:29 +11:00
Maikel Linke
62d31f79ed Remove obsolete deface 2015-10-21 10:04:28 +11:00
Maikel Linke
2ea1a59666 depricating db2fog.rb initializer due to invalid bucket name
Once everybody changed their server config, we can remove that file.
2015-10-21 10:04:28 +11:00
Maikel Linke
a95727b376 running all specs in Travis 2015-10-21 10:04:28 +11:00
Maikel
b35df3c945 Travis config for parallel execution on five nodes
This Travis configuration runs rspec on five build machines in parallel. Currently, that takes 15 to 20 minutes.
2015-10-21 10:04:28 +11:00
Rohan Mitchell
421774e46c Do not send producer notifications when the producer has no orders for this order cycle 2015-10-17 11:02:47 +11:00
Rob Harrington
5b3e052f78 Using a compiled stylesheet for pdf styling 2015-10-16 21:36:18 +11:00
Rob Harrington
47fb2270bd Making spec do the right thing 2015-10-16 17:25:40 +11:00
Rob Harrington
f12fd7b4a3 Adding button for print action to admin orders show page 2015-10-16 17:25:40 +11:00
Rob Harrington
40d627cb34 Adding new route for printing an order to pdf 2015-10-16 17:25:40 +11:00
Rob Harrington
6e7fc6a0f7 Adding invoice action to orders controller, to allow sending of invoice email 2015-10-16 17:25:40 +11:00
Rob Harrington
104b100fe6 Pulling distributor signoff out into separate partial 2015-10-16 17:25:39 +11:00
Rob Harrington
3a505abfc7 Adding WickedPDF for generation of order invoices 2015-10-16 17:25:39 +11:00
Rohan Mitchell
ecc3bad8c8 Merge branch 'master' into folklabs-producer-emails 2015-10-16 12:38:54 +11:00
Rohan Mitchell
13fc36bad6 Reorder methods 2015-10-15 12:00:40 +11:00
Rohan Mitchell
a766f007fc Display xero report for account invoices 2015-10-15 11:57:51 +11:00
Rohan Mitchell
4fbeb0c3b1 Check if an order is an account invoice 2015-10-15 10:05:27 +11:00
Rohan Mitchell
de80e6d5bf Find adjustments for billable periods 2015-10-15 09:58:22 +11:00
Rohan Mitchell
92f7b72056 Check whether an individual adjustment has tax included 2015-10-15 09:58:06 +11:00
Rob Harrington
b22d591775 BillablePeriods don't get updated when account_invoice has been finalized 2015-10-14 14:36:38 +11:00
Rob Harrington
1ad0f95536 Updating Billable Periods job ignores versions of enterprises created in the future 2015-10-14 14:36:38 +11:00
Rob Harrington
a71410042f Ensuring that account invoice orders have an address 2015-10-14 14:36:37 +11:00
Rob Harrington
815df3d667 Only clean up account invoice orders that aren't already complete, don't attempt to destroy persisted account_invoice orders 2015-10-14 14:36:37 +11:00
Rohan Mitchell
27741863c5 Add simple contribution guide 2015-10-09 15:21:58 +11:00
Maikel Linke
1751a95909 place I18n init at right place in karma task 2015-10-09 11:40:12 +11:00
Maikel Linke
c169e4af92 rename locale nor to nb 2015-10-09 10:43:55 +11:00
Maikel Linke
7d379dbe4b sort travis sets by run time 2015-10-09 10:23:48 +11:00
Maikel Linke
5f80043857 using translate filter instead of root scope function with parameters 2015-10-09 10:21:26 +11:00
Maikel Linke
e9d1cf6eb5 using translate filter instead of root scope function 2015-10-08 18:09:11 +11:00
Maikel Linke
d2470685cd clearing tmp cache with rake 2015-10-08 18:08:21 +11:00
Maikel Linke
a4db4ee782 Merge remote-tracking branch 'off/travis-parallel' into i18n-replace-strings-in-js 2015-10-08 16:07:52 +11:00
Maikel
9115e1175e Travis config for parallel execution on five nodes
This Travis configuration runs rspec on five build machines in parallel. Currently, that takes 15 to 20 minutes.
2015-10-08 15:24:48 +11:00
Maikel Linke
56fd91f82b CI server has to empty the cache if language files changed 2015-10-07 19:10:44 +11:00
Maikel Linke
d62775a785 update specs and fix labels yes and no 2015-10-07 18:05:59 +11:00
Maikel Linke
8b40d094ee new translate filter and updated specs for js translations 2015-10-07 15:47:51 +11:00
Maikel Linke
91fae79be4 Update tests for new label "Login" 2015-10-07 14:06:34 +11:00
Maikel Linke
5aa3ebde9c Set the locale to "en" in test environment. 2015-10-07 14:05:50 +11:00
Maikel Linke
bd737ef727 I18n object file for karma 2015-10-01 16:38:47 +10:00
Maikel Linke
31e7ca9fa2 locale data as js asset 2015-10-01 15:54:46 +10:00
Maikel Linke
0eed8b4578 better testing of existence of I18n 2015-10-01 14:16:59 +10:00
Maikel Linke
6b1e66ed26 Renamed no.yml to nor.yml due to error caused by using "no" 2015-10-01 13:53:10 +10:00
Maikel Linke
da42032d92 Merge remote-tracking branch 'origin/master' into i18n-replace-strings-in-js 2015-10-01 11:15:22 +10:00
Maikel Linke
143c005f0a Merge remote-tracking branch 'origin/i18n-replace-strings-in-views' into i18n-replace-strings-in-js 2015-10-01 11:15:01 +10:00
Maikel Linke
ae96541112 Internationalisation of Javascript views 2015-10-01 11:13:45 +10:00
Maikel Linke
f8725a0174 Removing unused JS partial 2015-10-01 11:12:31 +10:00
Rohan Mitchell
9c6264c4a0 On detailed xero report, do not show product totals (xero treats them as additional line items) 2015-09-25 13:52:51 +10:00
Rohan Mitchell
10bc3919ca Add SKU to detailed xero report 2015-09-22 09:28:50 +10:00
Rohan Mitchell
b5bc4701fa Detailed xero report 2015-09-22 09:15:55 +10:00
Rohan Mitchell
7552776349 Add product_and_variant_name display for Variant 2015-09-21 16:49:31 +10:00
Rohan Mitchell
8f40702369 Line items report whether they have tax included 2015-09-21 15:57:04 +10:00
Rob Harrington
9dc0598870 Adding fix to prevent account_invoice orders from being sucked into the frontend as normal orders 2015-09-18 17:25:34 +10:00
Maikel
4f05b9c28d Changing en: to fr: in French locale file 2015-09-18 09:38:21 +10:00
Maikel
aa4f1f1dec Fixing syntax typo in Norwegian language file 2015-09-18 09:37:35 +10:00
Rob Harrington
14fbeda29e Adding bugsnag notification for case where account_invoice order has errors 2015-09-17 22:38:29 +10:00
Rob Harrington
1c6f3f4877 Translating words on admin accounts page 2015-09-17 22:38:29 +10:00
Rob Harrington
2dcbe2b4f2 Updating the admin account view to show use the new account_invoice model to display data 2015-09-17 22:38:29 +10:00
Rob Harrington
27384439f8 Fixing edge case in update_billable_periods job 2015-09-17 22:38:29 +10:00
Rob Harrington
13adb61b3a Refactoring invoice update process to use new AccountInvoice model 2015-09-17 22:38:29 +10:00
Rob Harrington
77c10dafd6 Linking billable_periods to the relevant account_invoice upon creation 2015-09-17 22:38:29 +10:00
Rob Harrington
4a8f9d1e36 Adding reference to account_invoice for each billable_period 2015-09-17 22:38:29 +10:00
Rob Harrington
0debdcdd9c Renaming files from user_invoice to account_invoice 2015-09-17 22:38:28 +10:00
Rob Harrington
ae30007fed Redesignating all references to user_invoices as account_invoices 2015-09-17 22:38:28 +10:00
Rob Harrington
aa183dc9e0 Account Invoice jobs run by specifying a year and month rather than a specific start and end times 2015-09-17 22:38:28 +10:00
Rob Harrington
b1285cd07f WIP: Adding AccountInvoice model to more robustly record information about enterprise user invoices 2015-09-17 22:38:28 +10:00
Rob Harrington
79497d28d2 Associating billable periods with the relevant adjustment, and moving labelling logic to model 2015-09-17 22:38:13 +10:00
Rob Harrington
5eb20fd8cd Adding tax settings for billing enterprise users 2015-09-17 22:38:13 +10:00
Rob Harrington
01c9560a19 Account page reads from created at date of invoice 2015-09-17 22:38:13 +10:00
Rob Harrington
6cc403cd92 Preventing double creation of invoices by recognising completed invoices within the specifed period 2015-09-17 22:38:13 +10:00
Rob Harrington
11c3cf5f71 Pushing setting validation for accounts jobs into separate methods capable of logging errors to bugsnag 2015-09-17 22:38:12 +10:00
Rob Harrington
448bd12e9f Adding billing tasks to whenever schedule 2015-09-17 22:38:12 +10:00
Rob Harrington
204a3275ac Sorting billable_periods before adding adjustments to user invoices, partly for sanity, partly so that specs works in a logical way 2015-09-17 22:38:12 +10:00
Rob Harrington
6665f9b4a0 Adding global settings for controlling automatic scheduling of accounts tasks 2015-09-17 22:38:12 +10:00
Rob Harrington
ddb0aa4e74 Billable periods from the future are not obsolete 2015-09-17 22:38:12 +10:00
Rob Harrington
aa8e486a45 Look for job names without 'Struct', now that we aren't using structs 2015-09-17 22:38:12 +10:00
Rob Harrington
619c4959ff Removing button for updating billable periods from accounts and billing settings page 2015-09-17 22:38:12 +10:00
Rob Harrington
1b2a06572b Converting accounts jobs to classes, which allows initialization with start and end dates 2015-09-17 22:38:12 +10:00
Rob Harrington
cc26321ab2 Billable Period Updater does not run when end_date is in the future 2015-09-17 22:38:11 +10:00
Rob Harrington
fb01f6d32a User Invoice Finalizer does not run when end_date is in the future 2015-09-17 22:38:11 +10:00
Rob Harrington
0fbd26a3c5 User Invoice Updater does not run when end_date is in the future 2015-09-17 22:38:11 +10:00
Rob Harrington
6f3fad5864 Adding comments 2015-09-17 22:38:11 +10:00
Rob Harrington
5f61952785 UpdateUserInvoices can be run for a specific month 2015-09-17 22:38:11 +10:00
Rob Harrington
128b6853f4 Styling tweaks to the admin account page 2015-09-17 22:38:11 +10:00
Rob Harrington
bed3815df5 User invoice updater formats date strings in localtime 2015-09-17 22:38:11 +10:00
Rob Harrington
7c5816af82 Switching accounts interface over to showing invoices 2015-09-17 22:38:10 +10:00
Rob Harrington
15df1f7f26 Tightening up user selection in UpdateUserInvoices job 2015-09-17 22:38:10 +10:00
Rob Harrington
065bc087d5 Invoice updater cleans up obsolete billable adjustments, ignore billable adjustments without bills and destroys empty invoices 2015-09-17 22:38:10 +10:00
Rob Harrington
c53b5f3edb Adding finalize step to accounts and billing settigns page + controller 2015-09-17 22:38:10 +10:00
Rob Harrington
60cd5ce879 Splitting out invoice finalization as a separate step 2015-09-17 22:38:10 +10:00
Rob Harrington
8bbda5715d Adding basic template for account page 2015-09-17 22:38:10 +10:00
Rob Harrington
92eb5ed367 Adding routes for a new admin account page for users to manage their billing preferences and access invoices 2015-09-17 22:38:10 +10:00
Rob Harrington
70de4fd1fd Touching unchanged billable_periods to prevent them from being marked for deletion 2015-09-17 22:38:10 +10:00
Rob Harrington
c2c0c3684d Refactoring accounts and billing settings controller, adding start_job action 2015-09-17 22:38:09 +10:00
Rob Harrington
38e3690f56 Adding route for start_job action on accounts and billing settings controller 2015-09-17 22:38:09 +10:00
Rob Harrington
2048800c43 Billable periods updater does not auto-run user invoices updater 2015-09-17 22:38:09 +10:00
Rob Harrington
cc0f1ccfa7 Update Billable Periods automatically runs Update User Invoices immediately afterwards 2015-09-17 22:38:09 +10:00
Rob Harrington
d3e8966e65 Update User Invoices job does not run unless necessary global settings have been configured 2015-09-17 22:38:09 +10:00
Rob Harrington
e6f6a3ad81 Commenting out global configs for nightly job switches, use a button to manually run jobs instead (for now) 2015-09-17 22:38:09 +10:00
Rob Harrington
160c0d75fe Confirmation emails do not get send for orders distributed by accounts_distributor 2015-09-17 22:38:09 +10:00
Rob Harrington
f2389ee672 User Invoice Updater finalizes user invoices using global preferences for payment method and shipping method 2015-09-17 22:38:08 +10:00
Rob Harrington
0812643136 Adding views and feature spec for updating default payment and shipping method 2015-09-17 22:38:08 +10:00
Rob Harrington
3e9a61a693 Adding js infrastructure to dynamically fetch available payment and shipping methods for accounts distributor 2015-09-17 22:38:08 +10:00
Rob Harrington
e3e59d76a9 Adding global config for setting default payment and shipping methods for accounts distributor 2015-09-17 22:38:08 +10:00
Rob Harrington
65c26296bd Billable period updater cleans up untouched billable periods for the current billing period 2015-09-17 22:38:08 +10:00
Rob Harrington
9c4ed5f092 Enterprises have billable_periods 2015-09-17 22:38:08 +10:00
Rob Harrington
f0fa696d2f Default scope for BPs ignores deleted records 2015-09-17 22:38:08 +10:00
Rob Harrington
4d58faefd8 Adding timestamps to billable periods 2015-09-17 22:38:08 +10:00
Rob Harrington
311ffc3dc9 wip: user invoice updater finalizes orders on the first of the month 2015-09-17 22:37:56 +10:00
Rob Harrington
d51c69d353 WIP: User invoice updater adds adjustments to current_invoice for each relevant billable_period 2015-09-17 22:37:56 +10:00
Rob Harrington
ee8a86d495 User model can generate a current invoice for enterprise users 2015-09-17 22:37:56 +10:00
Rob Harrington
fa8c3d65dc Adding settings for global accounts and billing setup 2015-09-17 22:37:56 +10:00
Rob Harrington
b4e58a1a79 WIP: Basic structure for daily job to update user invoices 2015-09-17 22:37:55 +10:00
Rob Harrington
550434dfe8 Renaming bill_items to billable_periods 2015-09-17 22:37:55 +10:00
Rob Harrington
fc44e57171 Finishing refactor of bill item updater spec 2015-09-17 22:37:45 +10:00
Rob Harrington
77f735c722 WIP: Refactoring bill item updater specs 2015-09-17 22:37:45 +10:00
Rob Harrington
b736e209ca Bill Item Update handles enterprises created part-way through the month 2015-09-17 22:37:45 +10:00
Rob Harrington
af2bc99c71 Clean up update_bill_items spec after refactor 2015-09-17 22:37:44 +10:00
Rob Harrington
924b3b4cc3 Refactoring update_bill_items job 2015-09-17 22:37:44 +10:00
Rob Harrington
b724745acc WIP: First take at a nightly job for calculating turnover for enterprises 2015-09-17 22:37:44 +10:00
Rob Harrington
bbe25da117 Adding paper_trail verisoning RSpec helpers 2015-09-17 22:37:44 +10:00
Rob Harrington
77e361dd52 Adding shop_trial_expiry method to enterpise model 2015-09-17 22:37:44 +10:00
Rob Harrington
083d7327bc Adding BillItem to database 2015-09-17 22:37:44 +10:00
Rob Harrington
2fa217df56 Adding paper_trail to enterprise model, to track changes to owner_id and sells 2015-09-17 22:37:33 +10:00
Rob Harrington
6489848eff Adding paper_trail gem 2015-09-17 22:37:33 +10:00
sigmundpetersen
b8e40d799b Added translations 2015-09-17 14:18:09 +02:00
Continuous Integration
205a7f1673 Auto-merge from CI [skip ci] 2015-09-17 09:16:20 +10:00
Maikel Linke
2e591b98e1 remove unused javascript 2015-09-16 16:52:26 +10:00
Maikel Linke
0b4a43d77a Merge remote-tracking branch 'origin/master' into i18n-replace-strings-in-views
Conflicts:
	app/views/shared/menu/_cart.html.haml
	app/views/spree/order_mailer/confirm_email_for_shop.html.haml
2015-09-16 16:32:16 +10:00
Maikel Linke
ce87ea54cd Merge branch 'i18n-replace-strings-in-views' of github.com:openfoodfoundation/openfoodnetwork into i18n-replace-strings-in-views 2015-09-16 16:24:38 +10:00
Maikel Linke
637e5c4fee PermalinkGenerator for products 2015-09-16 15:45:10 +10:00
Maikel Linke
ecca23488d Merge branch 'ci-handling-git-tags' into combined/deadlock-js-spec_ci-git-tags_product-permalinks 2015-09-16 15:43:13 +10:00
Maikel Linke
2488411b94 JS feature specs completing before cleaning db
Some specs ran into a deadlock when the Database::Cleaner tried to do
its job while AJAX requests were still triggering other actions.
2015-09-16 15:38:09 +10:00
Maikel Linke
3f822ed0e3 trying to get rid of intermittent failures 2015-09-16 13:06:32 +10:00
Maikel Linke
33af6cbfb1 Specs pending for lagging JS spec test 2015-09-16 11:24:44 +10:00
Maikel Linke
326c972f63 Handling nil in final_weight_volume calculation 2015-09-16 10:12:59 +10:00
Myriam
11892ffe21 creation of the french translation file 2015-09-14 14:42:37 +02:00
Maikel Linke
10cd654ff5 CI Handling git tags
Buildkite is running tags like branches. This caused `git branch`
commands to fail. The function got extended to handle tags as well.
Ideally, Buildkite will offer an option not to rebuild tags.
2015-09-11 15:41:44 +10:00
Myriam
3e53decd85 Delete fr.yml 2015-09-04 15:25:53 +02:00
Myriam
4f0e75893e Create fr.yml 2015-09-04 15:22:19 +02:00
sigmundpetersen
e61abb92d2 Create no.yml 2015-09-03 12:16:58 +02:00
Maikel Linke
832f47d6b0 fix i18n typo 2015-09-02 16:58:04 +10:00
Maikel Linke
415dac3ae3 Updating spec for new Login label 2015-08-28 21:12:56 +10:00
Maikel Linke
8b6f5b4a99 Updating spec for new Login label 2015-08-28 18:37:24 +10:00
Continuous Integration
06010bd8ad Auto-merge from CI [skip ci] 2015-08-28 17:04:53 +10:00
Maikel Linke
85c99102dd i18n: Replacing all language strings in app/view/
Languages strings were moved to config/locale/en.yml. All views contain
according calls to t() now.
2015-08-28 16:59:23 +10:00
Rohan Mitchell
d908701b59 Merge branch 'master' into folklabs-producer-emails
Conflicts:
	Gemfile
2015-06-11 17:02:34 +10:00
Liv Galendez
db19303f1a Added asterisk to new field Owner since it seems to be required also 2015-06-02 18:23:41 +10:00
Liv Galendez
2c22d4e774 Merge https://github.com/openfoodfoundation/openfoodnetwork into indicate-required-fields-for-new-enterprise-form 2015-06-02 18:11:17 +10:00
Liv Galendez
5fe31e6333 Added asterisks to required fields in new enterprise creation form. 2015-06-02 18:03:16 +10:00
Rohan Mitchell
e3085d9224 Merge branch 'producer-emails' of https://github.com/folklabs/openfoodnetwork into folklabs-producer-emails 2015-05-29 17:36:56 +10:00
Rohan Mitchell
3dbc2e0382 Merge branch 'master' into folklabs-producer-emails 2015-05-29 17:36:11 +10:00
Paul Mackay
baaa192967 #275: Code cleanup. 2015-05-24 10:44:39 +01:00
Paul Mackay
2f05fc3824 #275: Insert receival time and instructions into email. 2015-05-24 10:38:49 +01:00
Paul Mackay
955f41633a Merge remote-tracking branch 'refs/remotes/origin/master' into producer-emails 2015-05-11 08:36:09 +01:00
Paul Mackay
fd37324359 #536: Add permissions checking for Notify producers action. 2015-05-09 11:02:25 +01:00
Rohan Mitchell
63ec0d7dcf Merge branch 'master' into folklabs-producer-emails 2015-05-05 11:48:31 +10:00
Rohan Mitchell
91ca5f0213 Fix specs for receival_time / instructions 2015-05-01 10:08:24 +10:00
Rohan Mitchell
f5b45fa0ba Merge branch 'master' into folklabs-producer-emails 2015-05-01 09:51:01 +10:00
Rohan Mitchell
73376b30e2 Convention 2015-04-29 15:56:27 +10:00
Rohan Mitchell
3565548e91 Extract data preparation into private methods 2015-04-29 15:50:42 +10:00
Rohan Mitchell
6999bcfd4e Only include complete orders in producer mailer report 2015-04-29 15:43:50 +10:00
Rohan Mitchell
2fe5d7c73f Remove commented code, use neater syntax for accessing Spree config var 2015-04-29 15:33:39 +10:00
Rohan Mitchell
3a3bf19cf8 Clean up duplication 2015-04-29 15:31:42 +10:00
Rohan Mitchell
30e04b509d Clean up routes 2015-04-29 15:31:13 +10:00
Rohan Mitchell
4279742de5 Avoid serialising entire order cycle when enqueuing OrderCycleNotificationJob 2015-04-29 15:21:05 +10:00
Rohan Mitchell
713c93a570 Fix OrderCycleFormApplicator specs 2015-04-29 15:00:22 +10:00
Rohan Mitchell
36584f0177 Remove puts from specs, fix failing controller spec 2015-04-29 14:46:20 +10:00
Rohan Mitchell
6b1c125b03 Merge branch 'producer-emails' of https://github.com/folklabs/openfoodnetwork into folklabs-producer-emails
Conflicts:
	Gemfile.lock
	app/controllers/admin/order_cycles_controller.rb
	app/views/admin/order_cycles/edit.html.haml
	app/views/admin/order_cycles/show.rep
	db/schema.rb
	spec/controllers/admin/order_cycles_controller_spec.rb
2015-04-29 14:42:17 +10:00
Paul Mackay
0f1ec17698 #275: Use better path variable in test. 2015-04-28 16:08:26 +01:00
Paul Mackay
9103e83ce2 #275: spec test for controller method. Other small fixes. 2015-04-11 18:28:31 +01:00
Paul Mackay
99709b53ed Change controller action to 'notify_producers'.
Add flash message on completion.
Simplify job variables.
Improve mailer query.
Spec for job.
2015-04-11 13:19:48 +01:00
Paul Mackay
717b3b6494 #275: Fixes for testing aggregated orders. 2015-03-10 19:19:57 +00:00
Paul Mackay
ca665dc6bc Merge master into producer-emails. 2015-03-04 19:09:43 +00:00
Paul Mackay
67b17de695 #275: Add receival time and instructions to order cycle for incoming exchanges. Fix issues from feedback. 2014-12-30 11:33:13 +00:00
Paul Mackay
8d5a0aea9f Setup daemon and delayed job table. 2014-11-24 21:25:58 +00:00
Paul Mackay
803d790b7a Remove nokigiri warning.
Tweak email subject.
2014-11-24 21:00:36 +00:00
Paul Mackay
375bdc0586 #275: Change report format. Improved mailer. 2014-11-16 07:14:29 +00:00
Paul Mackay
9b7fd1c16b #275: small tweaks. 2014-11-09 11:19:26 +00:00
Paul Mackay
05437e2a56 #275: start on producer email. 2014-11-09 11:17:46 +00:00
1110 changed files with 31844 additions and 23868 deletions

16
.codeclimate.yml Normal file
View File

@@ -0,0 +1,16 @@
engines:
rubocop:
enabled: true
exclude_fingerprints:
- ac41db8d4ec4cbf508c353d9b65a024f
- 8e3b6322aef5be9f38700b3fd0cd347e
scss-lint:
enabled: true
ratings:
paths:
- app/**
- lib/**
- "**.rb"
exclude_paths:
- spec/**/*
- vendor/**/*

2
.gitignore vendored
View File

@@ -34,7 +34,9 @@ config/abr.yml
config/heroku_env.rb
config/newrelic.yml
config/initializers/feature_toggle.rb
config/initializers/db2fog.rb
NERD_tree*
coverage
libpeerconnection.log
/config/application.yml
node_modules

29
.rubocop.yml Normal file
View File

@@ -0,0 +1,29 @@
AllCops:
Include:
- '**/Rakefile'
- '**/config.ru'
Exclude:
- 'db/**/*'
- 'config/**/*'
- 'script/**/*'
- 'spec/**/*'
- !ruby/regexp /old_and_unused\.rb$/
Documentation:
Enabled: false
Style/EmptyLinesAroundClassBody:
Enabled: false
Style/BracesAroundHashParameters:
Enabled: false
Metrics/LineLength:
Enabled: false
Max: 120
MethodLength:
Enabled: false
StringLiterals:
Enabled: false

View File

@@ -1 +1 @@
1.9.3-p392
2.1.5

3
.scss-lint.yml Normal file
View File

@@ -0,0 +1,3 @@
scss_files: 'app/assets/stylesheets/**/*.css.scss'
exclude: 'app/assets/stylesheets/shared/**'

View File

@@ -1,15 +1,61 @@
language: ruby
sudo: false
cache: bundler
bundler_args: --without development
rvm:
- "1.9.3"
services: postgresql
before_install:
- "2.1.5"
# Set the timezone for phantomjs with TZ
# Set the timezone for karma with TIMEZONE
#
# The test cases are roughly split according to their test times.
# It would be better to use https://github.com/ArturT/knapsack.
env:
global:
- TZ="Australia/Melbourne"
- TIMEZONE="Australia/Melbourne"
- CI_NODE_TOTAL=5
matrix:
- CI_NODE_INDEX=0
- CI_NODE_INDEX=1
- CI_NODE_INDEX=2
- CI_NODE_INDEX=3
- CI_NODE_INDEX=4 KARMA="true" GITHUB_DEPLOY="true"
before_script:
- cp config/database.travis.yml config/database.yml
- psql -c 'create database open_food_network_test;' -U postgres
- cp config/application.yml.example config/application.yml
- RAILS_ENV=test bundle exec rake db:create db:schema:load
# Only install PhantomJS if it is not already present (ie. cached)
- npm list -g phantomjs-prebuilt@~2.1.7 --depth=0 || npm install -g phantomjs-prebuilt@~2.1.7
- export PATH=`npm bin -g`:$PATH
- >
if [ "$KARMA" = "true" ]; then
npm install -g npm@'3.8.8'
npm install
npm install -g karma-cli@0.1.2
fi
script:
- RAILS_ENV=test bundle exec rake db:migrate --trace
- bundle exec rake spec
- 'if [ "$KARMA" = "true" ]; then bundle exec rake karma:run; else echo "Skipping karma run"; fi'
#- "KNAPSACK_GENERATE_REPORT=true bundle exec rspec spec"
- "bundle exec rake 'knapsack:rspec[--tag ~performance]'"
after_success:
- >
if [ "$GITHUB_DEPLOY" = "true" -a "$TRAVIS_PULL_REQUEST" = "false" -a -n "$TRAVIS_BRANCH" -a -n "$GITHUB_API_SECRET" ]; then
description="`git show "$TRAVIS_BRANCH" -s --oneline --no-color`"
data="{
\"ref\":\"$TRAVIS_BRANCH\",
\"description\":\"$description\",
\"environment\":\"staging\",
\"required_contexts\":[]}"
curl -u "$GITHUB_API_SECRET" -d "$data" "https://api.github.com/repos/$TRAVIS_REPO_SLUG/deployments"
else
echo "Not deploying on this build."
fi
notifications:
email: false

8
.tx/config Normal file
View File

@@ -0,0 +1,8 @@
[main]
host = https://www.transifex.com
[open-food-network.enyml]
file_filter = config/locales/<lang>.yml
source_lang = en
type = YML

33
CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,33 @@
# Contributing
We love pull requests from everyone. Here are some instructions for
contributing code to Open Food Network. See the [developer wiki](https://github.com/openfoodfoundation/openfoodnetwork/wiki) for more information.
Fork, then clone the repo:
git clone git@github.com:your-username/openfoodnetwork.git
Follow the instructions in README.markdown to set up your machine.
Make sure the tests pass:
rspec spec
Make your change. Add tests for your change. Make the tests pass:
rspec spec
Push to your fork and [submit a pull request][pr].
[pr]: https://github.com/openfoodfoundation/openfoodnetwork/compare/
At this point you're waiting on us. We may suggest some changes or
improvements or alternatives.
To increase the chance that your pull request is swiftly accepted:
* Write tests
* Use a style consistent with the rest of the codebase
* Before submitting, [rebase your work][rebase] on the current master branch
[rebase]: https://www.atlassian.com/git/tutorials/merging-vs-rebasing/workflow-walkthrough

32
Gemfile
View File

@@ -1,18 +1,22 @@
source 'https://rubygems.org'
ruby "1.9.3"
ruby "2.1.5"
gem 'rails', '3.2.21'
gem 'rails-i18n', '~> 3.0.0'
gem 'i18n', '~> 0.6.11'
gem 'pg'
gem 'spree', :github => 'openfoodfoundation/spree', :branch => '1-3-stable'
gem 'spree_i18n', :github => 'spree/spree_i18n', :branch => '1-3-stable'
gem 'spree_auth_devise', :github => 'spree/spree_auth_devise', :branch => '1-3-stable'
# Patched version. See http://rubysec.com/advisories/CVE-2015-5312/.
gem 'nokogiri', '>= 1.6.7.1'
# Waiting on merge of PR #117
# https://github.com/spree-contrib/better_spree_paypal_express/pull/117
gem 'spree_paypal_express', :github => "openfoodfoundation/better_spree_paypal_express", :branch => "1-3-stable"
gem 'pg'
gem 'spree', github: 'openfoodfoundation/spree', branch: '1-3-stable'
gem 'spree_i18n', github: 'spree/spree_i18n', branch: '1-3-stable'
gem 'spree_auth_devise', github: 'spree/spree_auth_devise', branch: '1-3-stable'
# Our branch contains two changes
# - Pass customer email and phone number to PayPal (merged to upstream master)
# - Change type of password from string to password to hide it in the form
gem 'spree_paypal_express', :github => "openfoodfoundation/better_spree_paypal_express", :branch => "hide-password"
#gem 'spree_paypal_express', :github => "spree-contrib/better_spree_paypal_express", :branch => "1-3-stable"
gem 'delayed_job_active_record'
@@ -24,7 +28,7 @@ gem 'comfortable_mexican_sofa'
gem 'simple_form', :github => 'RohanM/simple_form'
gem 'unicorn'
gem 'angularjs-rails', '1.2.13'
gem 'angularjs-rails', '1.5.5'
gem 'bugsnag'
gem 'newrelic_rpm'
gem 'haml'
@@ -52,6 +56,11 @@ gem 'roadie-rails', '~> 1.0.3'
gem 'figaro'
gem 'blockenspiel'
gem 'acts-as-taggable-on', '~> 3.4'
gem 'paper_trail', '~> 3.0.8'
gem 'diffy'
gem 'wicked_pdf'
gem 'wkhtmltopdf-binary'
gem 'foreigner'
gem 'immigrant'
@@ -91,7 +100,6 @@ group :test, :development do
gem 'factory_girl_rails', :require => false
gem 'capybara'
gem 'database_cleaner', '0.7.1', :require => false
gem 'simplecov', :require => false
gem 'awesome_print'
gem 'letter_opener'
gem 'timecop'
@@ -99,6 +107,8 @@ group :test, :development do
gem 'rspec-retry'
gem 'json_spec'
gem 'unicorn-rails'
gem 'atomic'
gem 'knapsack'
end
group :test do
@@ -109,7 +119,7 @@ group :test do
end
group :development do
gem 'pry-debugger'
gem 'pry-byebug'
gem 'debugger-linecache'
gem 'guard'
gem 'guard-livereload'

View File

@@ -14,8 +14,8 @@ GIT
GIT
remote: git://github.com/openfoodfoundation/better_spree_paypal_express.git
revision: cdd61161ccd27cd8d183f9321422c7be113796b8
branch: 1-3-stable
revision: 840d973cd5bd3250b17674a624dad494aeb09eb3
branch: hide-password
specs:
spree_paypal_express (2.0.3)
paypal-sdk-merchant (= 1.106.1)
@@ -23,7 +23,7 @@ GIT
GIT
remote: git://github.com/openfoodfoundation/spree.git
revision: afcc23e489eb604a3e2651598a7c8364e2acc7b3
revision: 6e3edfe40a5de8eba0095b2c5f3db9ea54c3afda
branch: 1-3-stable
specs:
spree (1.3.6.beta)
@@ -54,7 +54,7 @@ GIT
rabl (= 0.7.2)
rails (~> 3.2.16)
ransack (= 0.7.2)
select2-rails (= 3.2.1)
select2-rails (= 3.5.9.3)
state_machine (= 1.1.2)
stringex (~> 1.3.2)
truncate_html (~> 0.5.5)
@@ -107,6 +107,7 @@ GIT
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (2.3.2)
actionmailer (3.2.21)
actionpack (= 3.2.21)
mail (~> 2.5.4)
@@ -121,10 +122,10 @@ GEM
rack-test (~> 0.6.1)
sprockets (~> 2.2.1)
active_link_to (1.0.0)
active_model_serializers (0.8.1)
active_model_serializers (0.8.3)
activemodel (>= 3.0)
activemerchant (1.48.0)
activesupport (>= 3.2.14, < 5.0.0)
activemerchant (1.57.0)
activesupport (>= 3.2.14, < 5.1)
builder (>= 2.1.2, < 4.0.0)
i18n (>= 0.6.9)
nokogiri (~> 1.4)
@@ -152,9 +153,10 @@ GEM
sprockets (~> 2)
tilt
angularjs-file-upload-rails (1.1.0)
angularjs-rails (1.2.13)
angularjs-rails (1.5.5)
ansi (1.4.2)
arel (3.0.3)
atomic (1.1.99)
awesome_nested_set (2.1.5)
activerecord (>= 3.0.0)
awesome_print (1.0.2)
@@ -170,8 +172,12 @@ GEM
httparty (>= 0.6, < 1.0)
multi_json (~> 1.0)
builder (3.0.4)
byebug (2.7.0)
columnize (~> 0.3)
debugger-linecache (~> 1.2)
cancan (1.6.8)
capybara (2.2.1)
capybara (2.7.1)
addressable
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
@@ -190,12 +196,12 @@ GEM
coffee-rails (3.2.2)
coffee-script (>= 2.2.0)
railties (~> 3.2.0)
coffee-script (2.2.0)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.3.3)
coffee-script-source (1.10.0)
colorize (0.7.7)
columnize (0.3.6)
columnize (0.9.0)
comfortable_mexican_sofa (1.6.24)
active_link_to (~> 1.0.0)
paperclip (>= 2.3.0)
@@ -229,12 +235,7 @@ GEM
activerecord (~> 3.0)
fog (~> 1.0)
rails (~> 3.0)
debugger (1.6.1)
columnize (>= 0.3.1)
debugger-linecache (~> 1.2.0)
debugger-ruby_core_source (~> 1.2.3)
debugger-linecache (1.2.0)
debugger-ruby_core_source (1.2.3)
delayed_job (4.0.4)
activesupport (>= 3.0, < 4.2)
delayed_job_active_record (4.0.2)
@@ -248,13 +249,14 @@ GEM
devise-encryptable (0.1.2)
devise (>= 2.1.0)
diff-lcs (1.2.4)
diffy (3.1.0)
em-websocket (0.5.0)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0.5.3)
erubis (2.7.0)
eventmachine (1.0.3)
excon (0.25.3)
execjs (2.5.2)
eventmachine (1.0.8)
excon (0.45.4)
execjs (2.6.0)
factory_girl (3.3.0)
activesupport (>= 3.0.0)
factory_girl_rails (3.3.0)
@@ -265,19 +267,117 @@ GEM
figaro (0.7.0)
bundler (~> 1.0)
rails (>= 3, < 5)
fog (1.14.0)
fission (0.5.0)
CFPropertyList (~> 2.2)
fog (1.36.0)
fog-aliyun (>= 0.1.0)
fog-atmos
fog-aws (>= 0.6.0)
fog-brightbox (~> 0.4)
fog-core (~> 1.32)
fog-dynect (~> 0.0.2)
fog-ecloud (~> 0.1)
fog-google (<= 0.1.0)
fog-json
fog-local
fog-powerdns (>= 0.1.1)
fog-profitbricks
fog-radosgw (>= 0.0.2)
fog-riakcs
fog-sakuracloud (>= 0.0.4)
fog-serverlove
fog-softlayer
fog-storm_on_demand
fog-terremark
fog-vmfusion
fog-voxel
fog-xenserver
fog-xml (~> 0.1.1)
ipaddress (~> 0.5)
nokogiri (~> 1.5, >= 1.5.11)
fog-aliyun (0.1.0)
fog-core (~> 1.27)
fog-json (~> 1.0)
ipaddress (~> 0.8)
xml-simple (~> 1.1)
fog-atmos (0.1.0)
fog-core
fog-xml
fog-aws (0.7.6)
fog-core (~> 1.27)
fog-json (~> 1.0)
fog-xml (~> 0.1)
ipaddress (~> 0.8)
fog-brightbox (0.9.0)
fog-core (~> 1.22)
fog-json
inflecto (~> 0.0.2)
fog-core (1.35.0)
builder
excon (~> 0.25.0)
formatador (~> 0.2.0)
mime-types
multi_json (~> 1.0)
net-scp (~> 1.1)
net-ssh (>= 2.1.3)
nokogiri (~> 1.5)
ruby-hmac
excon (~> 0.45)
formatador (~> 0.2)
fog-dynect (0.0.2)
fog-core
fog-json
fog-xml
fog-ecloud (0.3.0)
fog-core
fog-xml
fog-google (0.1.0)
fog-core
fog-json
fog-xml
fog-json (1.0.2)
fog-core (~> 1.0)
multi_json (~> 1.10)
fog-local (0.2.1)
fog-core (~> 1.27)
fog-powerdns (0.1.1)
fog-core (~> 1.27)
fog-json (~> 1.0)
fog-xml (~> 0.1)
fog-profitbricks (0.0.5)
fog-core
fog-xml
nokogiri
fog-radosgw (0.0.4)
fog-core (>= 1.21.0)
fog-json
fog-xml (>= 0.0.1)
fog-riakcs (0.1.0)
fog-core
fog-json
fog-xml
fog-sakuracloud (1.4.0)
fog-core
fog-json
fog-serverlove (0.1.2)
fog-core
fog-json
fog-softlayer (1.0.2)
fog-core
fog-json
fog-storm_on_demand (0.1.1)
fog-core
fog-json
fog-terremark (0.1.0)
fog-core
fog-xml
fog-vmfusion (0.1.0)
fission
fog-core
fog-voxel (0.1.0)
fog-core
fog-xml
fog-xenserver (0.2.2)
fog-core
fog-xml
fog-xml (0.1.2)
fog-core
nokogiri (~> 1.5, >= 1.5.11)
foreigner (1.6.1)
activerecord (>= 3.0.0)
formatador (0.2.4)
formatador (0.2.5)
foundation-icons-sass-rails (3.0.0)
railties (>= 3.1.1)
sass-rails (>= 3.1.1)
@@ -319,6 +419,8 @@ GEM
immigrant (0.1.6)
activerecord (>= 3.0)
foreigner (>= 1.2.1)
inflecto (0.0.2)
ipaddress (0.8.0)
journey (1.0.4)
jquery-rails (2.2.2)
railties (>= 3.0, < 5.0)
@@ -331,11 +433,14 @@ GEM
actionpack (>= 3.0.0)
activesupport (>= 3.0.0)
kgio (2.9.3)
knapsack (1.5.1)
rake
timecop (>= 0.1.0)
launchy (2.1.2)
addressable (~> 2.3)
letter_opener (1.0.0)
launchy (>= 2.0.4)
libv8 (3.16.14.3)
libv8 (3.16.14.11)
listen (2.2.0)
celluloid (>= 0.15.2)
rb-fsevent (>= 0.9.3)
@@ -346,21 +451,21 @@ GEM
treetop (~> 1.4.8)
method_source (0.8.2)
mime-types (1.25.1)
mini_portile (0.6.2)
mini_portile2 (2.0.0)
momentjs-rails (2.5.1)
railties (>= 3.1)
money (5.1.1)
i18n (~> 0.6.0)
multi_json (1.11.0)
multi_json (1.12.0)
multi_xml (0.5.5)
net-scp (1.1.2)
net-ssh (>= 2.6.5)
net-ssh (2.6.8)
newrelic_rpm (3.12.0.288)
nokogiri (1.6.6.2)
mini_portile (~> 0.6.0)
nokogiri (1.6.7.2)
mini_portile2 (~> 2.0.0.rc2)
oj (2.1.2)
orm_adapter (0.5.0)
paper_trail (3.0.8)
activerecord (>= 3.0, < 5.0)
activesupport (>= 3.0, < 5.0)
paperclip (3.5.4)
activemodel (>= 3.0.0)
activesupport (>= 3.0.0)
@@ -375,7 +480,7 @@ GEM
paypal-sdk-merchant (1.106.1)
paypal-sdk-core (~> 0.2.3)
pg (0.13.2)
poltergeist (1.5.0)
poltergeist (1.9.0)
capybara (~> 2.1)
cliver (~> 0.3.1)
multi_json (~> 1.0)
@@ -387,13 +492,13 @@ GEM
coderay (~> 1.0.5)
method_source (~> 0.8)
slop (~> 3.4)
pry-debugger (0.2.2)
debugger (~> 1.3)
pry (~> 0.9.10)
pry-byebug (1.3.2)
byebug (~> 2.7)
pry (~> 0.9.12)
rabl (0.7.2)
activesupport (>= 2.3.14)
multi_json (~> 1.0)
rack (1.4.5)
rack (1.4.7)
rack-cache (1.2)
rack (>= 0.4)
rack-livereload (0.3.15)
@@ -464,7 +569,6 @@ GEM
rspec-mocks (~> 2.14.0)
rspec-retry (0.4.2)
rspec-core
ruby-hmac (0.4.0)
ruby-progressbar (1.7.1)
safe_yaml (0.9.5)
sass (3.3.14)
@@ -472,14 +576,10 @@ GEM
railties (~> 3.2.0)
sass (>= 3.1.10)
tilt (~> 1.3)
select2-rails (3.2.1)
select2-rails (3.5.9.3)
thor (~> 0.14)
shoulda-matchers (1.1.0)
activesupport (>= 3.0.0)
simplecov (0.7.1)
multi_json (~> 1.0)
simplecov-html (~> 0.7.1)
simplecov-html (0.7.1)
slop (3.4.5)
spinjs-rails (1.3)
rails (>= 3.1)
@@ -527,10 +627,15 @@ GEM
webmock (1.13.0)
addressable (>= 2.2.7)
crack (>= 0.3.2)
websocket-driver (0.3.2)
websocket-driver (0.6.3)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.2)
whenever (0.9.2)
activesupport (>= 2.3.4)
chronic (>= 0.6.3)
wicked_pdf (0.11.0)
rails
wkhtmltopdf-binary (0.9.9.3)
xml-simple (1.1.4)
xpath (2.0.0)
nokogiri (~> 1.3)
@@ -546,7 +651,8 @@ DEPENDENCIES
andand
angular-rails-templates (~> 0.2.0)
angularjs-file-upload-rails (~> 1.1.0)
angularjs-rails (= 1.2.13)
angularjs-rails (= 1.5.5)
atomic
awesome_print
aws-sdk
blockenspiel
@@ -564,6 +670,7 @@ DEPENDENCIES
debugger-linecache
deface!
delayed_job_active_record
diffy
factory_girl_rails
figaro
foreigner
@@ -583,15 +690,18 @@ DEPENDENCIES
immigrant
jquery-rails
json_spec
knapsack
letter_opener
momentjs-rails
newrelic_rpm
nokogiri (>= 1.6.7.1)
oj
paper_trail (~> 3.0.8)
paperclip
parallel_tests
pg
poltergeist
pry-debugger
pry-byebug
rabl
rack-livereload
rack-ssl
@@ -606,7 +716,6 @@ DEPENDENCIES
sass-rails (~> 3.2.3)
shoulda-matchers
simple_form!
simplecov
spinjs-rails
spree!
spree_auth_devise!
@@ -622,3 +731,8 @@ DEPENDENCIES
unicorn-rails
webmock
whenever
wicked_pdf
wkhtmltopdf-binary
BUNDLED WITH
1.11.2

View File

@@ -1,3 +1,4 @@
[![Build Status](https://travis-ci.org/openfoodfoundation/openfoodnetwork.svg?branch=master)](https://travis-ci.org/openfoodfoundation/openfoodnetwork)
[![Code Climate](https://codeclimate.com/github/openfoodfoundation/openfoodnetwork.png)](https://codeclimate.com/github/openfoodfoundation/openfoodnetwork)
# Open Food Network
@@ -14,19 +15,21 @@ We're part of global movement - get involved!
## Getting started
Below are instructions for setting up a development environment for Open Food Network. If you're interested in provisioning a server, see [the project's Ansible playbooks](https://github.com/openfoodfoundation/ofn_deployment).
Below are instructions for setting up a development environment for Open Food Network. More information is in the [developer wiki](https://github.com/openfoodfoundation/openfoodnetwork/wiki).
If you're interested in provisioning a server, see [the project's Ansible playbooks](https://github.com/openfoodfoundation/ofn_deployment).
## Dependencies
### Dependencies
* Rails 3.2.x
* Ruby 1.9.3
* Ruby 2.1.5
* PostgreSQL database
* PhantomJS (for testing)
* See Gemfile for a list of gems required
## Get it
### Get it
The source code is managed with Git (a version control system) and
hosted at GitHub.
@@ -40,11 +43,11 @@ You can download the source with the command:
git clone https://github.com/openfoodfoundation/openfoodnetwork.git
## Get it running
### Get it running
For those new to Rails, the following tutorial will help get you up to speed with configuring a Rails environment: http://guides.rubyonrails.org/getting_started.html .
First, check your dependencies: Ensure that you have Ruby >= 1.9.3 installed:
First, check your dependencies: Ensure that you have Ruby 2.1.5 installed:
ruby --version
@@ -58,6 +61,15 @@ Configure the site:
cp config/application.yml.example config/application.yml
edit config/application.yml
Create a PostgreSQL user:
* Login as your system postrgresql priviledged user: `sudo -i -u postgres` (this may vary on your OS). Now your prompt looks like: `[postgres@your_host ~]$`
* Create the `ofn` database superuser and give it the password `f00d`:
```
createuser -s -P ofn
```
Create the development and test databases, using the settings specified in `config/database.yml`, and populate them with a schema and seed data:
rake db:setup
@@ -71,7 +83,7 @@ At long last, your dreams of spinning up a development server can be realised:
rails server
## Testing
### Testing
Tests, both unit and integration, are based on RSpec. To run the test suite, first prepare the test database:
@@ -97,6 +109,10 @@ usage instructions.
* Will Marshall (http://soundcloud.com/willmarshall)
* Laura Summers (https://github.com/summerscope)
* Maikel Linke (https://github.com/mkllnk)
* Lynne Davis (https://github.com/lin-d-hop)
* Paul Mackay (https://github.com/pmackay)
* Steve Petitt (https://github.com/stveep)
## Licence

View File

@@ -5,3 +5,5 @@
require File.expand_path('../config/application', __FILE__)
Openfoodnetwork::Application.load_tasks
Knapsack.load_tasks if defined?(Knapsack)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.9 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 317 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 619 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 86 KiB

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 71 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 313 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 KiB

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1003 KiB

After

Width:  |  Height:  |  Size: 138 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 108 KiB

After

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 662 KiB

After

Width:  |  Height:  |  Size: 570 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 300 KiB

After

Width:  |  Height:  |  Size: 283 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 215 KiB

After

Width:  |  Height:  |  Size: 206 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 256 KiB

After

Width:  |  Height:  |  Size: 244 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 197 KiB

After

Width:  |  Height:  |  Size: 195 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 125 KiB

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 784 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 840 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.0 KiB

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 535 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 971 B

After

Width:  |  Height:  |  Size: 957 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
viewBox="0 0 300 104"
enable-background="new 0 0 300 104"
id="svg2"
version="1.1"
inkscape:version="0.48.3.1 r9886"
sodipodi:docname="logo-black.svg"
width="100%"
height="100%">
<metadata
id="metadata24">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs22" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1280"
inkscape:window-height="741"
id="namedview20"
showgrid="false"
inkscape:zoom="1.8101934"
inkscape:cx="126.57728"
inkscape:cy="62.030566"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
inkscape:current-layer="g4" />
<g
id="g4"
fill="#fff">
<path
d="M142.7 15.6c.4 3.2.4 7.5 0 10.7-.5 4.6-3.8 8.4-9.1 8.4s-8.5-3.8-9.1-8.4c-.4-3.2-.4-7.5 0-10.7.5-4.6 3.8-8.4 9.1-8.4s8.6 3.8 9.1 8.4m-5.3 10.7c.4-3.2.4-7.5 0-10.7-.2-1.7-1.4-3-3.7-3-2.3 0-3.5 1.4-3.7 3-.4 3.2-.4 7.5 0 10.7.2 1.7 1.4 3 3.7 3 2.3 0 3.5-1.3 3.7-3"
id="path6"
style="fill:#000000" />
<path
d="M156.4 7.6c4.4 0 8 3.6 8 8s-3.6 8-8 8H153c-.2 0-.4.2-.4.4v9.5c0 .4-.3.8-.8.8H148c-.4 0-.8-.3-.8-.8V8.4c0-.4.3-.8.8-.8h8.4zm-3.5 5.3c-.2 0-.4.2-.4.4v4.6c0 .2.2.4.4.4h3.4c1.4 0 2.7-1.2 2.7-2.7 0-1.4-1.2-2.7-2.7-2.7h-3.4zM172.9 28.6c0 .2.2.4.4.4h9c.4 0 .8.3.8.8v3.8c0 .4-.3.8-.8.8h-14c-.4 0-.8-.3-.8-.8V8.4c0-.4.3-.8.8-.8h13.8c.4 0 .8.3.8.8v3.8c0 .4-.3.8-.8.8h-8.9c-.2 0-.4.2-.4.4V18c0 .2.2.4.4.4h8.6c.4 0 .8.3.8.8V23c0 .4-.3.8-.8.8h-8.6c-.2 0-.4.2-.4.4v4.4zM199.4 34.3c-.6 0-.9-.3-1-.6l-5.2-13.4c-.1-.2-.3-.2-.3.1v13.2c0 .4-.3.8-.8.8h-3.8c-.4 0-.8-.3-.8-.8V8.4c0-.4.3-.8.8-.8h4.5c.6 0 .8.3 1 .7l5.2 14.5c.1.2.3.2.3-.1V8.4c0-.4.3-.8.8-.8h3.8c.4 0 .8.3.8.8v25.1c0 .4-.3.8-.8.8h-4.5zM224.4 24v9.5c0 .4-.3.8-.8.8h-3.8c-.4 0-.8-.3-.8-.8V8.4c0-.4.3-.8.8-.8h13.3c.4 0 .8.3.8.8v3.8c0 .4-.3.8-.8.8h-8.4c-.2 0-.4.2-.4.4V18c0 .2.2.4.4.4h8c.4 0 .8.3.8.8V23c0 .4-.3.8-.8.8h-8c-.1-.2-.3 0-.3.2M255.6 15.6c.4 3.2.4 7.5 0 10.7-.5 4.6-3.8 8.4-9.1 8.4s-8.5-3.8-9.1-8.4c-.4-3.2-.4-7.5 0-10.7.5-4.6 3.8-8.4 9.1-8.4s8.6 3.8 9.1 8.4m-5.3 10.7c.4-3.2.4-7.5 0-10.7-.2-1.7-1.4-3-3.7-3-2.3 0-3.5 1.4-3.7 3-.4 3.2-.4 7.5 0 10.7.2 1.7 1.4 3 3.7 3 2.3 0 3.5-1.3 3.7-3M278 15.6c.4 3.2.4 7.5 0 10.7-.5 4.6-3.8 8.4-9.1 8.4s-8.5-3.8-9.1-8.4c-.4-3.2-.4-7.5 0-10.7.5-4.6 3.8-8.4 9.1-8.4s8.5 3.8 9.1 8.4m-5.4 10.7c.4-3.2.4-7.5 0-10.7-.2-1.7-1.4-3-3.7-3-2.3 0-3.5 1.4-3.7 3-.4 3.2-.4 7.5 0 10.7.2 1.7 1.4 3 3.7 3 2.3 0 3.5-1.3 3.7-3"
id="path8"
style="fill:#000000" />
<path
d="M291.2 7.6c4.7 0 8 3.8 8.5 8.4.4 3.2.4 6.6 0 9.8-.5 4.6-3.8 8.4-8.5 8.4h-8c-.4 0-.8-.3-.8-.8v-25c0-.4.3-.8.8-.8h8zm-3 5.3c-.2 0-.4.2-.4.4v15.2c0 .2.2.4.4.4h3c1.8 0 2.9-1.4 3.1-3.1.4-3.2.4-6.6 0-9.8-.2-1.7-1.4-3.1-3.1-3.1h-3zM137.5 67.9c-.4 0-.6-.1-.8-.6l-9.1-20.8c-.1-.1-.3-.1-.3.1v20.6c0 .4-.3.7-.8.7h-.8c-.4 0-.8-.3-.8-.7V43.3c0-.4.3-.7.8-.7h2c.4 0 .6.1.8.6l9.1 20.6c.1.1.3.1.3-.1V43.3c0-.4.3-.7.8-.7h.8c.4 0 .8.3.8.7v23.9c0 .4-.3.7-.8.7h-2zM146.7 65.3c0 .2.2.4.4.4h9.9c.4 0 .8.3.8.7v.9c0 .4-.3.7-.8.7h-12c-.4 0-.8-.3-.8-.7v-24c0-.4.3-.7.8-.7h12c.4 0 .8.3.8.7v.9c0 .4-.3.7-.8.7h-9.9c-.2 0-.4.1-.4.4v8.2c0 .2.2.4.4.4h9.4c.4 0 .8.3.8.7v.8c0 .4-.3.7-.8.7h-9.4c-.2 0-.4.1-.4.4v8.8zM170 45.3v21.9c0 .4-.3.7-.8.7h-1c-.4 0-.8-.3-.8-.7V45.3c0-.2-.2-.4-.4-.4h-5.6c-.4 0-.8-.3-.8-.7v-.9c0-.4.3-.7.8-.7H176c.4 0 .8.3.8.7v.9c0 .4-.3.7-.8.7h-5.6c-.2 0-.4.2-.4.4M187 67.9h-2.1c-.3 0-.6-.2-.7-.5L179 43.3c-.1-.4.2-.7.8-.7h.9c.3 0 .6.1.7.5l4.3 20.7c0 .1.1.2.2.2h.1c.1 0 .2-.1.2-.2l4-20.7c.1-.4.4-.5.7-.5h1.3c.3 0 .6.2.7.5l4.3 20.7c0 .1.1.2.2.2h.1c.1 0 .2-.1.2-.2l4.6-20.7c.1-.4.4-.5.7-.5h.9c.6 0 .8.4.8.7l-5.5 24.1c-.1.4-.4.5-.7.5h-2.1c-.3 0-.6-.2-.7-.5l-4-19.3c0-.2-.3-.2-.3 0l-3.8 19.3c0 .4-.3.5-.6.5M223.9 49.8c.4 2.9.4 7.9 0 10.9-.6 4.7-3.9 7.5-8.5 7.5s-7.8-2.9-8.5-7.5c-.4-2.9-.4-8 0-10.9.6-3.9 3.5-7.5 8.5-7.5s7.9 3.6 8.5 7.5m-2.6 10.9c.5-3 .5-7.9 0-10.9-.4-2.6-2.3-5.2-5.9-5.2-3.6 0-5.5 2.6-5.9 5.2-.5 3-.5 7.9 0 10.9.3 2.1 1.8 5.2 5.9 5.2 4.1 0 5.6-3.1 5.9-5.2"
id="path10"
style="fill:#000000" />
<path
d="m 230.9,57.8 c -0.2,0 -0.4,0.1 -0.4,0.4 l 0,9 c 0,0.4 -0.3,0.7 -0.8,0.7 l -0.9,0 c -0.4,0 -0.8,-0.3 -0.8,-0.7 l 0,-23.9 c 0,-0.4 0.3,-0.7 0.8,-0.7 l 6.5,0 c 4.4,0 8,3.4 8,7.6 0,3.3 -1.8,5.2 -4.5,6.9 -0.5,0.3 -0.6,0.6 -0.3,1.2 l 4.8,8.6 c 0.3,0.5 0,1.1 -0.7,1.1 l -0.8,0 c -0.6,0 -0.9,-0.3 -1.1,-0.7 l -4.9,-9 c -0.1,-0.2 -0.3,-0.4 -0.7,-0.4 l -4.2,0 z m 0,-12.9 c -0.2,0 -0.4,0.1 -0.4,0.4 l 0,9.8 c 0,0.2 0.2,0.4 0.4,0.4 l 4.4,0 c 3,0 5.6,-2.4 5.6,-5.3 0,-2.9 -2.5,-5.3 -5.6,-5.3 z m 18.4,12.2 C 249.2,57 249,57 249,57.2 l 0,10 c 0,0.4 -0.3,0.7 -0.8,0.7 l -0.9,0 c -0.4,0 -0.8,-0.3 -0.8,-0.7 l 0,-23.9 c 0,-0.4 0.3,-0.7 0.8,-0.7 l 0.9,0 c 0.4,0 0.8,0.3 0.8,0.7 l 0,9.6 c 0,0.2 0.2,0.2 0.3,0.1 l 8.8,-10 c 0.1,-0.1 0.4,-0.4 1,-0.4 l 0.6,0 c 0.9,0 1.1,0.8 0.6,1.3 l -9.4,10.5 c -0.2,0.3 -0.3,0.5 0,0.9 L 261,66.6 c 0.4,0.5 0.3,1.3 -0.7,1.3 l -0.8,0 c -0.6,0 -0.8,-0.3 -1,-0.5 z"
id="path12"
style="fill:#000000"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cssssssssscccssccsccsssssssscssssssssssccssccccsscc" />
<path
d="m 3,44.3 0.5,0 c 1.2,0 2.2,-0.9 2.4,-2 0.5,-2.4 1.1,-4.7 2,-7 6.6,-18.2 23.5,-30.4 42,-30.4 18.5,0 35.4,12.2 42,30.3 0.8,2.2 1.5,4.6 2,6.9 0.3,1.3 1.6,2.2 2.9,1.9 1.3,-0.3 2.2,-1.6 1.9,-2.9 C 98.2,38.5 97.4,36 96.5,33.5 89.2,13.5 70.5,0 49.9,0 29.3,0 10.6,13.5 3.3,33.6 2.4,36.1 1.7,38.7 1.1,41.3 l 0,0.2 L 3.5,42 1.1,41.5 C 0.8,42.8 1.7,44.1 3,44.3 M 99.8,53 C 99.9,52 99.4,51 98.4,50.5 95,48.9 90.7,47.4 85.9,46.3 84.4,45.9 82.8,45.6 81.2,45.3 77.9,44.7 74.3,44.1 70.5,43.7 69.8,36.3 66.6,30.9 61,27.1 54.7,22.9 46.9,22.7 40.1,26.5 33.5,30.1 29.3,36.6 29,43.8 17.9,45.2 8.2,47.6 1.4,50.9 1.3,50.9 1.3,51 1.2,51 1.1,51 1.1,51.1 1,51.1 l -0.1,0.1 c -0.1,0.1 -0.2,0.1 -0.2,0.2 -0.4,0.4 -0.6,1 -0.6,1.6 0,1.4 0.1,2.7 0.2,4.1 0,0.4 0.1,0.7 0.1,1.1 0.3,2.6 0.8,5.2 1.5,7.7 0.2,0.7 0.3,1.4 0.5,2 0.3,0.9 0.6,1.7 0.9,2.6 0.7,1.8 1.4,3.6 2.2,5.2 0.8,1.6 1.7,3.1 2.6,4.6 0.7,1.2 1.5,2.3 2.4,3.5 1,1.3 2,2.6 3.2,3.8 1.5,1.7 3.1,3.2 4.8,4.6 1.4,1.2 2.9,2.3 4.4,3.3 1.9,1.3 3.8,2.4 5.9,3.4 2,0.9 4,1.8 6.1,2.4 2.1,0.7 4.3,1.2 6.5,1.6 2.8,0.5 5.7,0.8 8.7,0.8 l 0.1,0 c 13.6,0 26.5,-5.9 35.8,-15.9 1.8,-1.9 3.4,-3.9 4.9,-6.1 0.2,-0.2 0.3,-0.5 0.5,-0.7 1.5,-2.4 2.9,-4.8 4,-7.4 0.9,-2 1.6,-4 2.2,-6 1.3,-4.5 2.1,-9.5 2.2,-14.6 0,0.1 0,0.1 0,0 M 85.7,51.3 c 3.3,0.8 6.3,1.8 8.9,2.9 -3.4,1.6 -6.7,2.9 -9.9,4.1 -1.9,0.7 -3.7,1.2 -5.5,1.7 -3.5,1 -7.1,1.6 -10.7,2 1.3,-4.4 2,-8.8 2.2,-13.4 3.6,0.4 7,1 10.2,1.6 1.7,0.4 3.3,0.7 4.8,1.1 m -13,23.1 C 69.5,74.8 66.2,75 63,75 c 1.5,-2.5 2.7,-5.2 3.8,-7.8 3.6,-0.2 7,-0.7 10.4,-1.5 -1.3,2.9 -2.8,5.8 -4.5,8.7 m -9.8,12.5 c -2.8,0 -5.6,-0.1 -8.4,-0.5 1.9,-2.1 3.7,-4.3 5.4,-6.5 1.2,0.1 2.5,0.1 3.7,0.1 1.8,0 3.7,-0.1 5.5,-0.2 -1.9,2.4 -4,4.8 -6.2,7.1 M 40.2,82.4 c 1.6,-1.7 3,-3.4 4.4,-5.2 3.2,0.9 6.4,1.6 9.5,2 -1.7,2.1 -3.5,4.1 -5.4,6 -2.8,-0.7 -5.6,-1.6 -8.5,-2.8 M 6.6,65 C 6.1,63.1 5.7,61.2 5.4,59.2 c 7.2,-1.8 16.6,-1.4 26.2,1.3 -0.9,2 -2,3.9 -3.2,5.8 C 19.3,64 11.6,64.2 6.6,65 m 50.7,9.7 c -3.2,-0.3 -6.5,-0.9 -9.8,-1.7 1.4,-2.2 2.6,-4.5 3.7,-6.9 3.5,0.6 6.8,1 10.1,1.1 -1.1,2.5 -2.4,5.1 -4,7.5 M 42.7,71.4 c -1.5,-0.5 -3,-1.1 -4.5,-1.8 -1.7,-0.7 -3.3,-1.3 -4.9,-1.9 1.1,-1.9 2.2,-3.8 3.1,-5.8 3.5,1.2 6.8,2.2 10,3 -1.1,2.3 -2.4,4.5 -3.7,6.5 M 30.5,72 c 1.8,0.6 3.8,1.3 5.7,2.2 1.2,0.5 2.3,1 3.5,1.4 -1.3,1.7 -2.8,3.3 -4.3,4.8 -3.1,-1.2 -6.2,-2.3 -9.3,-3 1.5,-1.8 3,-3.6 4.4,-5.4 m 12,-41.3 c 5.2,-2.9 11.1,-2.7 15.8,0.4 4.2,2.8 6.5,6.7 7.3,12 -5,-0.4 -10.2,-0.6 -15.5,-0.6 -5.5,0 -10.9,0.3 -16,0.7 0.4,-5.1 3.5,-9.8 8.4,-12.5 m 7.5,16.8 2.1,0 c 1,0 2,0 3.1,0.1 3.6,0.1 7.2,0.3 10.6,0.6 -0.2,4.8 -1,9.5 -2.5,14.1 -3.2,0 -6.5,-0.3 -10,-0.9 -1.6,-0.3 -3.2,-0.6 -4.9,-1 -3.2,-0.7 -6.6,-1.7 -10.2,-3 -0.1,0 -0.2,-0.1 -0.3,-0.1 C 36.4,56.8 35,56.3 33.5,55.9 23.9,53.1 14.6,52.4 6.8,53.9 17.1,49.8 32.9,47.5 50,47.5 M 8.2,69.7 c 4.2,-0.5 10.1,-0.7 17.2,0.9 -1.5,1.9 -3.2,3.8 -5,5.5 -3.3,-0.5 -6.5,-0.8 -9.6,-0.7 -1,-1.8 -1.9,-3.7 -2.6,-5.7 m 9.5,15.2 c -1.1,-1.2 -2.2,-2.4 -3.2,-3.8 -0.2,-0.3 -0.4,-0.5 -0.6,-0.8 0.5,0 1,0 1.5,0.1 2,0.2 4.2,0.4 6.5,0.9 2.8,0.6 6,1.5 9.3,2.7 -2.5,2.1 -5.3,4.1 -8.2,5.8 -1.8,-1.4 -3.6,-3.1 -5.3,-4.9 m 9.9,8 c 3.2,-2 6.1,-4.3 8.8,-6.8 2.7,1.2 5.3,2.2 8,2.9 -3,2.6 -6.3,5.1 -10,7.1 -2.4,-0.8 -4.7,-1.9 -6.8,-3.2 m 13.1,5.2 c 3.5,-2.3 6.6,-5 9.4,-7.5 2.7,0.5 5.3,0.9 7.9,1.1 -3.2,3 -6.3,5.4 -9.4,7.4 -2.6,-0.2 -5.3,-0.5 -7.9,-1 m 17.1,0.2 c 2.4,-1.9 4.7,-4.1 7.2,-6.6 3.6,-0.1 7.2,-0.6 10.8,-1.3 -5.3,4 -11.5,6.7 -18,7.9 M 86.7,79.2 c -1.1,1.6 -2.3,3.1 -3.5,4.5 -4.4,1.2 -8.8,2.2 -13.2,2.7 2.1,-2.4 3.9,-4.9 5.6,-7.5 4.4,-0.7 8.8,-1.7 13.1,-3 -0.7,1.2 -1.3,2.2 -2,3.3 m -7.8,-5.9 c 1.6,-3.1 3,-6.2 4.1,-9.3 3.7,-1.2 7.4,-2.6 11.3,-4.3 -0.5,3.5 -1.5,6.9 -2.7,10.2 -4.2,1.4 -8.4,2.5 -12.7,3.4"
id="path18"
style="fill:#000000"
inkscape:connector-curvature="0"
sodipodi:nodetypes="csccsccsccscccccccccccccccscscscccscsccccccccsscccccccccccccccccccccccsccccccccccccccccccccccccccccccccscccscccccccccccccccccccccccccccccccccccccccccccccccc" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 881 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 928 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 112 KiB

After

Width:  |  Height:  |  Size: 54 KiB

View File

@@ -0,0 +1 @@
angular.module("admin.accounts_and_billing_settings", ["admin.utils"])

View File

@@ -0,0 +1,14 @@
angular.module("admin.accounts_and_billing_settings").directive "methodSettingsFor", ->
template: "<div ng-include='include_html'></div>"
restrict: 'A'
scope: {
enterprise_id: '=methodSettingsFor'
}
link: (scope, element, attrs) ->
scope.include_html = ""
scope.$watch "enterprise_id", (newVal, oldVal)->
if !newVal? || newVal == ""
scope.include_html = ""
else
scope.include_html = "/admin/accounts_and_billing_settings/show_methods?enterprise_id=#{newVal};"

View File

@@ -1,3 +1,3 @@
angular.module("ofn.admin", ["ngResource", "ngAnimate", "admin.indexUtils", "admin.dropdown", "admin.products", "admin.taxons", "infinite-scroll"]).config ($httpProvider) ->
angular.module("ofn.admin", ["ngResource", "ngAnimate", "admin.utils", "admin.indexUtils", "admin.dropdown", "admin.products", "admin.taxons", "infinite-scroll"]).config ($httpProvider) ->
$httpProvider.defaults.headers.common["X-CSRF-Token"] = $("meta[name=csrf-token]").attr("content")
$httpProvider.defaults.headers.common["Accept"] = "application/json, text/javascript, */*"

View File

@@ -21,21 +21,33 @@
//= require ../shared/ng-tags-input.min.js
//= require angular-rails-templates
//= require_tree ../templates/admin
//= require ./admin
//= require ./admin_ofn
//= require ./accounts_and_billing_settings/accounts_and_billing_settings
//= require ./business_model_configuration/business_model_configuration
//= require ./customers/customers
//= require ./dropdown/dropdown
//= require ./enterprises/enterprises
//= require ./enterprise_fees/enterprise_fees
//= require ./enterprise_groups/enterprise_groups
//= require ./index_utils/index_utils
//= require ./inventory_items/inventory_items
//= require ./line_items/line_items
//= require ./orders/orders
//= require ./order_cycles/order_cycles
//= require ./payment_methods/payment_methods
//= require ./products/products
//= require ./shipping_methods/shipping_methods
//= require ./side_menu/side_menu
//= require ./tag_rules/tag_rules
//= require ./taxons/taxons
//= require ./utils/utils
//= require ./users/users
//= require textAngular.min.js
//= require ./variant_overrides/variant_overrides
//= require textAngular-rangy.min.js
//= require textAngular-sanitize.min.js
//= require ../shared/bindonce.min.js
//= require textAngular.min.js
//= require darkswarm/i18n.js
//= require darkswarm/i18n.translate.js
//= require_tree .

View File

@@ -1,217 +0,0 @@
angular.module("ofn.admin").controller "AdminOrderMgmtCtrl", [
"$scope", "$http", "$filter", "dataFetcher", "blankOption", "pendingChanges", "VariantUnitManager", "OptionValueNamer", "SpreeApiKey", "Columns"
($scope, $http, $filter, dataFetcher, blankOption, pendingChanges, VariantUnitManager, OptionValueNamer, SpreeApiKey, Columns) ->
$scope.loading = true
$scope.initialiseVariables = ->
start = daysFromToday -7
end = daysFromToday 1
$scope.lineItems = []
$scope.filteredLineItems = []
$scope.confirmDelete = true
$scope.startDate = formatDate start
$scope.endDate = formatDate end
$scope.pendingChanges = pendingChanges
$scope.quickSearch = ""
$scope.bulkActions = [ { name: "Delete Selected", callback: $scope.deleteLineItems } ]
$scope.selectedBulkAction = $scope.bulkActions[0]
$scope.selectedUnitsProduct = {};
$scope.selectedUnitsVariant = {};
$scope.sharedResource = false
$scope.columns = Columns.setColumns
order_no: { name: "Order No.", visible: false }
full_name: { name: "Name", visible: true }
email: { name: "Email", visible: false }
phone: { name: "Phone", visible: false }
order_date: { name: "Order Date", visible: true }
producer: { name: "Producer", visible: true }
order_cycle: { name: "Order Cycle", visible: false }
hub: { name: "Hub", visible: false }
variant: { name: "Variant", visible: true }
quantity: { name: "Quantity", visible: true }
max: { name: "Max", visible: true }
final_weight_volume: { name: "Weight/Volume", visible: false }
price: { name: "Price", visible: false }
$scope.initialise = ->
$scope.initialiseVariables()
authorise_api_reponse = ""
dataFetcher("/api/users/authorise_api?token=" + SpreeApiKey).then (data) ->
authorise_api_reponse = data
$scope.spree_api_key_ok = data.hasOwnProperty("success") and data["success"] == "Use of API Authorised"
if $scope.spree_api_key_ok
$http.defaults.headers.common["X-Spree-Token"] = SpreeApiKey
dataFetcher("/api/enterprises/accessible?template=bulk_index&q[is_primary_producer_eq]=true").then (data) ->
$scope.suppliers = $filter('orderBy')(data, 'name')
$scope.suppliers.unshift blankOption()
dataFetcher("/api/enterprises/accessible?template=bulk_index&q[sells_in][]=own&q[sells_in][]=any").then (data) ->
$scope.distributors = $filter('orderBy')(data, 'name')
$scope.distributors.unshift blankOption()
ocFetcher = dataFetcher("/api/order_cycles/accessible?as=distributor&q[orders_close_at_gt]=#{formatDate(daysFromToday(-90))}").then (data) ->
$scope.orderCycles = data
$scope.orderCyclesByID = []
$scope.orderCyclesByID[oc.id] = oc for oc in $scope.orderCycles
$scope.orderCycles.unshift blankOption()
$scope.fetchOrders()
ocFetcher.then ->
$scope.resetSelectFilters()
else if authorise_api_reponse.hasOwnProperty("error")
$scope.api_error_msg = authorise_api_reponse("error")
else
api_error_msg = "You don't have an API key yet. An attempt was made to generate one, but you are currently not authorised, please contact your site administrator for access."
$scope.fetchOrders = ->
$scope.loading = true
dataFetcher("/admin/orders/managed?template=bulk_index;page=1;per_page=500;q[state_not_eq]=canceled;q[completed_at_not_null]=true;q[completed_at_gt]=#{$scope.startDate};q[completed_at_lt]=#{$scope.endDate}").then (data) ->
$scope.resetOrders data
$scope.loading = false
$scope.resetOrders = (data) ->
$scope.orders = data
$scope.resetLineItems()
pendingChanges.removeAll()
$scope.resetLineItems = ->
$scope.lineItems = $scope.orders.reduce (lineItems,order) ->
orderWithoutLineItems = $scope.lineItemOrder order
for i,line_item of order.line_items
line_item.checked = false
line_item.supplier = $scope.matchObject $scope.suppliers, line_item.supplier, null
line_item.order = orderWithoutLineItems
lineItems.concat order.line_items
, []
$scope.lineItemOrder = (order) ->
lineItemOrder = angular.copy(order)
delete lineItemOrder.line_items
lineItemOrder.distributor = $scope.matchObject $scope.distributors, order.distributor, null
lineItemOrder.order_cycle = $scope.matchObject $scope.orderCycles, order.order_cycle, null
lineItemOrder
$scope.matchObject = (list, testObject, noMatch) ->
for i, object of list
if angular.equals(object, testObject)
return object
return noMatch
$scope.deleteLineItem = (lineItem) ->
if ($scope.confirmDelete && confirm("Are you sure?")) || !$scope.confirmDelete
$http(
method: "DELETE"
url: "/api/orders/" + lineItem.order.number + "/line_items/" + lineItem.id
).success (data) ->
$scope.lineItems.splice $scope.lineItems.indexOf(lineItem), 1
$scope.deleteLineItems = (lineItems) ->
existingState = $scope.confirmDelete
$scope.confirmDelete = false
$scope.deleteLineItem lineItem for lineItem in lineItems when lineItem.checked
$scope.confirmDelete = existingState
$scope.allBoxesChecked = ->
checkedCount = $scope.filteredLineItems.reduce (count,lineItem) ->
count + (if lineItem.checked then 1 else 0 )
, 0
checkedCount == $scope.filteredLineItems.length
$scope.toggleAllCheckboxes = ->
changeTo = !$scope.allBoxesChecked()
lineItem.checked = changeTo for lineItem in $scope.filteredLineItems
$scope.setSelectedUnitsVariant = (unitsProduct,unitsVariant) ->
$scope.selectedUnitsProduct = unitsProduct
$scope.selectedUnitsVariant = unitsVariant
$scope.sumUnitValues = ->
sum = $scope.filteredLineItems.reduce (sum,lineItem) ->
sum = sum + lineItem.quantity * lineItem.units_variant.unit_value
, 0
$scope.sumMaxUnitValues = ->
sum = $scope.filteredLineItems.reduce (sum,lineItem) ->
sum = sum + Math.max(lineItem.max_quantity,lineItem.quantity) * lineItem.units_variant.unit_value
, 0
$scope.allUnitValuesPresent = ->
for i,lineItem of $scope.filteredLineItems
return false if !lineItem.units_variant.hasOwnProperty('unit_value') || !(lineItem.units_variant.unit_value > 0)
true
# How is this different to OptionValueNamer#name?
# Should it be extracted to that class or VariantUnitManager?
$scope.formattedValueWithUnitName = (value, unitsProduct, unitsVariant) ->
# A Units Variant is an API object which holds unit properies of a variant
if unitsProduct.hasOwnProperty("variant_unit") && (unitsProduct.variant_unit == "weight" || unitsProduct.variant_unit == "volume") && value > 0
scale = VariantUnitManager.getScale(value, unitsProduct.variant_unit)
Math.round(value/scale * 1000)/1000 + " " + VariantUnitManager.getUnitName(scale, unitsProduct.variant_unit)
else
''
$scope.fulfilled = (sumOfUnitValues) ->
# A Units Variant is an API object which holds unit properies of a variant
if $scope.selectedUnitsProduct.hasOwnProperty("group_buy_unit_size") && $scope.selectedUnitsProduct.group_buy_unit_size > 0 &&
$scope.selectedUnitsProduct.hasOwnProperty("variant_unit") &&
( $scope.selectedUnitsProduct.variant_unit == "weight" || $scope.selectedUnitsProduct.variant_unit == "volume" )
Math.round( sumOfUnitValues / $scope.selectedUnitsProduct.group_buy_unit_size * 1000)/1000
else
''
$scope.unitsVariantSelected = ->
!angular.equals($scope.selectedUnitsVariant,{})
$scope.resetSelectFilters = ->
$scope.distributorFilter = $scope.distributors[0].id
$scope.supplierFilter = $scope.suppliers[0].id
$scope.orderCycleFilter = $scope.orderCycles[0].id
$scope.quickSearch = ""
$scope.weightAdjustedPrice = (lineItem, oldValue) ->
if oldValue <= 0
oldValue = lineItem.units_variant.unit_value * line_item.quantity
if lineItem.final_weight_volume <= 0
lineItem.final_weight_volume = lineItem.units_variant.unit_value * lineItem.quantity
lineItem.price = lineItem.price * lineItem.final_weight_volume / oldValue
#$scope.bulk_order_form.line_item.price.$setViewValue($scope.bulk_order_form.line_item.price.$viewValue)
$scope.unitValueLessThanZero = (lineItem) ->
if lineItem.units_variant.unit_value <= 0
true
else
false
$scope.updateOnQuantity = (lineItem, oldQuantity) ->
if lineItem.quantity <= 0
lineItem.quantity = 1
# reset price to original unit value
lineItem.price = lineItem.price * (oldQuantity * lineItem.units_variant.unit_value) / lineItem.final_weight_volume
lineItem.final_weight_volume = lineItem.units_variant.unit_value * lineItem.quantity
$scope.$watch "orderCycleFilter", (newVal, oldVal) ->
unless $scope.orderCycleFilter == "0" || angular.equals(newVal, oldVal)
$scope.startDate = $scope.orderCyclesByID[$scope.orderCycleFilter].first_order
$scope.endDate = $scope.orderCyclesByID[$scope.orderCycleFilter].last_order
]
daysFromToday = (days) ->
now = new Date
now.setHours(0)
now.setMinutes(0)
now.setSeconds(0)
now.setDate( now.getDate() + days )
now
formatDate = (date) ->
year = date.getFullYear()
month = twoDigitNumber date.getMonth() + 1
day = twoDigitNumber date.getDate()
return year + "-" + month + "-" + day
formatTime = (date) ->
hours = twoDigitNumber date.getHours()
mins = twoDigitNumber date.getMinutes()
secs = twoDigitNumber date.getSeconds()
return hours + ":" + mins + ":" + secs
twoDigitNumber = (number) ->
twoDigits = "" + number
twoDigits = ("0" + number) if number < 10
twoDigits

View File

@@ -1,35 +1,24 @@
angular.module("ofn.admin").controller "AdminProductEditCtrl", ($scope, $timeout, $http, BulkProducts, DisplayProperties, dataFetcher, DirtyProducts, VariantUnitManager, StatusMessage, producers, Taxons, SpreeApiAuth, Columns, tax_categories) ->
angular.module("ofn.admin").controller "AdminProductEditCtrl", ($scope, $timeout, $http, $window, BulkProducts, DisplayProperties, dataFetcher, DirtyProducts, VariantUnitManager, StatusMessage, producers, Taxons, SpreeApiAuth, Columns, tax_categories) ->
$scope.loading = true
$scope.StatusMessage = StatusMessage
$scope.columns = Columns.setColumns
producer: {name: "Producer", visible: true}
sku: {name: "SKU", visible: false}
name: {name: "Name", visible: true}
unit: {name: "Unit", visible: true}
price: {name: "Price", visible: true}
on_hand: {name: "On Hand", visible: true}
on_demand: {name: "On Demand", visible: false}
category: {name: "Category", visible: false}
tax_category: {name: "Tax Category", visible: false}
inherits_properties: {name: "Inherits Properties?", visible: false}
available_on: {name: "Available On", visible: false}
$scope.columns = Columns.columns
$scope.variant_unit_options = VariantUnitManager.variantUnitOptions()
$scope.filterableColumns = [
{ name: "Producer", db_column: "producer_name" },
{ name: "Name", db_column: "name" }
{ name: t("label_producers"), db_column: "producer_name" },
{ name: t("name"), db_column: "name" }
]
$scope.filterTypes = [
{ name: "Equals", predicate: "eq" },
{ name: "Contains", predicate: "cont" }
{ name: t("equals"), predicate: "eq" },
{ name: t("contains"), predicate: "cont" }
]
$scope.optionTabs =
filters: { title: "Filter Products", visible: false }
filters: { title: t("filter_products"), visible: false }
$scope.producers = producers
@@ -105,7 +94,7 @@ angular.module("ofn.admin").controller "AdminProductEditCtrl", ($scope, $timeout
$scope.categoryFilter = "0"
$scope.editWarn = (product, variant) ->
if (DirtyProducts.count() > 0 and confirm("Unsaved changes will be lost. Continue anyway?")) or (DirtyProducts.count() == 0)
if (DirtyProducts.count() > 0 and confirm(t("unsaved_changes_confirmation"))) or (DirtyProducts.count() == 0)
window.location = "/admin/products/" + product.permalink_live + ((if variant then "/variants/" + variant.id else "")) + "/edit"
@@ -150,14 +139,14 @@ angular.module("ofn.admin").controller "AdminProductEditCtrl", ($scope, $timeout
if !$scope.variantSaved(variant)
$scope.removeVariant(product, variant)
else
if confirm("Are you sure?")
if confirm(t("are_you_sure"))
$http(
method: "DELETE"
url: "/api/products/" + product.permalink_live + "/variants/" + variant.id + "/soft_delete"
).success (data) ->
$scope.removeVariant(product, variant)
else
alert("The last variant cannot be deleted!")
alert(t("delete_product_variant"))
$scope.removeVariant = (product, variant) ->
product.variants.splice product.variants.indexOf(variant), 1
@@ -194,7 +183,7 @@ angular.module("ofn.admin").controller "AdminProductEditCtrl", ($scope, $timeout
if productsToSubmit.length > 0
$scope.updateProducts productsToSubmit # Don't submit an empty list
else
StatusMessage.display 'alert', 'No changes to save.'
StatusMessage.display 'alert', t("products_change")
$scope.updateProducts = (productsToSubmit) ->
@@ -212,11 +201,13 @@ angular.module("ofn.admin").controller "AdminProductEditCtrl", ($scope, $timeout
).error (data, status) ->
if status == 400 && data.errors? && data.errors.length > 0
errors = error + "\n" for error in data.errors
alert "Saving failed with the following error(s):\n" + errors
$scope.displayFailure "Save failed due to invalid data"
alert t("products_update_error") + "\n" + errors
$scope.displayFailure t("products_update_error")
else
$scope.displayFailure "Server returned with error status: " + status
$scope.displayFailure t("products_update_error_data") + status
$scope.cancel = (destination) ->
$window.location = destination
$scope.packProduct = (product) ->
if product.variant_unit_with_scale
@@ -253,23 +244,24 @@ angular.module("ofn.admin").controller "AdminProductEditCtrl", ($scope, $timeout
$scope.displayUpdating = ->
StatusMessage.display 'progress', 'Saving...'
StatusMessage.display 'progress', t("saving")
$scope.displaySuccess = ->
StatusMessage.display 'success', 'Changes saved.'
StatusMessage.display 'success',t("products_changes_saved")
$scope.bulk_product_form.$setPristine()
$scope.displayFailure = (failMessage) ->
StatusMessage.display 'failure', "Saving failed. #{failMessage}"
StatusMessage.display 'failure', t("products_update_error_msg") + "#{failMessage}"
$scope.displayDirtyProducts = ->
if DirtyProducts.count() > 0
message = if DirtyProducts.count() == 1 then "one product" else DirtyProducts.count() + " products"
StatusMessage.display 'notice', "Changes to #{message} remain unsaved."
else
StatusMessage.clear()
count = DirtyProducts.count()
switch count
when 0 then StatusMessage.clear()
when 1 then StatusMessage.display 'notice', t("one_product_unsaved")
else StatusMessage.display 'notice', t("products_unsaved", n: count)
filterSubmitProducts = (productsToFilter) ->
@@ -352,6 +344,9 @@ filterSubmitVariant = (variant) ->
filteredVariant = {}
if not variant.deleted_at? and variant.hasOwnProperty("id")
filteredVariant.id = variant.id unless variant.id <= 0
if variant.hasOwnProperty("sku")
filteredVariant.sku = variant.sku
hasUpdatableProperty = true
if variant.hasOwnProperty("on_hand")
filteredVariant.on_hand = variant.on_hand
hasUpdatableProperty = true

View File

@@ -0,0 +1 @@
angular.module("admin.businessModelConfiguration", ["admin.utils"])

View File

@@ -0,0 +1,25 @@
angular.module("admin.businessModelConfiguration").controller "BusinessModelConfigCtrl", ($scope, $filter) ->
$scope.turnover = 1000
$scope.bill = ->
return $filter('currency')(0) unless $scope.fixed || $scope.rate
Number($scope.fixed) + Number($scope.turnover) * Number($scope.rate)
$scope.cappedBill = ->
return $scope.bill() if !$scope.cap? || Number($scope.cap) == 0
Math.min($scope.bill(), Number($scope.cap))
$scope.finalBill = ->
return 0 if Number($scope.turnover) < Number($scope.minBillableTurnover)
$scope.cappedBill()
$scope.capReached = ->
return "No" if !$scope.cap? || Number($scope.cap) == 0
if $scope.bill() >= Number($scope.cap) then "Yes" else "No"
$scope.includedTax = ->
return 0 if !$scope.taxRate? || Number($scope.taxRate) == 0
($scope.cappedBill() * Number($scope.taxRate))
$scope.total = ->
$scope.finalBill() + $scope.includedTax()

View File

@@ -7,7 +7,7 @@ angular.module("ofn.admin").controller "AdminEnterpriseRelationshipsCtrl", ($sco
$scope.EnterpriseRelationships.create($scope.parent_id, $scope.child_id, $scope.permissions)
$scope.delete = (enterprise_relationship) ->
if confirm("Are you sure?")
if confirm(t("are_you_sure"))
$scope.EnterpriseRelationships.delete enterprise_relationship
$scope.toggleKeyword = (string, key) ->

View File

@@ -7,5 +7,5 @@ angular.module("ofn.admin").controller "AdminEnterpriseRolesCtrl", ($scope, Ente
$scope.EnterpriseRoles.create($scope.user_id, $scope.enterprise_id)
$scope.delete = (enterprise_role) ->
if confirm("Are you sure?")
if confirm(t('are_you_sure'))
$scope.EnterpriseRoles.delete enterprise_role

View File

@@ -1,5 +1,2 @@
angular.module("ofn.admin").controller "enterprisesDashboardCtrl", [
"$scope"
($scope) ->
$scope.activeTab = "hubs"
]
angular.module("ofn.admin").controller "enterprisesDashboardCtrl", ($scope) ->
$scope.activeTab = "hubs"

View File

@@ -1,67 +0,0 @@
angular.module("ofn.admin").controller "AdminVariantOverridesCtrl", ($scope, $timeout, Indexer, SpreeApiAuth, PagedFetcher, StatusMessage, hubs, producers, hubPermissions, VariantOverrides, DirtyVariantOverrides) ->
$scope.hubs = hubs
$scope.hub = null
$scope.products = []
$scope.producers = Indexer.index producers
$scope.hubPermissions = hubPermissions
$scope.variantOverrides = VariantOverrides.variantOverrides
$scope.StatusMessage = StatusMessage
$scope.initialise = ->
SpreeApiAuth.authorise()
.then ->
$scope.spree_api_key_ok = true
$scope.fetchProducts()
.catch (message) ->
$scope.api_error_msg = message
$scope.fetchProducts = ->
url = "/api/products/overridable?page=::page::;per_page=100"
PagedFetcher.fetch url, (data) => $scope.addProducts data.products
$scope.addProducts = (products) ->
$scope.products = $scope.products.concat products
VariantOverrides.ensureDataFor hubs, products
$scope.selectHub = ->
$scope.hub = (hub for hub in hubs when hub.id == $scope.hub_id)[0]
$scope.displayDirty = ->
if DirtyVariantOverrides.count() > 0
num = if DirtyVariantOverrides.count() == 1 then "one override" else "#{DirtyVariantOverrides.count()} overrides"
StatusMessage.display 'notice', "Changes to #{num} remain unsaved."
else
StatusMessage.clear()
$scope.update = ->
if DirtyVariantOverrides.count() == 0
StatusMessage.display 'alert', 'No changes to save.'
else
StatusMessage.display 'progress', 'Saving...'
DirtyVariantOverrides.save()
.success (updatedVos) ->
DirtyVariantOverrides.clear()
VariantOverrides.updateIds updatedVos
$timeout -> StatusMessage.display 'success', 'Changes saved.'
.error (data, status) ->
$timeout -> StatusMessage.display 'failure', $scope.updateError(data, status)
$scope.updateError = (data, status) ->
if status == 401
"I couldn't get authorisation to save those changes, so they remain unsaved."
else if status == 400 && data.errors?
errors = []
for field, field_errors of data.errors
errors = errors.concat field_errors
errors = errors.join ', '
"I had some trouble saving: #{errors}"
else
"Oh no! I was unable to save your changes."

View File

@@ -1,17 +1,45 @@
angular.module("admin.customers").controller "customersCtrl", ($scope, Customers, Columns, pendingChanges, shops) ->
$scope.shop = null
angular.module("admin.customers").controller "customersCtrl", ($scope, $q, $filter, Customers, TagRuleResource, CurrentShop, RequestMonitor, Columns, pendingChanges, shops) ->
$scope.shops = shops
$scope.RequestMonitor = RequestMonitor
$scope.submitAll = pendingChanges.submitAll
$scope.add = Customers.add
$scope.deleteCustomer = Customers.remove
$scope.customerLimit = 20
$scope.columns = Columns.columns
$scope.columns = Columns.setColumns
email: { name: "Email", visible: true }
code: { name: "Code", visible: true }
tags: { name: "Tags", visible: true }
$scope.confirmRefresh = (event) ->
event.preventDefault() unless pendingChanges.unsavedCount() == 0 || confirm(t("unsaved_changes_warning"))
$scope.$watch "shop", ->
if $scope.shop?
Customers.loaded = false
$scope.customers = Customers.index(enterprise_id: $scope.shop.id)
$scope.$watch "shop_id", ->
if $scope.shop_id?
CurrentShop.shop = $filter('filter')($scope.shops, {id: $scope.shop_id})[0]
Customers.index({enterprise_id: $scope.shop_id}).then (data) ->
pendingChanges.removeAll()
$scope.customers_form.$setPristine()
$scope.customers = data
$scope.loaded = ->
Customers.loaded
$scope.shop_id = shops[0].id if shops.length == 1
$scope.checkForDuplicateCodes = ->
delete this.customer.code unless this.customer.code
this.duplicate = $scope.isDuplicateCode(this.customer.code)
$scope.isDuplicateCode = (code) ->
return false unless code
customers = $scope.findByCode(code)
customers.length > 1
$scope.findByCode = (code) ->
if $scope.customers
$scope.customers.filter (customer) ->
customer.code == code
$scope.findTags = (query) ->
defer = $q.defer()
params =
enterprise_id: $scope.shop_id
TagRuleResource.mapByTag params, (data) =>
filtered = data.filter (tag) ->
tag.text.toLowerCase().indexOf(query.toLowerCase()) != -1
defer.resolve filtered
defer.promise

View File

@@ -1 +1 @@
angular.module("admin.customers", ['ngResource', 'ngTagsInput', 'admin.indexUtils', 'admin.dropdown'])
angular.module("admin.customers", ['ngResource', 'admin.tagRules', 'admin.indexUtils', 'admin.utils', 'admin.dropdown'])

View File

@@ -0,0 +1,38 @@
angular.module("admin.customers").directive 'newCustomerDialog', ($compile, $injector, $templateCache, DialogDefaults, CurrentShop, Customers) ->
restrict: 'A'
scope: true
link: (scope, element, attr) ->
scope.CurrentShop = CurrentShop
scope.submitted = false
scope.email = ""
scope.errors = []
scope.addCustomer = ->
scope.new_customer_form.$setPristine()
scope.submitted = true
scope.errors = []
if scope.new_customer_form.$valid
Customers.add(scope.email).$promise.then (data) ->
if data.id
scope.email = ""
scope.submitted = false
template.dialog('close')
, (response) ->
if response.data.errors
scope.errors.push(error) for error in response.data.errors
else
scope.errors.push("Sorry! Could not create '#{scope.email}'")
return
# Compile modal template
template = $compile($templateCache.get('admin/new_customer_dialog.html'))(scope)
# Set Dialog options
template.dialog(DialogDefaults)
# Link opening of dialog to click event on element
element.bind 'click', (e) ->
if CurrentShop.shop.id
template.dialog('open')
else
alert('Please select a shop first')

View File

@@ -1,8 +0,0 @@
angular.module("admin.customers").directive "tagsWithTranslation", ->
restrict: "E"
template: "<tags-input ng-model='object.tags'>"
scope:
object: "="
link: (scope, element, attrs) ->
scope.$watchCollection "object.tags", ->
scope.object.tag_list = (tag.text for tag in scope.object.tags).join(",")

View File

@@ -0,0 +1,3 @@
angular.module("admin.customers").factory "CurrentShop", ->
new class CurrentShop
shop: {}

View File

@@ -1,8 +1,17 @@
angular.module("admin.customers").factory 'CustomerResource', ($resource) ->
$resource('/admin/customers.json', {}, {
$resource('/admin/customers/:id.json', {}, {
'index':
method: 'GET'
isArray: true
params:
enterprise_id: '@enterprise_id'
'create':
method: 'POST'
params:
enterprise_id: '@enterprise_id'
email: '@email'
'destroy':
method: 'DELETE'
params:
id: '@id'
})

View File

@@ -1,16 +1,27 @@
angular.module("admin.customers").factory 'Customers', (CustomerResource) ->
angular.module("admin.customers").factory "Customers", ($q, InfoDialog, RequestMonitor, CustomerResource, CurrentShop) ->
new class Customers
customers: []
customers_by_id: {}
loaded: false
index: (params={}, callback=null) ->
CustomerResource.index params, (data) =>
for customer in data
@customers.push customer
@customers_by_id[customer.id] = customer
add: (email) ->
params =
enterprise_id: CurrentShop.shop.id
email: email
CustomerResource.create params, (customer) =>
@customers.unshift customer if customer.id
@loaded = true
(callback || angular.noop)(@customers)
remove: (customer) ->
params = id: customer.id
CustomerResource.destroy params, =>
i = @customers.indexOf customer
@customers.splice i, 1 unless i < 0
, (response) =>
errors = response.data.errors
if errors?
InfoDialog.open 'error', errors[0]
else
InfoDialog.open 'error', "Could not delete customer: #{customer.email}"
@customers
index: (params) ->
request = CustomerResource.index(params, (data) => @customers = data)
RequestMonitor.load(request.$promise)
request.$promise

View File

@@ -1,7 +0,0 @@
angular.module("ofn.admin").directive "ofnConfirmLinkPath", (ofnConfirmHandler) ->
restrict: "A"
scope:
path: "@ofnConfirmLinkPath"
link: (scope, element, attrs) ->
element.click ofnConfirmHandler scope, ->
window.location = scope.path

View File

@@ -1,6 +0,0 @@
angular.module("ofn.admin").directive "ofnConfirmModelChange", (ofnConfirmHandler,$timeout) ->
restrict: "A"
link: (scope, element, attrs) ->
handler = ofnConfirmHandler scope, -> scope.fetchOrders()
scope.$watch attrs.ngModel, (oldValue,newValue) ->
handler() unless oldValue == undefined || newValue == oldValue

View File

@@ -1,4 +1,4 @@
angular.module("ofn.admin").directive "ofnTrackMaster", ["DirtyProducts", (DirtyProducts) ->
angular.module("ofn.admin").directive "ofnTrackMaster", (DirtyProducts) ->
require: "ngModel"
link: (scope, element, attrs, ngModel) ->
ngModel.$parsers.push (viewValue) ->
@@ -6,4 +6,3 @@ angular.module("ofn.admin").directive "ofnTrackMaster", ["DirtyProducts", (Dirty
DirtyProducts.addMasterProperty scope.product.id, scope.product.master.id, attrs.ofnTrackMaster, viewValue
scope.displayDirtyProducts()
viewValue
]

View File

@@ -1,9 +0,0 @@
angular.module("ofn.admin").directive "ofnTrackVariantOverride", (DirtyVariantOverrides) ->
require: "ngModel"
link: (scope, element, attrs, ngModel) ->
ngModel.$parsers.push (viewValue) ->
if ngModel.$dirty
variantOverride = scope.variantOverrides[scope.hub.id][scope.variant.id]
DirtyVariantOverrides.add variantOverride
scope.displayDirty()
viewValue

View File

@@ -0,0 +1,10 @@
angular.module("admin.dropdown").controller "ColumnsDropdownCtrl", ($scope, Columns) ->
$scope.columns = Columns.columns
$scope.toggle = Columns.toggleColumn
$scope.saved = Columns.preferencesSaved
$scope.saving = false
$scope.saveColumnPreferences = (action_name) ->
$scope.saving = true
Columns.savePreferences(action_name).then ->
$scope.saving = false

View File

@@ -1,2 +0,0 @@
angular.module("admin.dropdown").controller "DropDownCtrl", ($scope) ->
$scope.expanded = false

View File

@@ -1,4 +1,4 @@
angular.module("admin.dropdown").directive "ofnCloseOnClick", ($document) ->
angular.module("admin.dropdown").directive "closeOnClick", () ->
link: (scope, element, attrs) ->
element.click (event) ->
event.stopPropagation()

View File

@@ -0,0 +1,6 @@
angular.module("admin.dropdown").directive 'columnsDropdown', ->
restrict: 'E'
templateUrl: 'admin/columns_dropdown.html'
controller: 'ColumnsDropdownCtrl'
scope:
action: '@'

View File

@@ -1,8 +1,12 @@
angular.module("admin.dropdown").directive "ofnDropDown", ($document) ->
restrict: 'C'
scope: true
link: (scope, element, attrs) ->
scope.expanded = false
outsideClickListener = (event) ->
unless $(event.target).is("div.ofn_drop_down##{attrs.id} div.menu") ||
$(event.target).parents("div.ofn_drop_down##{attrs.id} div.menu").length > 0
unless $(event.target).is("div.ofn-drop-down##{attrs.id} div.menu") ||
$(event.target).parents("div.ofn-drop-down##{attrs.id} div.menu").length > 0
scope.$emit "offClick"
element.click (event) ->

View File

@@ -0,0 +1,5 @@
angular.module("admin.dropdown").directive "linksDropdown", ($window)->
restrict: "C"
scope:
links: "="
templateUrl: "admin/links_dropdown.html"

View File

@@ -1 +1 @@
angular.module("admin.dropdown", [])
angular.module("admin.dropdown", ['templates'])

View File

@@ -1,69 +0,0 @@
angular.module('enterprise_fees', [])
.controller('AdminEnterpriseFeesCtrl', ['$scope', '$http', '$window', function($scope, $http, $window) {
$scope.enterpriseFeesUrl = function() {
var url = '/admin/enterprise_fees.json?include_calculators=1';
var match = $window.location.search.match(/enterprise_id=(\d+)/);
if(match) {
url += "&"+match[0];
}
return url;
};
$http.get($scope.enterpriseFeesUrl()).success(function(data) {
$scope.enterprise_fees = data;
// TODO: Angular 1.1.0 will have a means to reset a form to its pristine state, which
// would avoid the need to save off original calculator types for comparison.
for(i in $scope.enterprise_fees) {
$scope.enterprise_fees[i].orig_calculator_type = $scope.enterprise_fees[i].calculator_type;
}
});
}])
.directive('ngBindHtmlUnsafeCompiled', ['$compile', function($compile) {
return function(scope, element, attrs) {
scope.$watch(attrs.ngBindHtmlUnsafeCompiled, function(value) {
element.html($compile(value)(scope));
});
}
}])
.directive('spreeDeleteResource', function() {
return function(scope, element, attrs) {
if(scope.enterprise_fee.id) {
var url = "/admin/enterprise_fees/" + scope.enterprise_fee.id
var html = '<a href="'+url+'" class="delete-resource icon_link with-tip icon-trash no-text" data-action="remove" data-confirm="Are you sure?" url="'+url+'"></a>';
//var html = '<a href="'+url+'" class="delete-resource" data-confirm="Are you sure?"><img alt="Delete" src="/assets/admin/icons/delete.png" /> Delete</a>';
element.append(html);
}
}
})
.directive('spreeEnsureCalculatorPreferencesMatchType', function() {
// Hide calculator preference fields when calculator type changed
// Fixes 'Enterprise fee is not found' error when changing calculator type
// See spree/core/app/assets/javascripts/admin/calculator.js
// Note: For some reason, DOM --> model bindings aren't working here, so
// we use element.val() instead of querying the model itself.
return function(scope, element, attrs) {
scope.$watch(function(scope) {
//return scope.enterprise_fee.calculator_type;
return element.val();
}, function(value) {
var settings = element.parent().parent().find("div.calculator-settings");
// scope.enterprise_fee.calculator_type == scope.enterprise_fee.orig_calculator_type
if(element.val() == scope.enterprise_fee.orig_calculator_type) {
settings.show();
settings.find("input").prop("disabled", false);
} else {
settings.hide();
settings.find("input").prop("disabled", true);
}
});
}
});

View File

@@ -0,0 +1,14 @@
angular.module('admin.enterpriseFees').controller 'enterpriseFeesCtrl', ($scope, $http, $window, enterprises, tax_categories, calculators) ->
$scope.enterprises = enterprises
$scope.tax_categories = [{id: -1, name: "Inherit From Product"}].concat tax_categories
$scope.calculators = calculators
$scope.enterpriseFeesUrl = ->
url = '/admin/enterprise_fees.json?include_calculators=1'
match = $window.location.search.match(/enterprise_id=(\d+)/)
if match
url += '&' + match[0]
url
$http.get($scope.enterpriseFeesUrl()).success (data) ->
$scope.enterprise_fees = data

View File

@@ -0,0 +1,6 @@
angular.module("admin.enterpriseFees").directive 'ngBindHtmlUnsafeCompiled', ($compile) ->
(scope, element, attrs) ->
scope.$watch attrs.ngBindHtmlUnsafeCompiled, (value) ->
element.html $compile(value)(scope)
return
return

View File

@@ -0,0 +1,8 @@
angular.module('admin.enterpriseFees').directive 'spreeDeleteResource', ->
(scope, element, attrs) ->
if scope.enterprise_fee.id
url = '/admin/enterprise_fees/' + scope.enterprise_fee.id
html = '<a href="' + url + '" class="delete-resource icon_link icon-trash no-text" data-action="remove" data-confirm="Are you sure?" url="' + url + '"></a>'
#var html = '<a href="'+url+'" class="delete-resource" data-confirm="Are you sure?"><img alt="Delete" src="/assets/admin/icons/delete.png" /> Delete</a>';
element.append html
return

Some files were not shown because too many files have changed in this diff Show More