Compare commits

...

1049 Commits

Author SHA1 Message Date
Em-AK
c72d17dc83 Run karma task only in test environment
and fails otherwise, as it needs the defaults defined in test environment
2017-04-28 11:28:24 +10:00
Em-AK
78ffdec693 Force english locale in test environment 2017-04-28 11:28:24 +10:00
Pierre de Lacroix
49c19a1d6a update wkhtmltopdf-binary and wicked_pdf 2017-04-27 18:38:47 +10:00
Pierre de Lacroix
e854eb0426 add tests
for methods Spree::Order#tax_adjustment_totals
and Spree::Adjustment#find_closest_tax_rate_from_included_tax
2017-04-27 17:32:36 +10:00
Pierre de Lacroix
4a9c17cb28 better tax aggregation 2017-04-27 17:32:36 +10:00
Matt-Yorkley
0d1547f439 Require OC ready_for in simple OC UI 2017-04-21 09:34:50 +10:00
Matt-Yorkley
fa5ed529cb Added OC form validation 2017-04-21 09:32:49 +10:00
Matt-Yorkley
accb3076e9 Updated translations 2017-04-21 09:32:49 +10:00
Matt-Yorkley
a4e4e1ec68 Require OC name 2017-04-21 09:32:49 +10:00
Maikel Linke
4809237ecc Fast fail set_order_cycles if distributor not ready 2017-04-19 14:28:17 +10:00
Maikel Linke
81877fedb6 Remove useless andand called on scope 2017-04-19 14:28:17 +10:00
Matt-Yorkley
1f2c6f2a85 Ensure shops display as closed when not configured for sales
squashme

squashme

squash

squash

squash
2017-04-19 14:28:17 +10:00
Matt-Yorkley
4fe5e60967 Updated controller stub to pass test 2017-04-19 14:28:17 +10:00
Matt-Yorkley
f4eb9cb790 Hubs display as closed when not configured for payment or shipping 2017-04-19 14:28:16 +10:00
Maikel Linke
775f9b3ada Move text from view to locale (i18n) 2017-04-12 10:06:53 +10:00
Maikel Linke
188b33921c Remove test entry in locale 2017-04-12 09:56:24 +10:00
Maikel Linke
20c033317f Remove unnecessary string interpolation from view 2017-04-12 09:49:24 +10:00
Matt-Yorkley
e7a5d063ac Update simple OC form 2017-04-12 09:41:40 +10:00
Matt-Yorkley
1fda781d7e Set maxlength on OC displayname field 2017-04-12 09:41:39 +10:00
Matt-Yorkley
45fc801a08 Added tooltips to OC form 2017-04-12 09:41:39 +10:00
Maikel Linke
21337a5b50 Merge tag 'v1.8.9' into transifex 2017-04-06 10:36:14 +10:00
Maikel Linke
ec36a843cf Merge tag 'v1.8.8' into transifex 2017-04-06 10:31:26 +10:00
Transifex-Openfoodnetwork
e99dbaf4d8 Updating translations for config/locales/es.yml [skip ci] 2017-04-05 19:40:18 +10:00
Rob Harrington
c83ad2ecc4 Fixing broken limited reached page in registration flow 2017-04-05 17:02:40 +10:00
Matt-Yorkley
80d8d18eb2 Update terms of service config 2017-04-05 15:48:50 +10:00
Rob Harrington
903d1afb53 Stripping html tags from products description on new form as well 2017-04-05 14:29:23 +10:00
Matt-Yorkley
cd55d2e2ff Product Description - strip weird tags on paste
squashme
2017-04-05 11:29:35 +10:00
Rob Harrington
05cf8c4351 Sanitizing product description for textAngular input 2017-04-05 11:29:35 +10:00
Matt-Yorkley
b04d815408 Changes for code review
Fixed spec
2017-04-05 11:29:35 +10:00
Matt-Yorkley
7b370a2eb6 Removed underline option 2017-04-05 11:29:35 +10:00
Matt-Yorkley
5808b601b8 Added specs for HTML product description 2017-04-05 11:29:35 +10:00
Matt-Yorkley
fdcd3dc3e3 Fixed Capybara not interacting with textAngular 2017-04-05 11:29:35 +10:00
Matt-Yorkley
c4bd085393 Added Angular and textAngular to edit product page 2017-04-05 11:29:35 +10:00
Matt-Yorkley
0e91d01412 UX improvement for selected formatting options 2017-04-05 11:29:35 +10:00
Matt-Yorkley
fcb9e9fa56 Changed buttons 2017-04-05 11:29:35 +10:00
Matt-Yorkley
3591354cb1 Minor tweaks 2017-04-05 11:29:35 +10:00
Matt-Yorkley
b38eab11eb Fixed frontend HTML display 2017-04-05 11:29:35 +10:00
Matt-Yorkley
c43dea60b7 Product Descriptions formatting 2017-04-05 11:29:35 +10:00
Pierre de Lacroix
268bea25d0 add qz/ folder from ofn-qz gem to list of assets 2017-03-30 20:37:20 +02:00
Pierre de Lacroix
e94ae20b31 fix print_ticket authorization 2017-03-30 20:37:20 +02:00
Maikel Linke
a94961c0a7 Fixup merge conflicts and remove unused text 2017-03-29 14:58:19 +11:00
Lynne Davis
0d5fde919b Property name spans signle col heading 2017-03-29 14:47:17 +11:00
Matt-Yorkley
429ef4e2ba Altered product property headings for issue #522 2017-03-29 14:44:30 +11:00
Lynne Davis
e8999d23e1 Updated translations 2017-03-29 13:12:29 +11:00
Keir Osborn
209c9242d9 remove word-wrap class from enterprise.email_address and enterprise.website in javascripts/templates/partials/contact.html.haml 2017-03-24 12:55:30 +11:00
Transifex-Openfoodnetwork
6defb09d2e Updating translations for config/locales/fr.yml [skip ci] 2017-03-21 09:03:15 +11:00
Transifex-Openfoodnetwork
2774c09d7a Updating translations for config/locales/nb.yml [skip ci] 2017-03-20 07:10:53 +11:00
Matt-Yorkley
c62a044598 PI highlight invalid fields in feedback tables 2017-03-17 16:11:52 +11:00
Matt-Yorkley
f73fbe7f23 SpreadsheetEntry Class and PI refactor 2017-03-17 16:11:52 +11:00
Matt-Yorkley
5e1e4c1d19 Product Import UX review updates
Minor tweaks

Minor fix
2017-03-17 16:11:52 +11:00
Matt-Yorkley
cc5a335fb7 Refactor and additional permissions checks
Don't include non-permitted enterprises in existin product count

Tweaked feedback
2017-03-17 16:11:52 +11:00
Matt-Yorkley
91fc3f33a0 PI reset and save step improvements 2017-03-17 16:11:52 +11:00
Matt-Yorkley
648753b412 Improved save step UI 2017-03-17 16:11:52 +11:00
Matt-Yorkley
24fcc3dd34 PI reset absent products 2017-03-17 16:11:52 +11:00
Matt-Yorkley
14fb40a996 Product Import options and defaults
Added available_on test

Obscure case fix and extra spec
2017-03-17 16:11:52 +11:00
Matt-Yorkley
f4511fc74d PI permission test 2017-03-17 16:11:52 +11:00
Matt-Yorkley
3d0f192490 Product Import update 2017-03-17 16:11:52 +11:00
Matt-Yorkley
6b7cdf3a37 Product Import Refactoring 2017-03-17 16:11:52 +11:00
Matt-Yorkley
052d6c6b02 Product Import basic specs 2017-03-17 16:11:52 +11:00
Matt-Yorkley
6e5c878491 Product Import cancan permissions and ui tab 2017-03-17 16:11:52 +11:00
Matt-Yorkley
c0c6cd1a60 Product Import feature 2017-03-17 16:11:52 +11:00
Matt-Yorkley
2ad433590d Add roo gem 2017-03-17 16:11:52 +11:00
Rohan Mitchell
2cb3da56ab Fix regression: Transaction fee double-charged 2017-03-17 12:02:13 +11:00
Rohan Mitchell
8582e6d6b4 Add robustness check against intermittent spec failure 2017-03-17 12:02:13 +11:00
Rohan Mitchell
170101cbfe Avoid reloading order during checkout request, which clears credit card number 2017-03-17 12:02:13 +11:00
Maikel Linke
8107f49373 Merge remote-tracking branch 'origin/master' into transifex
Conflicts:
	config/locales/fr.yml
2017-03-16 09:30:22 +11:00
Rob Harrington
7ef0964af2 Adding shortcuts for both sales tax reports to the reports index 2017-03-15 23:57:13 +11:00
Rob Harrington
18472ea8c3 Making 'tax types' report the default sales tax report 2017-03-15 23:56:44 +11:00
Rob Harrington
36e0f45a89 Show the shops invoice text on old invoice template 2017-03-15 17:39:21 +11:00
Rob Harrington
bea0b2b1e5 Adding feature toggle for receipt printing using qz 2017-03-15 16:39:04 +11:00
Rob Harrington
9a69951136 Using correct key for invoice_settings title translation 2017-03-15 16:12:50 +11:00
Rob Harrington
e19bab1aa2 Fixing translations for invoice settings edit template 2017-03-15 15:06:28 +11:00
Rob Harrington
8e2a111a0b Changing ofn-qz to openfoodfoundation fork 2017-03-15 15:06:28 +11:00
Pierre de Lacroix
70707969f3 Add Qz integration 2017-03-15 15:06:28 +11:00
Pierre de Lacroix
2fe25c6219 Allow both invoice layouts to coexist
Add a new "Invoice" page in the admin backend
with a checkbox to toggle between layouts
2017-03-15 15:06:28 +11:00
Pierre de Lacroix
cc1ef5b28b fixes on invoice and tax report 2017-03-15 15:04:57 +11:00
Pierre de Lacroix
3fc2070b2c fix aggregation of taxes for taxes on adjustments 2017-03-15 15:03:46 +11:00
Pierre de Lacroix
d22f5678be small fixes for sales tax report 2017-03-15 15:03:46 +11:00
Rob Harrington
0429906eed Slight adjustments to invoice layout
1. Hide tax column when no tax included in the order

2. Save a little bit of space in the header by sharing rows
2017-03-15 15:03:46 +11:00
Pierre de Lacroix
88a09da325 fix for pull request #1374 2017-03-15 15:03:18 +11:00
Pierre de Lacroix
963f0d601f fix test for tax report 2017-03-15 15:03:18 +11:00
Pierre de Lacroix
8570471c00 add tax rates report 2017-03-15 15:03:18 +11:00
Pierre de Lacroix
7925af30d6 add enterprise logo and custom text on invoices 2017-03-15 15:03:18 +11:00
Pierre de Lacroix
6f59751582 change i18n fallbacks parameter to EN in production settings 2017-03-15 15:03:18 +11:00
Pierre de Lacroix
2d2792225a change invoice layout to include amount for each relevant tax rate 2017-03-15 15:03:18 +11:00
Maikel Linke
a079a64cbe Merge branch 'master' of github.com:openfoodfoundation/openfoodnetwork into i18n2 2017-03-15 12:35:39 +11:00
Maikel Linke
656be690a3 Remove space from permalink tip 2017-03-15 12:11:56 +11:00
Maikel Linke
167045f695 Remove forgotten " character 2017-03-15 12:01:31 +11:00
François Turbelin
dbe968afbb Fixing translated interpolation in fr locale 2017-03-12 12:42:00 +01:00
François Turbelin
179b995fa0 Fixing wrong string interpolation in i18n files 2017-03-12 12:41:06 +01:00
François Turbelin
4791086207 Fixing i18n multiline issues 2017-03-12 12:39:29 +01:00
François Turbelin
be6b09a6e0 Adding i18n keys on JS templates 2017-03-12 12:22:13 +01:00
Transifex-Openfoodnetwork
f235099859 Updating translations for config/locales/fr.yml [skip ci] 2017-03-11 16:50:17 +11:00
Matt-Yorkley
ff8ca521ff Open tos pdf in new tab 2017-02-22 13:40:17 +11:00
Rob Harrington
98f7d52493 Refactor: wrapping registration templates in script tags 2017-02-22 13:40:17 +11:00
Rob Harrington
4815405839 WIP: Moving registration templates in app/views as partials 2017-02-22 13:40:17 +11:00
Rob Harrington
42a6e35185 Making registration spec click_and_ensure assertions more generic
Assertions can be made about checking checkboxes
2017-02-22 13:40:17 +11:00
Matt-Yorkley
408a57479e Flaky tests 2017-02-22 13:40:17 +11:00
Matt-Yorkley
beaf54107c Moved angular template to views folder 2017-02-22 13:40:17 +11:00
Matt-Yorkley
e45d1d42b4 Tidying up 2017-02-22 13:40:17 +11:00
Matt-Yorkley
bc442c7819 Re-adding a line removed in testing 2017-02-22 13:40:17 +11:00
Matt-Yorkley
6a361f2d7b Specced the new terms of service functionality 2017-02-22 13:40:17 +11:00
Matt-Yorkley
a62998e5f1 Enterprise Terms of Service 2017-02-22 13:40:17 +11:00
François Turbelin
ebcb8ff3e7 Finishing Translations keys implemtentation on Admin ERB views 2017-02-19 22:08:34 +01:00
Maikel Linke
da8c107331 Merge remote-tracking branch 'origin/master' into transifex
Conflicts:
	config/locales/fr.yml
2017-02-15 15:47:25 +11:00
Continuous Integration
5870927518 Merge remote-tracking branch 'origin/master' into HEAD 2017-02-10 16:42:27 +11:00
Transifex-Openfoodnetwork
e008a154e5 Updating translations for config/locales/sv.yml [skip ci] 2017-02-09 02:36:14 +11:00
Continuous Integration
a2d01b5144 Merge remote-tracking branch 'origin/master' into HEAD 2017-02-08 16:53:53 +11:00
Rob Harrington
8afd5c509b Using coffescript syntax to check for presence of enterprise_form 2017-02-08 15:59:11 +11:00
Matt-Yorkley
311f72e4cb Fixing JS spec failure 2017-02-08 15:59:11 +11:00
Matt-Yorkley
78563a7d75 Changed for build failure 2017-02-08 15:59:11 +11:00
Matt-Yorkley
9284dd9b63 Enable save after deleting enterprise manager 2017-02-08 15:59:11 +11:00
Continuous Integration
92981e4fcd Merge remote-tracking branch 'origin/master' into HEAD 2017-02-08 10:38:47 +11:00
Matt-Yorkley
9235727d45 Merge pull request #5 from mkllnk/pr-1329-enterprise-switcher
Re-use NavigationCheck logic
2017-02-02 15:26:01 +00:00
Matt-Yorkley
fc4ead9b05 Ensure on_demand set properly on new products 2017-02-02 01:06:20 +00:00
Maikel Linke
b8622e95b7 Re-use NavigationCheck logic
The enterprise switcher now uses the same code as NavigationCheck to
confirm leaving a changed form. This makes FormState obsolete.

Conflicts:
	app/assets/javascripts/admin/enterprises/controllers/enterprise_controller.js.coffee
2017-02-02 10:58:32 +11:00
Continuous Integration
f8341dccd4 Merge remote-tracking branch 'origin/master' into HEAD 2017-02-01 10:35:53 +11:00
Lynne
b8ed7789f0 Merge pull request #1427 from openfoodfoundation/revert-1424-master
Revert "translate ABN and ACN to company number, charity number"
2017-01-30 13:18:16 +00:00
Lynne
6d19613ecc Revert "translate ABN and ACN to company number, charity number" 2017-01-30 12:53:01 +00:00
Lynne
0d56cbf169 Merge pull request #1424 from OliverUK/master
translate ABN and ACN to company number, charity number
2017-01-30 12:04:54 +00:00
Lynne
67730e82c3 Update en-GB.yml 2017-01-30 12:04:24 +00:00
OliverUK
940ca7ade1 translate ABN and ACN to company number, charity number 2017-01-27 15:02:38 +00:00
Continuous Integration
05f9747f15 Merge remote-tracking branch 'origin/master' into HEAD 2017-01-25 12:41:02 +11:00
Matt-Yorkley
27903ab744 Merge branch 'master' into uk/switcher 2017-01-22 18:57:25 +00:00
Matt-Yorkley
931e528e14 Code review changes 2017-01-22 18:55:28 +00:00
Matt-Yorkley
6bed94a09b Include E2E permissions 2017-01-22 18:42:23 +00:00
Paul Mackay
165b437f31 #1226: fix OSM URL to use HTTPS 2017-01-20 15:59:22 +00:00
Continuous Integration
b526307ad1 Merge remote-tracking branch 'origin/master' into HEAD 2017-01-18 18:14:10 +11:00
Continuous Integration
a7bfddfcb5 Merge remote-tracking branch 'origin/master' into HEAD 2017-01-18 17:22:21 +11:00
Continuous Integration
52e4722dcb Merge remote-tracking branch 'origin/master' into HEAD 2017-01-18 11:19:57 +11:00
Rob Harrington
017916b193 Enterprise distributing_products scope uses INNER JOINS instead of OUTER JOINS 2017-01-17 19:28:21 +11:00
Paul Mackay
02e5ba4dfd Convert .sass files to .scss format 2017-01-15 12:11:53 +00:00
Paul Mackay
651626eb4f #1365: Remove /test dir as it is not used 2017-01-14 11:47:21 +00:00
Continuous Integration
20d01c3047 Merge remote-tracking branch 'origin/master' into HEAD 2017-01-13 11:44:47 +11:00
Continuous Integration
a391b6f076 Merge remote-tracking branch 'origin/master' into HEAD 2017-01-13 11:12:17 +11:00
Continuous Integration
ade73f66c8 Merge remote-tracking branch 'origin/master' into HEAD 2017-01-13 10:50:32 +11:00
Maikel Linke
44970a13bb Fix translation of email confirmation notice
The `_html` suffix was missing leading to `<br />` being displayed in
plain text. The new version also integrates the email address as a
variable in the translation.
2017-01-13 10:21:25 +11:00
Paul Mackay
d80f080af5 #1027: Use url helpers for basic pages
Set groups change frequency to monthly.
2017-01-12 10:18:30 +00:00
Continuous Integration
6ec7276cfc Merge remote-tracking branch 'origin/master' into HEAD 2017-01-11 16:30:37 +11:00
Continuous Integration
2444d3b547 Merge remote-tracking branch 'origin/master' into HEAD 2017-01-11 15:54:08 +11:00
Maikel Linke
e899633aff Merge duplicate locale entry admin.enterprises.index 2017-01-11 14:48:05 +11:00
Maikel Linke
a9f01c0f0d Fix typos in en.yml 2017-01-11 11:15:44 +11:00
Matt-Yorkley
e021afdd8a Updated spec 2017-01-10 23:53:13 +00:00
François Turbelin
88dea0f2b8 Adding i18n keys on Admin side (Rails views) 2017-01-11 10:00:06 +11:00
Matt-Yorkley
5150025641 Updated tag rules UI 2017-01-10 22:54:22 +00:00
Paul Mackay
fc400741b4 Remove lastmod for groups 2017-01-10 11:44:57 +00:00
Paul Mackay
5cb2194f5e #1027: Add sitemap.xml generation 2017-01-10 11:39:17 +00:00
Transifex-Openfoodnetwork
64f6a794fc Updating translations for config/locales/nb.yml [skip ci] 2017-01-08 23:36:57 +11:00
elf Pavlik
764c95488c made api key optional (google maps) 2017-01-07 10:25:32 -06:00
Lynne
6cabba4cd8 Merge pull request #1354 from openfoodfoundation/uk/translation
Uk/translation
2017-01-06 10:00:23 +00:00
elf Pavlik
bd1cd527d3 configurable google maps api key 2017-01-03 20:57:10 -06:00
Lynne Davis
d17f9dc504 update 2017-01-03 16:35:01 +00:00
Lynne Davis
f62c583130 uk translation updates 2017-01-03 16:12:41 +00:00
Maikel
b1e27e0dad Auto-merged master into uk/translation on deployment. 2017-01-04 02:24:40 +11:00
Levent Ali
6ae1272281 Mark order cycle form as dirty when removing fees
Resolves an issue where removing coordinator/exchange fees
wasn't allowing users to save the OC.

Fixes #1165
2016-12-23 09:33:34 +11:00
Lynne
e0cb6ed60a Merge pull request #1349 from openfoodfoundation/tos
Adding UK ToS to repo
2016-12-22 18:31:30 +00:00
Maikel
8aeec74fed Auto-merged master into tos on deployment. 2016-12-22 23:19:27 +11:00
Lynne Davis
7cd7e7367b Adding UK TOS to repo 2016-12-22 12:09:44 +00:00
Continuous Integration
4f4fe90db4 Merge remote-tracking branch 'origin/master' into HEAD 2016-12-21 15:27:57 +11:00
Continuous Integration
7a7cd3a937 Merge remote-tracking branch 'origin/master' into HEAD 2016-12-21 14:16:08 +11:00
Continuous Integration
bfc01e7c89 Merge remote-tracking branch 'origin/master' into HEAD 2016-12-21 11:21:42 +11:00
Matt-Yorkley
bc5672b5eb Added translation 2016-12-20 13:30:24 +00:00
Lynne Davis
d77f775c4c Moving commits from 1241 to trigger build on UK staging 2016-12-19 15:06:43 +00:00
Matt-Yorkley
7531c8cbc9 Removed dashes 2016-12-19 11:10:12 +00:00
Matt-Yorkley
38fe0afc03 Changed p widths 2016-12-17 22:59:29 +00:00
Matt-Yorkley
252f876827 Fixed orders closed display for mobile view 2016-12-17 22:54:59 +00:00
Matt-Yorkley
6d9bae8ef9 Checkout layout adjustments for mobile view 2016-12-17 20:39:13 +00:00
Matt-Yorkley
0b2281dfe2 Adjustment for chrome browser 2016-12-17 16:07:39 +00:00
Continuous Integration
72cff0688a Merge remote-tracking branch 'origin/master' into HEAD 2016-12-16 15:24:52 +11:00
Rohan Mitchell
9793450ed0 Make mobile menu mimic the large menu 2016-12-16 14:40:13 +11:00
Rohan Mitchell
c8f0502e71 Apply connect_learn_homepage feature toggle to mobile menu 2016-12-16 14:32:48 +11:00
Continuous Integration
b075ed373a Merge remote-tracking branch 'origin/master' into HEAD 2016-12-16 13:46:08 +11:00
Rafael Braz
eef308c4f6 create a pr-br translate file (#1266) 2016-12-15 08:39:37 +11:00
Transifex-Openfoodnetwork
70225afa13 Updating translations for config/locales/fr.yml [skip ci] 2016-12-12 05:53:28 +11:00
Matt-Yorkley
0a67876815 Update angular-file-uploader-rails to v1.1.6 2016-12-09 18:47:16 +00:00
Lynne
b59e5ad248 Merge pull request #1243 from openfoodfoundation/uk/translations
Translation updates
2016-12-09 16:37:38 +00:00
Matt-Yorkley
287e0b5b55 Enterprise switcher and navigation check 2016-12-09 15:15:42 +00:00
Continuous Integration
c6a1560845 Auto-merge from CI [skip ci] 2016-12-10 01:42:26 +11:00
Lynne Davis
45dc1341d3 translation updates 2016-12-09 14:41:16 +00:00
Matt-Yorkley
7d7197da58 Reordered enterprises submenu 2016-12-09 14:31:34 +00:00
Matt-Yorkley
066f42070a Fixed confusing wysiwyg line breaks display discrepency 2016-12-09 14:12:00 +00:00
Lynne Davis
cad3464f56 Adjusted BOM spec to reflect currency symbol changes 2016-12-09 11:40:55 +00:00
Rohan Mitchell
bbcaef20a8 Add unit specs for Spree::Admin::NavigationHelper 2016-12-09 11:24:58 +11:00
Rohan Mitchell
43726a0b23 Fix inventory link not appearing on menu 2016-12-08 10:38:29 +11:00
Rohan Mitchell
6e6efea328 Fix groups link not appearing on menu 2016-12-08 10:38:23 +11:00
Maikel Linke
a2a6ce1b3e Revert "TEMP: Remove override for no-longer-present method"
This reverts commit a3b91dabe5.

Conflicts:
	app/helpers/spree/admin/navigation_helper_decorator.rb
2016-12-08 10:38:21 +11:00
Maikel Linke
3a69c958ef Hide super admin menu items for enterprise users
Imported temporarily missing Spree functionality. This patch becomes
obsolete with another Spree upgrade.
2016-12-08 10:38:21 +11:00
Continuous Integration
14ee7a06ae Merge remote-tracking branch 'origin/master' into HEAD 2016-12-07 17:03:27 +11:00
Maikel Linke
6cd8289b27 Correct more typos 2016-12-02 16:50:54 +11:00
Rob Harrington
d0509b54bf Disabling override the adds coupon field to cart page 2016-11-30 18:30:20 +11:00
Lynne Davis
ee905cad5f Translation updates 2016-11-29 15:07:35 +00:00
Transifex-Openfoodnetwork
01efb63ad3 Updating translations for config/locales/en_GB.yml [skip ci] 2016-11-30 01:07:53 +11:00
Matt-Yorkley
7981feefa1 Updated form to include help tip for clarity 2016-11-28 14:38:13 +00:00
Rohan Mitchell
d4fd66461e Add retry to flaky specs 2016-11-25 14:37:47 +11:00
Rohan Mitchell
071ba5285d Put timecop config in spec support 2016-11-25 14:28:05 +11:00
Rohan Mitchell
6795237a2d Put timecop into safe mode and fix leaky Timecop.freeze 2016-11-25 14:14:42 +11:00
Rohan Mitchell
57363e2da5 When a product is deleted, touch the supplier and distributors 2016-11-25 14:14:42 +11:00
Rohan Mitchell
da9a3ce9f3 Refresh products cache when product is deleted (cf. destroyed) 2016-11-25 14:14:42 +11:00
Rohan Mitchell
c4318030d3 Fix spec: Second visit doesn't actually reload the page 2016-11-25 14:14:42 +11:00
Rohan Mitchell
44a301edb1 When touching distributing enterprises, do not touch self -> infinite recursion 2016-11-25 14:14:42 +11:00
Rohan Mitchell
dabac50128 Replace Enterprise.distributing_product and Enterprise.distributing_any_product_of with Enterprise.distributing_products 2016-11-25 14:14:42 +11:00
Rohan Mitchell
6030e9a294 Cache enterprise supplied and distributed properties and producer properties 2016-11-25 14:14:42 +11:00
Rohan Mitchell
9b656eaf4f Property / ProducerProperty changes update distributor enterprise cache 2016-11-25 14:14:42 +11:00
Rohan Mitchell
22080a9a08 Property / ProducerProperty changes update supplier enterprise cache 2016-11-25 14:14:42 +11:00
Rohan Mitchell
d93fe3cf2c Cache enterprise supplied and distributed taxons 2016-11-25 14:14:42 +11:00
Rohan Mitchell
1ea4f4274c Add enterprise cache invalidation for order cycle changes 2016-11-25 14:14:42 +11:00
Rohan Mitchell
bd11c6ce14 New hash style 2016-11-25 14:14:42 +11:00
Rohan Mitchell
e8848451a5 Spacing 2016-11-25 14:14:42 +11:00
Rohan Mitchell
f4f38b4183 Re-apply shop property filters - including performance regression
This reverts commit 7d149ed198.
2016-11-25 14:14:42 +11:00
Rob Harrington
27283c50b8 Customers service clears array fo each #index request 2016-11-25 12:43:48 +11:00
Matt-Yorkley
3e77534dcf Product variant form script 2016-11-25 01:31:45 +00:00
Rob Harrington
5e214a32b3 Moving ShippingMethods service to admin.resource module 2016-11-25 11:59:00 +11:00
Rob Harrington
7498b7f098 Moving PaymentMethods service to admin.resource module 2016-11-25 11:57:59 +11:00
Rob Harrington
268c8dbcdd Moving Customers and CustomerResource services to admin.resource module 2016-11-25 11:46:51 +11:00
Rob Harrington
dbbd52cace Fixing broken taxons filter on bulk product edit
Was referencing Taxons.taxons instead of Taxons.all
2016-11-25 10:37:01 +11:00
Rob Harrington
1770a67cd9 Adding #load function to services for resources, for generic loading of data into byID and pristineByID 2016-11-25 10:37:01 +11:00
Rob Harrington
3678d4d018 Creating new 'resources' module for holding interdependent ngResource services 2016-11-25 10:37:01 +11:00
Rob Harrington
3de69987e6 Changing convention for angular resource services to generic 'byID' object and 'all' array 2016-11-25 10:37:01 +11:00
Rob Harrington
cbbb047fc1 Expunge all mentions of includeBlank and blankOption from angular services 2016-11-25 10:37:01 +11:00
Maikel Linke
338d3cbc38 Delete old commented code 2016-11-25 10:27:13 +11:00
Maikel Linke
4c438ff101 Merge branch 'master' of github.com:openfoodfoundation/openfoodnetwork into shop-navigation-directive 2016-11-25 10:24:42 +11:00
Rohan Mitchell
631b19084a Fix intermittent failure via FK when deleted taxon is primary taxon on p2 2016-11-25 09:37:05 +11:00
Levent Ali
63e815c7fc Correct spelling of further in translations 2016-11-24 08:31:01 +00:00
Rohan Mitchell
b7e9ffc9da Fix enterprise user being denied access to admin when spree dash configured (as on production) 2016-11-24 13:35:49 +11:00
Rohan Mitchell
d8ce0e7d58 A user without enterprises does not have access to the dashboard, so it's not meaningful to spec 2016-11-24 13:35:04 +11:00
Continuous Integration
a115f2a268 Merge remote-tracking branch 'origin/master' into HEAD 2016-11-23 15:00:02 +11:00
Maikel Linke
c0c8b07add Let shopping tabs listen to URL changes
When clicking on a shopping tab like "contact", it changed the URL. But
changing the URL did not change the tab. Listening to URL changes
enables manual manipulation of the URL and simple links to "#/contact"
to open the contact tab.
2016-11-11 17:11:39 +11:00
Rohan Mitchell
5913004e14 Fix datepicker error parsing date 2016-11-09 11:47:57 +11:00
Rohan Mitchell
f4034b1065 Fix spec 2016-11-04 09:39:17 +11:00
Rob Harrington
db93b74490 Refactoring ofnSelect2, works with multiple, and with promised data 2016-11-04 09:39:17 +11:00
Rohan Mitchell
d574b8943b WIP: Cherry-pick b2d82b6 - Using ofnSelect2 instead of plain select on BOM 2016-11-04 09:39:17 +11:00
Rohan Mitchell
46fcf7b62e Fix enterprise group save error - initialise address correctly 2016-11-04 09:39:17 +11:00
Rohan Mitchell
3e565ad7cb Mark admin enterprises form dirty when property removed 2016-11-04 09:39:17 +11:00
Rohan Mitchell
0e01350107 Use jquery-migrate instead of downgrading jQuery to access $.browser 2016-11-04 09:39:17 +11:00
Rohan Mitchell
7d79fffa33 Reinstate Spree::PaymentMethod::DISPLAY (removed in Spree but used by us) 2016-11-04 09:39:17 +11:00
Rohan Mitchell
4117b32ebd Fix specs: We had no permission to update the specified supplier (how did this ever work?) 2016-11-04 09:39:17 +11:00
Rohan Mitchell
7a68cc7da1 Remove spec for product distributions 2016-11-04 09:39:17 +11:00
Rohan Mitchell
20e6b703d9 Rewrite alias_method to alias_method_chain 2016-11-04 09:39:17 +11:00
Rohan Mitchell
a1535d6c04 Catch flash messages after fadeout 2016-11-04 09:39:17 +11:00
Rohan Mitchell
f33df883a0 Fix link_to_remove_fields - does not immediately delete the field 2016-11-04 09:39:17 +11:00
Rohan Mitchell
48acf80c85 Fix tabbing 2016-11-04 09:39:17 +11:00
Rohan Mitchell
d8f8c0df16 Fix API auth: Need Spree::Api::UsersController for authorise_api action to work 2016-11-04 09:39:17 +11:00
Rohan Mitchell
8ce917a422 Work around click obscuration 2016-11-04 09:39:17 +11:00
Rohan Mitchell
6546d2763b Add Spree::Money#to_html (from Spree 2.0) 2016-11-04 09:39:17 +11:00
Rohan Mitchell
d3a3b2da9a Pin jquery-rails to 2.1.4 (older version) to prevent missing $.browser errors 2016-11-04 09:39:17 +11:00
Rohan Mitchell
fdd6400cb8 Fix perms for API soft delete 2016-11-04 09:39:17 +11:00
Rohan Mitchell
225e436293 Update included tax param before loading resource 2016-11-04 09:39:17 +11:00
Rohan Mitchell
0e354f8fc1 Remove unused currency config vars: decimal_mark, thousands_separator 2016-11-04 09:39:17 +11:00
Rohan Mitchell
a6a0bdb063 Sanitize values before they're used 2016-11-04 09:39:17 +11:00
Rohan Mitchell
6753320336 Do not stomp address on create 2016-11-04 09:39:17 +11:00
Rohan Mitchell
a3b91dabe5 TEMP: Remove override for no-longer-present method 2016-11-04 09:39:17 +11:00
Rohan Mitchell
257441c9be Re-add object-level auth to Spree::Admin::ResourceController 2016-11-04 09:39:17 +11:00
Rohan Mitchell
1497d2c3bb Remove missing call 2016-11-04 09:39:17 +11:00
Rohan Mitchell
8f0bc367d0 Include missing helpers 2016-11-04 09:39:17 +11:00
Rohan Mitchell
764219b9ed Fix OrderMailer#find_order 2016-11-04 09:39:17 +11:00
Rohan Mitchell
7f7ee25e27 Money accessors changed to dollars/cents 2016-11-04 09:39:17 +11:00
Rohan Mitchell
1765ba0422 Fix spec dependent on product on_demand 2016-11-04 09:39:17 +11:00
Rohan Mitchell
32d2adc8a2 Fix mailers - provide from address 2016-11-04 09:39:17 +11:00
Rohan Mitchell
d890770104 Order state transition condition removed in Spree 2016-11-04 09:39:17 +11:00
Rohan Mitchell
376c4c3e0e Fix factories - base_product and base_variant removed 2016-11-04 09:39:17 +11:00
Rohan Mitchell
a0b740f52d Generalise fix for missing EnterpriseFee::Calculator to any use of calculated_adjustments 2016-11-04 09:39:17 +11:00
Rohan Mitchell
0d4c4f20df Fix missing EnterpriseFee::Calculator error
Conflicts:
	app/models/enterprise_fee.rb
2016-11-04 09:39:17 +11:00
Rohan Mitchell
ab707cf312 Bundle incremental Spree upgrade 2016-11-04 09:39:17 +11:00
Rohan Mitchell
9989b76b7d Integrate from Spree fork: Calculators work against LineItems 2016-11-04 09:39:17 +11:00
Rohan Mitchell
04a714426f Integrate from Spree fork: Fix spree issues #3531 and #2210 (patch provided by leiyangyou) 2016-11-04 09:39:17 +11:00
Maikel Linke
b66cf14bcb Merge remote-tracking branch 'origin/master' into transifex
Conflicts:
	config/locales/en_GB.yml
2016-10-28 15:21:03 +11:00
Transifex-Openfoodnetwork
b78739f777 Updating translations for config/locales/it.yml [skip ci] 2016-10-21 22:51:27 +11:00
Bing Xie
fb08759bec Add more tests 2016-10-21 14:45:04 +11:00
Bing Xie
a4755865ca Fix customer name 2016-10-21 11:58:50 +11:00
Bing Xie
5318aaedcf Fix country id and state in type bug 2016-10-21 11:42:13 +11:00
Rob Harrington
3e56571e59 Making checkout accordion work with new local storage library 2016-10-21 10:51:36 +11:00
Rob Harrington
e57a25d05f Replacing local storage library with actively maintained one: grevory/angular-local-storage 2016-10-21 10:51:36 +11:00
Rob Harrington
b59a1cc232 Using true/false instead of YES/NO for address defaults and billing same as shipping 2016-10-21 10:51:36 +11:00
Bing Xie
720ca17533 Fix the mistake 2016-10-21 10:51:36 +11:00
Bing Xie
d48b00c77c Fix failed user spec 2016-10-21 10:51:36 +11:00
Bing Xie
77f43e3ca7 Refactor setting default addresses 2016-10-21 10:51:36 +11:00
Bing Xie
23b8fbbbc7 Update customer's default address 2016-10-21 10:51:36 +11:00
Bing Xie
b0402daf32 Fix failed customers filter spec 2016-10-21 10:51:36 +11:00
Bing Xie
079788b4eb Add customer preferred bill and ship address 2016-10-21 10:51:36 +11:00
Bing Xie
21ed37189a Only search customers in user managed enterprises 2016-10-21 10:51:36 +11:00
Bing Xie
80d755da0d Convert state_id and country_id in serializer 2016-10-21 10:51:36 +11:00
Bing Xie
8d534041b2 Refactor js CurrentOrder 2016-10-21 10:51:36 +11:00
Bing Xie
e91c313f1e Fix state_id and country_id type bug 2016-10-21 10:51:36 +11:00
Bing Xie
2f241485a2 Set default addresses for user or customer 2016-10-21 10:51:36 +11:00
Bing Xie
f14ca87eb5 Set new address for user 2016-10-21 10:51:36 +11:00
Bing Xie
1caf648fe5 Move customer search to directive 2016-10-21 10:51:36 +11:00
Bing Xie
ac39c93bbf Fix failed js test 2016-10-21 10:51:36 +11:00
Bing Xie
63617f80c5 Add confirm when delete customer 2016-10-21 10:51:36 +11:00
Bing Xie
a94a30f422 Update the orders spec 2016-10-21 10:51:36 +11:00
Bing Xie
63dc48a075 Override customer search UI 2016-10-21 10:51:36 +11:00
Bing Xie
bc798504e0 Add new enterprise customers search API 2016-10-21 10:51:36 +11:00
Bing Xie
fd32152e88 Search customers in enterprises 2016-10-21 10:51:36 +11:00
Bing Xie
1877bea68d Customer serializer without tag_rule_mapping option 2016-10-21 10:51:36 +11:00
Bing Xie
f7523ad88c Create customer with default name and addresses 2016-10-21 10:51:36 +11:00
Bing Xie
ae2357d309 Edit customer address with first name and last name 2016-10-21 10:51:36 +11:00
Bing Xie
8afbdcaf79 Move phone down 2016-10-21 10:51:36 +11:00
Bing Xie
3e590f92ff Set default billing address and shipping address 2016-10-21 10:51:36 +11:00
Bing Xie
a6cfa061e4 Fix ship_address_same_as_billing checkbox value with string 2016-10-21 10:51:36 +11:00
Maikel Linke
d59db1cd97 Merge remote-tracking branch 'origin/master' into uk/delivery-address 2016-10-19 11:01:24 +11:00
Transifex-Openfoodnetwork
7cfb25ace9 Updating translations for config/locales/en_GB.yml [skip ci] 2016-10-15 01:48:24 +11:00
Continuous Integration
51f97f5b28 Merge remote-tracking branch 'origin/master' into HEAD 2016-10-12 13:02:27 +11:00
Transifex-Openfoodnetwork
33d940c736 Updating translations for config/locales/fr.yml [skip ci] 2016-10-12 01:03:42 +11:00
Maikel Linke
08b9b50f33 Re-phrase shop options 2016-10-07 13:17:28 +11:00
Maikel Linke
7c3968b64e Hide guest checkout if deactivated 2016-10-05 15:41:09 +11:00
Maikel Linke
c59cd21698 Add option 'allow guest orders' to enterprise
An enterprise manager can choose to allow guest orders (default) or
require a valid login for checkout.
2016-10-05 14:04:08 +11:00
Maikel Linke
92694c729f Move 'shopfront requires login' setting
Move 'shopfront requires login' setting to 'shop preferences' tab in
Profile Edit.

Solves issue #901.
2016-10-05 14:04:08 +11:00
Maikel Linke
7b2b285ba7 Rescue spec fails within enqueue_job matcher
Failing code tested by the enqueue_job matcher made it fail with:

  expected ConfirmOrderJob to be enqueued matching {} (??? others enqueued)

That was not helpful and masking the real failure. That failure is now
passed on. The hidden intermittent failure happened in 5% of runs on
Travis.
2016-10-05 14:04:08 +11:00
Maikel Linke
caeb8f08e7 Use link_to with mailto attribute to un-reverse email 2016-10-05 12:31:42 +11:00
Continuous Integration
499237715e Auto-merge from CI [skip ci] 2016-10-05 03:08:43 +11:00
Lynne Davis
7eb2dfba48 Update delivery report to use shipping address 2016-10-04 17:04:35 +01:00
Continuous Integration
815cf16822 Auto-merge from CI [skip ci] 2016-10-05 01:33:18 +11:00
Lynne Davis
a3722dee80 delete file - fix conflict 2016-10-04 15:29:57 +01:00
Lynne Davis
79ea2fd39d Reverse email address 2016-10-03 16:54:15 +01:00
Transifex-Openfoodnetwork
b349c28b9b Updating translations for config/locales/nb.yml [skip ci] 2016-10-02 00:38:02 +10:00
Lynne Davis
40ca2ccee4 Updating TOS url in confirmation email to refer to content_config 2016-09-25 15:14:44 +01:00
Lynne Davis
84b4a9bcbe update to internationalise email address in sell page 2016-09-25 14:00:11 +01:00
Maikel
1742367b36 Auto-merged master into issue_1134 on deployment. 2016-09-22 04:50:28 +10:00
Rhodri Karim
8a1d34e711 Fix for issue 1134 - 'Pack by supplier' report now groups by order rather than last name. 2016-09-21 19:41:43 +01:00
Maikel Linke
fba72498e3 Merge remote-tracking branch 'origin/master' into transifex 2016-09-21 16:36:22 +10:00
Lynne Davis
c533f6a15e Updates to UK translations 2016-09-19 20:33:58 +01:00
Transifex-Openfoodnetwork
23a216004e Updating translations for config/locales/en_GB.yml [skip ci] 2016-09-20 01:02:27 +10:00
Rob Harrington
7d149ed198 Revert shop property filters - causing 10x slowdown
This commit reverts commits 7eeee78c4e to e8f96e4818 (inclusive)
2016-09-18 17:46:43 +10:00
Rohan Mitchell
e8f96e4818 When a shop is open, only show taxon badges for currently open order cycles 2016-09-16 11:47:45 +10:00
Rohan Mitchell
3ca42ae055 Extract ids_to_objs to SerializerHelper 2016-09-16 11:36:27 +10:00
Rohan Mitchell
c0db23af90 Spree::Taxon.distributed_taxons can be scoped to taxons in open order cycles 2016-09-16 11:36:27 +10:00
Rohan Mitchell
db583df198 Use inner join for Spree::Taxon.distributed_taxons 2016-09-16 11:36:27 +10:00
Rohan Mitchell
306bd25dd9 EnterpriseSerialiser shows current properties for open shops and all properties for closed shops 2016-09-16 11:36:27 +10:00
Rohan Mitchell
f98b25b719 Add Spree::Property.ever_sold_by 2016-09-16 11:36:27 +10:00
Rohan Mitchell
1bc477f6b1 Add ProducerProperty.ever_sold_by 2016-09-16 11:36:26 +10:00
Rohan Mitchell
c37bf3d077 Rename Property#sold_by and ProducerProperty#sold_by to currently_sold_by 2016-09-16 11:36:26 +10:00
Rohan Mitchell
3a2e0b7eff Fix spacing 2016-09-16 11:36:26 +10:00
Rohan Mitchell
38c63fc88b Available producer filters update when taxon filter changed 2016-09-16 11:36:26 +10:00
Rohan Mitchell
8ec2ebbf94 Swap to using multi-line selectors for property filters - z-index issues with single-line-selectors 2016-09-16 11:36:26 +10:00
Rohan Mitchell
e00846776e Client-side, always show properties by their presentation, not their name 2016-09-16 11:36:26 +10:00
Rohan Mitchell
8339d247f8 Shops on groups page filter by property 2016-09-16 11:36:26 +10:00
Rohan Mitchell
ed2522f6d2 Explicitly specify supplied or distributed properties for ng filters: properties, propertiesOf 2016-09-16 11:36:26 +10:00
Rohan Mitchell
63ef5de0e5 Use short syntax for render partial 2016-09-16 11:28:45 +10:00
Rohan Mitchell
38d5682762 Add property filters for shops 2016-09-16 11:28:45 +10:00
Rohan Mitchell
4c40219352 Move hubs partials from home to shops, their rightful home 2016-09-16 11:28:45 +10:00
Rohan Mitchell
7eeee78c4e WIP: Move hubs partials from home to shops, their rightful home 2016-09-16 11:28:45 +10:00
Rob Harrington
0760d4cc1f Fixing property filters on shopfront 2016-09-08 12:15:36 +10:00
Rob Harrington
261a574da9 Tweaking styling on enterprise change form, and dashboard header row 2016-09-07 11:13:48 +10:00
Rob Harrington
da55eb6d27 Form for changing enterprise type specifies trial length 2016-09-07 11:13:05 +10:00
Rob Harrington
be51a55f16 Only display shopfront trial message on dashboard page. Fixes #1120 2016-09-02 13:45:49 +10:00
Rob Harrington
b2e14711ac Gateway providers inherit from decorated Gateway and PaymentMethod classes in production
Achieved by requiring payment method and gateway decorators in Spree initializer
2016-08-31 12:43:22 +10:00
Rob Harrington
1059c170d1 Adding require_relative of Gateway decorator in attempt to fix inheritance for Gateway::PayPalExpress 2016-08-31 11:32:09 +10:00
Rohan Mitchell
08465a531d Make properties and propertiesOf filters compatible with both products and enterprises 2016-08-26 12:13:48 +10:00
Rohan Mitchell
58e0b95cf6 Show property badges on shops 2016-08-26 12:13:48 +10:00
Rohan Mitchell
7b5e8fa603 Rename API field properties to supplied_properties 2016-08-26 12:13:47 +10:00
Rohan Mitchell
c70993ce75 Find producer properties of items sold by a shop 2016-08-26 12:13:47 +10:00
Rohan Mitchell
aa6e7cba30 Do not return duplicates with Spree::Property.sold_by 2016-08-26 12:13:47 +10:00
Rohan Mitchell
4529ced3f2 Find properties of items sold by a shop 2016-08-26 12:13:47 +10:00
Rohan Mitchell
509564819a Remove FlatPercentPerItem calculator for shipping methods and payment methods to reduce confusion 2016-08-26 10:26:50 +10:00
Rohan Mitchell
24d0e4fcf8 Update specs for calculator change 2016-08-26 09:29:09 +10:00
Rohan Mitchell
308c24caf4 Add FlatPercentPerItem calculator for shipping methods, remove FlatPercentItemTotal for enterprise fees (causes shopfront cart discrepencies). 2016-08-26 09:29:09 +10:00
Rohan Mitchell
10b076562f Make all calculators use FlatPercentPerItem instead of FlatPercentItemTotal 2016-08-26 09:29:09 +10:00
Rohan Mitchell
701c047a0a Move our customisations of FlatPercentItemTotal calculator to a new calc: FlatPercentPerItem 2016-08-26 09:28:29 +10:00
Rohan Mitchell
fa30e28335 Update spec: Our pricing calculations are now consistent between the frontend and backend carts 2016-08-26 09:28:29 +10:00
Rohan Mitchell
5b964ef502 Provide price to calculator to meet new requirements of FlatPercentItemTotal 2016-08-26 09:28:29 +10:00
Rohan Mitchell
b0eebc2e45 Round FlatPercentItemTotal calcs per-item before summing full quantity 2016-08-26 09:28:29 +10:00
Rohan Mitchell
7b2f65a965 Refactor spec so we can have different products in the cart 2016-08-26 09:28:29 +10:00
Rohan Mitchell
0dc12d8791 Parameterise add_product_to_cart spec helper method 2016-08-26 09:28:29 +10:00
Continuous Integration
88b9514090 Merge remote-tracking branch 'origin/master' into HEAD 2016-08-24 11:18:41 +10:00
Bing Xie
e5d7b545c9 I18n and refactoring 2016-08-24 10:43:50 +10:00
Maikel Linke
c4f81b019e Merge branch 'master' of github.com:openfoodfoundation/openfoodnetwork into sign_up_email_i18n 2016-08-19 09:27:17 +10:00
Transifex-Openfoodnetwork
528af8759d Updating translations for config/locales/nb.yml [skip ci] 2016-08-19 01:23:43 +10:00
Maikel Linke
c34e9c046b Remove quotes around url 2016-08-17 16:44:27 +10:00
Transifex-Openfoodnetwork
baeabdd668 Updating translations for config/locales/nb.yml [skip ci] 2016-08-12 19:53:12 +10:00
Transifex-Openfoodnetwork
1de2300099 Updating translations for config/locales/nb.yml [skip ci] 2016-08-12 19:07:43 +10:00
Transifex-Openfoodnetwork
53e8056450 Updating translations for config/locales/fr.yml [skip ci] 2016-08-12 18:56:13 +10:00
Transifex-Openfoodnetwork
5773876cbc Updating translations for config/locales/fr.yml [skip ci] 2016-08-12 17:26:28 +10:00
Bing Xie
ed1f05e674 Show successful message 2016-08-12 16:31:49 +10:00
Bing Xie
98f3e15d87 Updating customer address feature tests 2016-08-12 14:44:59 +10:00
Bing Xie
95c152420c Test customer model updating shipping address 2016-08-12 14:44:59 +10:00
Bing Xie
bdb2b5cce8 Style and i18n the edit address page 2016-08-12 14:44:59 +10:00
Bing Xie
22ccbd5556 Required fields validation 2016-08-12 14:44:59 +10:00
Bing Xie
81d9ec71d9 Front-end updating address function 2016-08-12 14:44:59 +10:00
Bing Xie
45e3f8ab3a Fill the from with model 2016-08-12 14:44:59 +10:00
Bing Xie
5b40c745f3 Add address serializer to customer serializer 2016-08-12 14:44:59 +10:00
Bing Xie
69addf056b Edit customer address form 2016-08-12 14:44:59 +10:00
Bing Xie
34d5df69a5 Fix failed customers controller spec 2016-08-12 14:44:59 +10:00
Bing Xie
d160142945 Make bill address and ship address as nested attributes 2016-08-12 14:44:59 +10:00
Bing Xie
8234956a61 Inject available countries on admin customers page 2016-08-12 14:44:59 +10:00
Bing Xie
225bed9990 Add a simple edit address dialog 2016-08-12 14:44:59 +10:00
Bing Xie
7f203f5491 Show billing address and shipping address on customers index page 2016-08-12 14:44:59 +10:00
Bing Xie
add39f7401 Enterprise user can update customer's name 2016-08-12 14:44:59 +10:00
Bing Xie
ca0c3a028d Add name to customers 2016-08-12 14:44:59 +10:00
Bing Xie
b08a642377 Add billing_address and shipping_address to Customer 2016-08-12 14:44:59 +10:00
Bing Xie
37ace77734 Add bill_address_id and ship_address_id to customers 2016-08-12 14:44:59 +10:00
Maikel Linke
8645144231 Merge remote-tracking branch 'origin/master' into transifex 2016-08-10 21:01:12 +10:00
Rob Harrington
47df8d6d8e Refactoring AngularJS Shop Variant filtering logic for improved speed 2016-08-10 12:08:03 +10:00
Rob Harrington
f9b58b7b90 Ensure bill is > 0 for spec 2016-08-10 12:08:03 +10:00
Rob Harrington
b957555c82 Adding infinite-scroll to the shopfront
For performance improvement with large data sets
2016-08-10 12:08:03 +10:00
Maikel Linke
d40733d447 Add redirects to global site for /connect, /learn 2016-08-07 10:24:07 +10:00
Rohan Mitchell
1f5da8699d Build plz 2016-08-05 15:58:00 +10:00
Rohan Mitchell
fcd422c6ce Fix path helper fail in footer 2016-08-05 15:18:29 +10:00
Rohan Mitchell
5eecdb8c9c Update footer: Link to sell instead of individual register links 2016-08-05 15:03:07 +10:00
Rohan Mitchell
3b0084025a Add copy for home page learn and connect panes 2016-08-05 15:02:44 +10:00
Rohan Mitchell
8f4cbf1d9f Update page alert label and background colour 2016-08-05 15:02:10 +10:00
Rohan Mitchell
0dba54a4b8 Update page alert text 2016-08-05 14:43:44 +10:00
Rohan Mitchell
61c9355ffb Fill in sell page copy 2016-08-05 14:40:42 +10:00
Rohan Mitchell
0830a5bd85 Add basic sell page
Conflicts:
	config/routes.rb
2016-08-05 12:33:09 +10:00
Rohan Mitchell
1054fd2d05 View closed shops by URL 2016-08-03 16:07:15 +10:00
Rohan Mitchell
f03839b70c Update shopping header 2016-08-03 16:07:15 +10:00
Rohan Mitchell
0076b1b9a0 Add connect and learn panes to home page 2016-08-03 16:07:15 +10:00
Rohan Mitchell
d3ab9faede Show registration CTA in footer rather than connect and learn CTA 2016-08-03 16:07:15 +10:00
Rohan Mitchell
ee2c1ef195 Extract home page tagline to partial 2016-08-03 16:07:15 +10:00
Rohan Mitchell
57a2f1b339 Simplify, simplify 2016-08-03 16:07:15 +10:00
Rohan Mitchell
d93d1653db Add directive for smooth scrolling to anchor 2016-08-03 16:07:15 +10:00
Rohan Mitchell
140589fc2d Extract classical backgrounds to mixins 2016-08-03 16:07:15 +10:00
Rohan Mitchell
1216da38d1 Update menu: [Groups, About] -> [Connect, Learn] 2016-08-03 16:07:15 +10:00
Rohan Mitchell
5b43d7a87a Add connect and learn links to page alert 2016-08-03 16:07:15 +10:00
Rohan Mitchell
87e063593a Add feature toggle helper, allow hash or string queries 2016-08-03 16:07:15 +10:00
Rohan Mitchell
23827d6c57 Add feature toggle for Connect+Learn homepage 2016-08-03 16:07:15 +10:00
Rohan Mitchell
e966b474b4 Remove order cycles feature toggle 2016-08-03 16:07:11 +10:00
Rohan Mitchell
1388c077ea Remove unused feature toggles 2016-08-03 12:08:51 +10:00
Transifex-Openfoodnetwork
4d1a5c6ffc Updating translations for config/locales/en_GB.yml [skip ci] 2016-08-01 21:47:34 +10:00
Rohan Mitchell
1586cd3992 Uncache enterprise producer properties - we have no cache invalidation for this 2016-07-29 15:40:24 +10:00
Rohan Mitchell
4db29ce322 Update css_splitter, fixes problem with keyframes spanning limit
https://github.com/zweilove/css_splitter/issues/53
2016-07-29 11:53:46 +10:00
Rohan Mitchell
243dfa7a93 Add retry for intermittently failing spec in variant overrides 2016-07-29 11:01:52 +10:00
Rohan Mitchell
d9d3a4a645 Set up producer filters on group producers page 2016-07-29 11:01:52 +10:00
Rohan Mitchell
b13360d2d0 Extract filter helpers from individual spec to spec helper 2016-07-29 11:01:52 +10:00
Rohan Mitchell
13cf5d29de Add guard for selector overflow (only seen in phantom, not selenium/firefox or dev server/chrome) 2016-07-29 11:01:52 +10:00
Rohan Mitchell
1257ee09f2 Reorder methods for clarity 2016-07-29 11:01:52 +10:00
Rohan Mitchell
e3173c955d Refit filters when box opens 2016-07-29 11:01:51 +10:00
Rohan Mitchell
69382c4c13 Move properties filter dropdown in front of search results 2016-07-29 11:01:51 +10:00
Rohan Mitchell
0b84afd67a Display property filters for producers 2016-07-29 11:01:51 +10:00
Rohan Mitchell
6f947380cb Remove unused overrides and views 2016-07-29 09:18:31 +10:00
Rohan Mitchell
160c535fd7 Update knapsack report 2016-07-29 09:18:30 +10:00
Rohan Mitchell
377074416e Remove CMS tables. Adds migration helper: drop_table_cascade 2016-07-29 09:18:30 +10:00
Rohan Mitchell
932edeb1c1 Remove CMS style shim - Spree/CMS compatibility 2016-07-29 09:18:30 +10:00
Rohan Mitchell
d3ad823d97 Remove CMS configuration, gem. Fix permalink check dependent on CMS glob path. 2016-07-29 09:18:30 +10:00
Rohan Mitchell
b637b5b75a Remove CMS helper: home_page_cms_content 2016-07-29 09:14:36 +10:00
Rohan Mitchell
eb8cedc497 Remove CMS views and overrides 2016-07-29 09:14:36 +10:00
Rohan Mitchell
ba854d12c8 Remove CMS specs 2016-07-29 09:14:36 +10:00
Lynne Davis
9e03a130c2 Updating GB translation, from transifex 2016-07-27 18:43:48 +01:00
Maikel Linke
dee0fa6724 Trigger checkout click more reliably in specs 2016-07-22 14:10:16 +10:00
Maikel Linke
84c434c279 Remove unused/broken multi-cart feature and views
This removes ten old overrides of the Spree view. Since the Spree view
is not used any more and got completely replaced by custom views, the
overrides were just adding noise to the code base.
2016-07-22 13:49:20 +10:00
Transifex-Openfoodnetwork
f8898bc722 Updating translations for config/locales/nb.yml [skip ci] 2016-07-22 01:04:58 +10:00
Transifex-Openfoodnetwork
2b7da4738c Updating translations for config/locales/nb.yml [skip ci] 2016-07-22 00:59:57 +10:00
Maikel Linke
11a702667d Merge branch 'transifex' into HEAD 2016-07-20 17:12:59 +10:00
Maikel Linke
11ec903131 Merge tag 'v1.8.3' into transifex 2016-07-20 17:11:42 +10:00
Maikel Linke
e57c06c610 Use require_relative introduced in Ruby 1.9.2
The new `require_relative` command is much shorter and easier to read
then the previous:

    -require File.expand_path('../config/application', __FILE__)
    +require_relative 'config/application'
2016-07-20 16:07:35 +10:00
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
Transifex-Openfoodnetwork
477d48e9da Updating translations for config/locales/nb.yml [skip ci] 2016-07-15 19:46:47 +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
c6bd548413 Don't trigger deployment for transifex branch 2016-07-15 11:19:19 +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
b587a72eb6 Auto-merged master into transifex on deployment. 2016-07-12 17:44:55 +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
Continuous Integration
5fb5ef1974 Auto-merge from CI [skip ci] 2016-07-02 00:58:27 +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
12df5de43c Auto-merged master into sign_up_email_i18n on deployment. 2016-06-24 00:45:34 +10:00
Lynne
4da7668dfc Merge pull request #1048 from lin-d-hop/sign_up_email_i18n
code cleanup
2016-06-23 15:30:42 +01:00
Lynne Davis
9c29e56fc3 More typo 2016-06-21 17:44:45 +01:00
Lynne Davis
e253590c1c code cleanup 2016-06-21 17:07:42 +01:00
Lynne
43b5216002 Merge pull request #1046 from lin-d-hop/sign_up_email_i18n
Sign up email i18n
2016-06-20 18:45:31 +01:00
Lynne Davis
e7adacc541 Typo 2016-06-20 18:34:54 +01:00
Lynne Davis
fa52712e35 More syntax fixes 2016-06-20 18:32:32 +01:00
Lynne
36093c0f64 Merge pull request #1045 from lin-d-hop/sign_up_email_i18n
Sign up email i18n
Merging so that I can test emails on UK staging.
2016-06-20 17:29:37 +01:00
Lynne Davis
02d8f52426 Fixing syntax 2016-06-20 17:02:10 +01:00
Lynne Davis
5b22e19ec9 Undoing locale changes accidentally committed 2016-06-20 15:24:24 +01:00
Lynne Davis
99d22649a2 Undoing this change, shouldn't be on this branch 2016-06-20 15:21:34 +01:00
Lynne Davis
98548e15c5 I18n of enterprise emails 2016-06-20 15:18:25 +01:00
Lynne Davis
f37f89dd07 Adding Community forum to ContentConfig 2016-06-20 15:13:49 +01:00
Lynne Davis
ed37604bc2 Update from address in notification emails 2016-06-18 09:09:43 +01: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 &nbsp; 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
Maikel Linke
587d06dced Merge remote-tracking branch 'origin/master' into groups
Conflicts:
	db/schema.rb
2016-03-02 15:31:35 +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
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
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
stveep
83d248469f Running balances 2016-02-16 20:32:09 +00: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
Transifex-Openfoodnetwork
e551a6b9f5 Updating translations for fr.yml and nb.yml 2016-01-29 14:18:48 +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
Steve Pettitt
aa8457c40f Fix order serializer spec: change from id to number 2016-01-26 19:03:19 +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
Continuous Integration
e070168c4a Auto-merge from CI [skip ci] 2016-01-15 03:30:02 +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
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
stveep
6992d66202 Add payments data, reformat dates 2016-01-01 09:37:21 -05: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
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
1083 changed files with 34599 additions and 11338 deletions

View File

@@ -1,6 +1,9 @@
engines:
rubocop:
enabled: true
exclude_fingerprints:
- ac41db8d4ec4cbf508c353d9b65a024f
- 8e3b6322aef5be9f38700b3fd0cd347e
scss-lint:
enabled: true
ratings:

1
.gitignore vendored
View File

@@ -39,3 +39,4 @@ NERD_tree*
coverage
libpeerconnection.log
/config/application.yml
node_modules

View File

@@ -26,23 +26,26 @@ before_script:
- cp config/database.travis.yml config/database.yml
- 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 karma@0.12.31
npm install karma-jasmine@0.1.5
npm install karma-phantomjs-launcher@0.1.4
npm install karma-coffee-preprocessor@0.2.1
npm install -g karma-cli@0.0.4
npm install -g npm@'3.8.8'
npm install
npm install -g karma-cli@0.1.2
fi
script:
- '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"
- "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
if [ "$GITHUB_DEPLOY" = "true" -a "$TRAVIS_PULL_REQUEST" = "false" -a -n "$TRAVIS_BRANCH" -a "$TRAVIS_BRANCH" != "transifex" -a -n "$GITHUB_API_SECRET" ]; then
description="`git show "$TRAVIS_BRANCH" -s --oneline --no-color`"
data="{
\"ref\":\"$TRAVIS_BRANCH\",

21
Gemfile
View File

@@ -5,28 +5,29 @@ gem 'rails', '3.2.21'
gem 'rails-i18n', '~> 3.0.0'
gem 'i18n', '~> 0.6.11'
gem 'nokogiri'
# Patched version. See http://rubysec.com/advisories/CVE-2015-5312/.
gem 'nokogiri', '>= 1.6.7.1'
gem 'pg'
gem 'spree', github: 'openfoodfoundation/spree', branch: '1-3-stable'
gem 'spree', github: 'openfoodfoundation/spree', branch: 'spree-upgrade-step1c'
gem 'spree_i18n', github: 'spree/spree_i18n', branch: '1-3-stable'
gem 'spree_auth_devise', github: 'spree/spree_auth_devise', branch: '1-3-stable'
# 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"
# 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'
gem 'daemons'
gem 'comfortable_mexican_sofa'
# Fix bug in simple_form preventing collection_check_boxes usage within form_for block
# When merged, revert to upstream gem
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'
@@ -49,18 +50,20 @@ gem 'gmaps4rails'
gem 'spinjs-rails'
gem 'rack-ssl', :require => 'rack/ssl'
gem 'custom_error_message', :github => 'jeremydurham/custom-err-msg'
gem 'angularjs-file-upload-rails', '~> 1.1.0'
gem 'angularjs-file-upload-rails', '~> 1.1.6'
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'
gem 'roo', '~> 2.7.0'
gem 'whenever', require: false
@@ -85,8 +88,10 @@ gem "foundation-rails"
gem 'foundation_rails_helper', github: 'willrjmarshall/foundation_rails_helper', branch: "rails3"
gem 'jquery-rails'
gem 'jquery-migrate-rails'
gem 'css_splitter'
gem 'ofn-qz', github: 'openfoodfoundation/ofn-qz'
group :test, :development do
# Pretty printed test output

View File

@@ -14,54 +14,64 @@ 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)
spree_core (~> 1.3.4)
GIT
remote: git://github.com/openfoodfoundation/spree.git
revision: 6e3edfe40a5de8eba0095b2c5f3db9ea54c3afda
branch: 1-3-stable
remote: git://github.com/openfoodfoundation/ofn-qz.git
revision: 024680ccea429b2e5428d7b964fa67c52add34ec
specs:
spree (1.3.6.beta)
spree_api (= 1.3.6.beta)
spree_cmd (= 1.3.6.beta)
spree_core (= 1.3.6.beta)
spree_promo (= 1.3.6.beta)
spree_sample (= 1.3.6.beta)
spree_api (1.3.6.beta)
spree_core (= 1.3.6.beta)
ofn-qz (0.1.0)
railties (~> 3.1)
GIT
remote: git://github.com/openfoodfoundation/spree.git
revision: a4c439570b77afa50f9e36299811f293232bd281
branch: spree-upgrade-step1c
specs:
spree (1.3.99)
spree_api (= 1.3.99)
spree_cmd (= 1.3.99)
spree_core (= 1.3.99)
spree_dash (= 1.3.99)
spree_promo (= 1.3.99)
spree_sample (= 1.3.99)
spree_api (1.3.99)
spree_core (= 1.3.99)
versioncake (= 0.4.0)
spree_cmd (1.3.6.beta)
spree_cmd (1.3.99)
thor (>= 0.14.6)
spree_core (1.3.6.beta)
activemerchant (~> 1.34)
spree_core (1.3.99)
activemerchant (~> 1.50.0)
acts_as_list (= 0.1.4)
awesome_nested_set (= 2.1.5)
aws-sdk (~> 1.11.1)
cancan (= 1.6.8)
deface (>= 0.9.0)
ffaker (~> 1.15.0)
highline (= 1.6.18)
jquery-rails (~> 2.2.0)
highline (= 1.6.11)
jquery-rails (~> 2.0)
json (>= 1.5.5)
kaminari (= 0.14.1)
money (= 5.1.1)
kaminari (= 0.13.0)
money (= 5.0.0)
paperclip (~> 3.0)
rabl (= 0.7.2)
rails (~> 3.2.16)
rails (~> 3.2.13)
ransack (= 0.7.2)
select2-rails (= 3.5.9.3)
state_machine (= 1.1.2)
select2-rails (~> 3.2)
state_machine (= 1.2.0)
stringex (~> 1.3.2)
truncate_html (~> 0.5.5)
spree_promo (1.3.6.beta)
spree_core (= 1.3.6.beta)
spree_sample (1.3.6.beta)
spree_core (= 1.3.6.beta)
spree_dash (1.3.99)
httparty (~> 0.8.1)
spree_core (= 1.3.99)
spree_promo (1.3.99)
spree_core (= 1.3.99)
spree_sample (1.3.99)
spree_core (= 1.3.99)
GIT
remote: git://github.com/spree/deface.git
@@ -121,11 +131,10 @@ GEM
rack-cache (~> 1.2)
rack-test (~> 0.6.1)
sprockets (~> 2.2.1)
active_link_to (1.0.0)
active_model_serializers (0.8.3)
activemodel (>= 3.0)
activemerchant (1.57.0)
activesupport (>= 3.2.14, < 5.1)
activemerchant (1.50.0)
activesupport (>= 3.2.14, < 5.0.0)
builder (>= 2.1.2, < 4.0.0)
i18n (>= 0.6.9)
nokogiri (~> 1.4)
@@ -152,8 +161,8 @@ GEM
railties (>= 3.1)
sprockets (~> 2)
tilt
angularjs-file-upload-rails (1.1.0)
angularjs-rails (1.2.13)
angularjs-file-upload-rails (1.1.6)
angularjs-rails (1.5.5)
ansi (1.4.2)
arel (3.0.3)
atomic (1.1.99)
@@ -168,15 +177,14 @@ GEM
bcrypt-ruby (3.1.5)
bcrypt (>= 3.1.3)
blockenspiel (0.4.5)
bugsnag (1.5.2)
httparty (>= 0.6, < 1.0)
multi_json (~> 1.0)
bugsnag (4.1.0)
builder (3.0.4)
byebug (2.7.0)
columnize (~> 0.3)
debugger-linecache (~> 1.2)
cancan (1.6.8)
capybara (2.5.0)
capybara (2.7.1)
addressable
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
@@ -189,7 +197,7 @@ GEM
climate_control (0.0.3)
activesupport (>= 3.0)
cliver (0.3.2)
cocaine (0.5.7)
cocaine (0.5.8)
climate_control (>= 0.0.3, < 1.0)
coderay (1.0.9)
coffee-rails (3.2.2)
@@ -201,10 +209,6 @@ GEM
coffee-script-source (1.10.0)
colorize (0.7.7)
columnize (0.9.0)
comfortable_mexican_sofa (1.6.24)
active_link_to (~> 1.0.0)
paperclip (>= 2.3.0)
rails (>= 3.0.0)
compass (1.0.3)
chunky_png (~> 1.2)
compass-core (~> 1.0.2)
@@ -225,7 +229,7 @@ GEM
safe_yaml (~> 0.9.0)
css_parser (1.3.5)
addressable
css_splitter (0.4.1)
css_splitter (0.4.5)
sprockets (>= 2.0.0)
daemons (1.2.2)
dalli (2.7.2)
@@ -248,6 +252,7 @@ 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)
@@ -407,12 +412,12 @@ GEM
zeus
haml (4.0.4)
tilt
highline (1.6.18)
highline (1.6.11)
hike (1.2.3)
http_parser.rb (0.5.3)
httparty (0.13.1)
json (~> 1.8)
multi_xml (>= 0.5.2)
httparty (0.8.3)
multi_json (~> 1.0)
multi_xml
i18n (0.6.11)
immigrant (0.1.6)
activerecord (>= 3.0)
@@ -420,16 +425,18 @@ GEM
inflecto (0.0.2)
ipaddress (0.8.0)
journey (1.0.4)
jquery-rails (2.2.2)
jquery-migrate-rails (1.2.1)
jquery-rails (2.3.0)
railties (>= 3.0, < 5.0)
thor (>= 0.14, < 2.0)
json (1.8.3)
json_spec (1.1.1)
multi_json (~> 1.0)
rspec (~> 2.0)
kaminari (0.14.1)
kaminari (0.13.0)
actionpack (>= 3.0.0)
activesupport (>= 3.0.0)
railties (>= 3.0.0)
kgio (2.9.3)
knapsack (1.5.1)
rake
@@ -449,16 +456,17 @@ 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.2)
money (5.0.0)
i18n (~> 0.4)
json
multi_json (1.12.1)
multi_xml (0.5.5)
newrelic_rpm (3.12.0.288)
nokogiri (1.6.6.4)
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)
@@ -478,7 +486,7 @@ GEM
paypal-sdk-merchant (1.106.1)
paypal-sdk-core (~> 0.2.3)
pg (0.13.2)
poltergeist (1.7.0)
poltergeist (1.9.0)
capybara (~> 2.1)
cliver (~> 0.3.1)
multi_json (~> 1.0)
@@ -497,7 +505,7 @@ GEM
activesupport (>= 2.3.14)
multi_json (~> 1.0)
rack (1.4.7)
rack-cache (1.2)
rack-cache (1.6.1)
rack (>= 0.4)
rack-livereload (0.3.15)
rack
@@ -524,7 +532,7 @@ GEM
rdoc (~> 3.4)
thor (>= 0.14.6, < 2.0)
raindrops (0.13.0)
rake (10.4.2)
rake (11.1.2)
ransack (0.7.2)
actionpack (~> 3.0)
activerecord (~> 3.0)
@@ -550,6 +558,9 @@ GEM
roadie-rails (1.0.3)
rails (>= 3.0, < 4.2)
roadie (~> 3.0)
roo (2.7.1)
nokogiri (~> 1)
rubyzip (~> 1.1, < 2.0.0)
rspec (2.14.1)
rspec-core (~> 2.14.0)
rspec-expectations (~> 2.14.0)
@@ -568,13 +579,14 @@ GEM
rspec-retry (0.4.2)
rspec-core
ruby-progressbar (1.7.1)
rubyzip (1.2.0)
safe_yaml (0.9.5)
sass (3.3.14)
sass-rails (3.2.6)
railties (~> 3.2.0)
sass (>= 3.1.10)
tilt (~> 1.3)
select2-rails (3.5.9.3)
select2-rails (3.5.10)
thor (~> 0.14)
shoulda-matchers (1.1.0)
activesupport (>= 3.0.0)
@@ -586,14 +598,14 @@ GEM
multi_json (~> 1.0)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
state_machine (1.1.2)
state_machine (1.2.0)
stringex (1.3.3)
therubyracer (0.12.0)
libv8 (~> 3.16.14.0)
ref
thor (0.19.1)
tilt (1.4.1)
timecop (0.6.2.2)
timecop (0.8.1)
timers (1.1.0)
treetop (1.4.15)
polyglot
@@ -604,7 +616,7 @@ GEM
sprockets (>= 2.0.0)
turn (0.8.3)
ansi
tzinfo (0.3.44)
tzinfo (0.3.49)
uglifier (2.7.1)
execjs (>= 0.3.0)
json (>= 1.8.0)
@@ -625,15 +637,14 @@ GEM
webmock (1.13.0)
addressable (>= 2.2.7)
crack (>= 0.3.2)
websocket-driver (0.6.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)
wicked_pdf (1.1.0)
wkhtmltopdf-binary (0.12.3.1)
xml-simple (1.1.4)
xpath (2.0.0)
nokogiri (~> 1.3)
@@ -648,8 +659,8 @@ DEPENDENCIES
acts-as-taggable-on (~> 3.4)
andand
angular-rails-templates (~> 0.2.0)
angularjs-file-upload-rails (~> 1.1.0)
angularjs-rails (= 1.2.13)
angularjs-file-upload-rails (~> 1.1.6)
angularjs-rails (= 1.5.5)
atomic
awesome_print
aws-sdk
@@ -657,7 +668,6 @@ DEPENDENCIES
bugsnag
capybara
coffee-rails (~> 3.2.1)
comfortable_mexican_sofa
compass-rails
css_splitter
custom_error_message!
@@ -668,6 +678,7 @@ DEPENDENCIES
debugger-linecache
deface!
delayed_job_active_record
diffy
factory_girl_rails
figaro
foreigner
@@ -685,13 +696,15 @@ DEPENDENCIES
haml
i18n (~> 0.6.11)
immigrant
jquery-migrate-rails
jquery-rails
json_spec
knapsack
letter_opener
momentjs-rails
newrelic_rpm
nokogiri
nokogiri (>= 1.6.7.1)
ofn-qz!
oj
paper_trail (~> 3.0.8)
paperclip
@@ -707,6 +720,7 @@ DEPENDENCIES
redcarpet
representative_view
roadie-rails (~> 1.0.3)
roo (~> 2.7.0)
rspec-rails
rspec-retry
sass (~> 3.3)
@@ -730,3 +744,9 @@ DEPENDENCIES
whenever
wicked_pdf
wkhtmltopdf-binary
RUBY VERSION
ruby 2.1.5p273
BUNDLED WITH
1.14.3

View File

@@ -98,6 +98,14 @@ The site is configured to use
startup time while Rails loads. See the Zeus github page for
usage instructions.
Once [npm dependencies are
installed](https://github.com/openfoodfoundation/openfoodnetwork/wiki/Karma), AngularJS tests can be run with:
./script/karma run
If you want karma to automatically rerun the tests on file modification, use:
./script/karma start
## Credits

View File

@@ -2,7 +2,7 @@
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require File.expand_path('../config/application', __FILE__)
require_relative 'config/application'
Openfoodnetwork::Application.load_tasks

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

BIN
app/assets/images/select2.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 881 B

BIN
app/assets/images/select2x2.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 928 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 112 KiB

After

Width:  |  Height:  |  Size: 54 KiB

View File

@@ -6,6 +6,7 @@
//
//= require jquery
//= require jquery-migrate-min
//= require jquery_ujs
//= require jquery-ui
//= require shared/jquery-ui-timepicker-addon
@@ -36,14 +37,19 @@
//= require ./order_cycles/order_cycles
//= require ./payment_methods/payment_methods
//= require ./products/products
//= require ./resources/resources
//= 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 ./variant_overrides/variant_overrides
//= require textAngular.min.js
//= 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,222 +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.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
line_item.original_final_weight_volume = line_item.final_weight_volume
line_item.original_quantity = line_item.quantity
line_item.original_price = line_item.price
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.submit = ->
if $scope.bulk_order_form.$valid
pendingChanges.submitAll()
else
alert "Some errors must be resolved be before you can update orders.\nAny fields with red borders contain errors."
$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.final_weight_volume
, 0
$scope.sumMaxUnitValues = ->
sum = $scope.filteredLineItems.reduce (sum,lineItem) ->
sum = sum + Math.max(lineItem.max_quantity,lineItem.original_quantity) * lineItem.units_variant.unit_value
, 0
$scope.allFinalWeightVolumesPresent = ->
for i,lineItem of $scope.filteredLineItems
return false if !lineItem.hasOwnProperty('final_weight_volume') || !(lineItem.final_weight_volume > 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) ->
if lineItem.final_weight_volume > 0
unit_value = lineItem.final_weight_volume / lineItem.quantity
original_unit_value = lineItem.original_final_weight_volume / lineItem.original_quantity
lineItem.price = lineItem.original_price * (unit_value / original_unit_value)
$scope.unitValueLessThanZero = (lineItem) ->
if lineItem.units_variant.unit_value <= 0
true
else
false
$scope.updateOnQuantity = (lineItem) ->
if lineItem.quantity > 0
lineItem.final_weight_volume = lineItem.original_final_weight_volume * lineItem.quantity / lineItem.original_quantity
$scope.weightAdjustedPrice(lineItem)
$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,39 +1,28 @@
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
$scope.taxons = Taxons.taxons
$scope.taxons = Taxons.all
$scope.tax_categories = tax_categories
$scope.filterProducers = [{id: "0", name: ""}].concat $scope.producers
$scope.filterTaxons = [{id: "0", name: ""}].concat $scope.taxons
@@ -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) ->

View File

@@ -9,6 +9,10 @@ angular.module("admin.businessModelConfiguration").controller "BusinessModelConf
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"
@@ -18,4 +22,4 @@ angular.module("admin.businessModelConfiguration").controller "BusinessModelConf
($scope.cappedBill() * Number($scope.taxRate))
$scope.total = ->
$scope.cappedBill() + $scope.includedTax()
$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,17 +1,48 @@
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, availableCountries) ->
$scope.shops = shops
$scope.availableCountries = availableCountries
$scope.RequestMonitor = RequestMonitor
$scope.submitAll = pendingChanges.submitAll
$scope.customerLimit = 20
$scope.customers = Customers.all
$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.loaded = ->
Customers.loaded
$scope.shop_id = shops[0].id if shops.length == 1
$scope.deleteCustomer = (customer) ->
if confirm(t('admin.customers.index.confirm_delete'))
Customers.remove(customer)
$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,36 @@
angular.module("admin.customers").directive 'editAddressDialog', ($compile, $templateCache, $filter, DialogDefaults, Customers, StatusMessage) ->
restrict: 'A'
scope: true
link: (scope, element, attr) ->
scope.errors = []
scope.$watch 'address.country_id', (newVal) ->
if newVal
scope.states = scope.filter_states(newVal)
scope.updateAddress = ->
scope.edit_address_form.$setPristine()
if scope.edit_address_form.$valid
Customers.update(scope.address, scope.customer, scope.addressType).$promise.then (data) ->
scope.customer = data
template.dialog('close')
StatusMessage.display('success', t('admin.customers.index.update_address_success'))
else
scope.errors.push(t('admin.customers.index.update_address_error'))
template = $compile($templateCache.get('admin/edit_address_dialog.html'))(scope)
template.dialog(DialogDefaults)
element.bind 'click', (e) ->
if e.target.id == 'bill-address-link'
scope.addressType = 'bill_address'
else
scope.addressType = 'ship_address'
scope.address = scope.customer[scope.addressType]
template.dialog('open')
scope.$apply()
scope.filter_states = (countryID) ->
$filter('filter')(scope.availableCountries, {id: countryID})[0].states

View File

@@ -0,0 +1,38 @@
angular.module("admin.customers").directive 'newCustomerDialog', ($compile, $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 +0,0 @@
angular.module("admin.customers").factory 'CustomerResource', ($resource) ->
$resource('/admin/customers.json', {}, {
'index':
method: 'GET'
isArray: true
params:
enterprise_id: '@enterprise_id'
})

View File

@@ -1,16 +0,0 @@
angular.module("admin.customers").factory 'Customers', (CustomerResource) ->
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
@loaded = true
(callback || angular.noop)(@customers)
@customers

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

@@ -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

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

View File

@@ -4,12 +4,12 @@ angular.module("admin.enterprise_groups")
$scope.select = SideMenu.select
$scope.menu.setItems [
{ name: 'Primary Details', icon_class: "icon-user" }
{ name: 'Users', icon_class: "icon-user" }
{ name: 'About', icon_class: "icon-pencil" }
{ name: 'Images', icon_class: "icon-picture" }
{ name: 'Contact', icon_class: "icon-phone" }
{ name: 'Web', icon_class: "icon-globe" }
{ name: 'primary_details', label: t('primary_details'), icon_class: "icon-user" }
{ name: 'users', label: t('users'), icon_class: "icon-user" }
{ name: 'about', label: t('about'), icon_class: "icon-pencil" }
{ name: 'images', label: t('images'), icon_class: "icon-picture" }
{ name: 'contact', label: t('admin_entreprise_groups_contact'), icon_class: "icon-phone" }
{ name: 'web', label: t('admin_entreprise_groups_web'), icon_class: "icon-globe" }
]
$scope.select(0)

View File

@@ -1,19 +1,35 @@
angular.module("admin.enterprises")
.controller "enterpriseCtrl", ($scope, NavigationCheck, enterprise, EnterprisePaymentMethods, EnterpriseShippingMethods, SideMenu) ->
.controller "enterpriseCtrl", ($scope, $window, NavigationCheck, enterprise, EnterprisePaymentMethods, EnterpriseShippingMethods, SideMenu, StatusMessage) ->
$scope.Enterprise = enterprise
$scope.PaymentMethods = EnterprisePaymentMethods.paymentMethods
$scope.ShippingMethods = EnterpriseShippingMethods.shippingMethods
$scope.navClear = NavigationCheck.clear
$scope.pristineEmail = $scope.Enterprise.email
$scope.menu = SideMenu
$scope.newManager = { id: '', email: 'Add a manager...' }
$scope.newManager = { id: '', email: (t('add_manager')) }
$scope.StatusMessage = StatusMessage
$scope.$watch 'enterprise_form.$dirty', (newValue) ->
StatusMessage.display 'notice', t('admin.unsaved_changes') if newValue
$scope.setFormDirty = ->
$scope.$apply ->
$scope.enterprise_form.$setDirty()
$scope.cancel = (destination) ->
$window.location = destination
$scope.submit = ->
$scope.navClear()
enterprise_form.submit()
# Provide a callback for generating warning messages displayed before leaving the page. This is passed in
# from a directive "nav-check" in the page - if we pass it here it will be called in the test suite,
# and on all new uses of this contoller, and we might not want that .
# and on all new uses of this contoller, and we might not want that.
enterpriseNavCallback = ->
if $scope.Enterprise.$dirty
"Your changes to the enterprise are not saved yet."
if $scope.enterprise_form.$dirty
t('admin.unsaved_confirm_leave')
# Register the NavigationCheck callback
NavigationCheck.register(enterpriseNavCallback)
@@ -22,6 +38,8 @@ angular.module("admin.enterprises")
if manager.id?
for i, user of $scope.Enterprise.users when user.id == manager.id
$scope.Enterprise.users.splice i, 1
if $scope.enterprise_form?
$scope.enterprise_form.$setDirty()
$scope.addManager = (manager) ->
if manager.id? and manager.email?
@@ -31,4 +49,4 @@ angular.module("admin.enterprises")
if (user for user in $scope.Enterprise.users when user.id == manager.id).length == 0
$scope.Enterprise.users.push manager
else
alert "#{manager.email} is already a manager!"
alert ("#{manager.email}" + " " + t("is_already_manager"))

View File

@@ -1,49 +0,0 @@
angular.module("admin.enterprises").controller "EnterpriseIndexRowCtrl", ($scope) ->
$scope.status = ->
if $scope.enterprise.issues.length > 0
"issue"
else if $scope.enterprise.warnings.length > 0
"warning"
else
"ok"
$scope.producerText = ->
switch $scope.enterprise.is_primary_producer
when true
"Producer"
else
"Non-Producer"
$scope.packageText = ->
switch $scope.enterprise.is_primary_producer
when true
switch $scope.enterprise.sells
when "none"
"Profile"
when "own"
"Shop"
when "any"
"Hub"
else
"Choose"
else
switch $scope.enterprise.sells
when "none"
"Profile"
when "any"
"Hub"
else
"Choose"
$scope.updateRowText = ->
$scope.producer = $scope.producerText()
$scope.package = $scope.packageText()
$scope.producerError = ($scope.producer == "Choose")
$scope.packageError = ($scope.package == "Choose")
$scope.updateRowText()
$scope.$on "enterprise:updated", ->
$scope.updateRowText()

View File

@@ -3,11 +3,54 @@ angular.module("admin.enterprises").controller 'enterprisesCtrl', ($scope, $q, E
requests.push ($scope.allEnterprises = Enterprises.index(ams_prefix: "index")).$promise
$q.all(requests).then ->
$scope.updateStaticFieldsFor(enterprise) for enterprise in $scope.allEnterprises
$scope.loaded = true
$scope.columns = Columns.setColumns
name: { name: "Name", visible: true }
producer: { name: "Producer", visible: true }
package: { name: "Package", visible: true }
status: { name: "Status", visible: true }
manage: { name: "Manage", visible: true }
$scope.columns = Columns.columns
$scope.updateStaticFieldsFor = (enterprise) ->
enterprise.producer = $scope.producerTextFor(enterprise)
enterprise.package = $scope.packageTextFor(enterprise)
enterprise.producerError = (enterprise.producer == "Choose")
enterprise.packageError = (enterprise.package == "Choose")
enterprise.status = $scope.statusFor(enterprise)
$scope.$on "enterprise:updated", (event, enterprise) ->
$scope.updateStaticFieldsFor(enterprise)
$scope.statusFor = (enterprise) ->
if enterprise.issues.length > 0
"issue"
else if enterprise.warnings.length > 0
"warning"
else
"ok"
$scope.producerTextFor = (enterprise) ->
switch enterprise.is_primary_producer
when true
"Producer"
else
"Non-Producer"
$scope.packageTextFor = (enterprise) ->
switch enterprise.is_primary_producer
when true
switch enterprise.sells
when "none"
"Profile"
when "own"
"Shop"
when "any"
"Hub"
else
"Choose"
else
switch enterprise.sells
when "none"
"Profile"
when "any"
"Hub"
else
"Choose"

View File

@@ -9,7 +9,7 @@ angular.module("admin.enterprises").controller 'indexPanelCtrl', ($scope, Enterp
unless $scope.saved()
$scope.saving = true
Enterprises.save($scope.enterprise).then (data) ->
$scope.$emit("enterprise:updated")
$scope.$emit("enterprise:updated", $scope.enterprise)
$scope.saving = false
, (response) ->
$scope.saving = false

View File

@@ -5,25 +5,25 @@ angular.module("admin.enterprises")
$scope.select = SideMenu.select
$scope.menu.setItems [
{ name: 'Primary Details', icon_class: "icon-home" }
{ name: 'Users', icon_class: "icon-user" }
{ name: 'Address', icon_class: "icon-map-marker" }
{ name: 'Contact', icon_class: "icon-phone" }
{ name: 'Social', icon_class: "icon-twitter" }
{ name: 'About', icon_class: "icon-pencil" }
{ name: 'Business Details', icon_class: "icon-briefcase" }
{ name: 'Images', icon_class: "icon-picture" }
{ name: "Properties", icon_class: "icon-tags", show: "showProperties()" }
{ name: "Shipping Methods", icon_class: "icon-truck", show: "showShippingMethods()" }
{ name: "Payment Methods", icon_class: "icon-money", show: "showPaymentMethods()" }
{ name: "Enterprise Fees", icon_class: "icon-tasks", show: "showEnterpriseFees()" }
{ name: "Inventory Settings", icon_class: "icon-list-ol", show: "showInventorySettings()" }
{ name: "Shop Preferences", icon_class: "icon-shopping-cart", show: "showShopPreferences()" }
{ name: 'primary_details', label: t('primary_details'), icon_class: "icon-home" }
{ name: 'address', label: t('address'), icon_class: "icon-map-marker" }
{ name: 'contact', label: t('contact'), icon_class: "icon-phone" }
{ name: 'social', label: t('social'), icon_class: "icon-twitter" }
{ name: 'about', label: t('about'), icon_class: "icon-pencil" }
{ name: 'business_details', label: t('business_details'), icon_class: "icon-briefcase" }
{ name: 'images', label: t('images'), icon_class: "icon-picture" }
{ name: 'properties', label: t('properties'), icon_class: "icon-tags", show: "showProperties()" }
{ name: 'shipping_methods', label: t('shipping_methods'), icon_class: "icon-truck", show: "showShippingMethods()" }
{ name: 'payment_methods', label: t('payment_methods'), icon_class: "icon-money", show: "showPaymentMethods()" }
{ name: 'enterprise_fees', label: t('enterprise_fees'), icon_class: "icon-tasks", show: "showEnterpriseFees()" }
{ name: 'inventory_settings', label: t('inventory_settings'), icon_class: "icon-list-ol", show: "enterpriseIsShop()" }
{ name: 'tag_rules', label: t('tag_rules'), icon_class: "icon-random", show: "enterpriseIsShop()" }
{ name: 'shop_preferences', label: t('shop_preferences'), icon_class: "icon-shopping-cart", show: "enterpriseIsShop()" }
{ name: 'users', label: t('users'), icon_class: "icon-user" }
]
$scope.select(0)
$scope.showItem = (item) ->
if item.show?
$parse(item.show)($scope)
@@ -42,8 +42,5 @@ angular.module("admin.enterprises")
$scope.showEnterpriseFees = ->
enterprisePermissions.can_manage_enterprise_fees && ($scope.Enterprise.sells != "none" || $scope.Enterprise.is_primary_producer)
$scope.showInventorySettings = ->
$scope.Enterprise.sells != "none"
$scope.showShopPreferences = ->
$scope.enterpriseIsShop = ->
$scope.Enterprise.sells != "none"

View File

@@ -0,0 +1,16 @@
angular.module('admin.enterprises').directive 'enterpriseSwitcher', (NavigationCheck) ->
restrict: 'A'
require: 'ngModel'
link: (scope, element, attr, ngModel) ->
initial = element[0].getAttribute('data-initial')
element.on 'change', ->
if not NavigationCheck.confirmLeave()
# Reset the current dropdown selection if staying on page
ngModel.$setViewValue initial
ngModel.$render()
element.select2 'val', initial
return
NavigationCheck.clear() # Don't ask twice if leaving
window.location = element[0].querySelector('option[selected]').getAttribute('data-url')

View File

@@ -1 +1 @@
angular.module("admin.enterprises", [
angular.module("admin.enterprises", [

View File

@@ -1,8 +0,0 @@
angular.module("admin.enterprises").factory 'EnterpriseResource', ($resource) ->
$resource('/admin/enterprises/:id/:action.json', {}, {
'index':
method: 'GET'
isArray: true
'update':
method: 'PUT'
})

View File

@@ -15,7 +15,7 @@ angular.module("admin.indexUtils").directive "objForUpdate", (switchClass, pendi
object: scope.object()
type: scope.type
attr: scope.attr
value: value
value: if value? then value else ""
scope: scope
scope.pending()
pendingChanges.add(scope.object().id, scope.attr, change)
@@ -24,7 +24,7 @@ angular.module("admin.indexUtils").directive "objForUpdate", (switchClass, pendi
scope.savedValue = value
scope.success = ->
switchClass( element, "update-success", ["update-pending", "update-error"], 3000 )
switchClass( element, "update-success", ["update-pending", "update-error"], 5000 )
scope.pending = ->
switchClass( element, "update-pending", ["update-error", "update-success"], false )

View File

@@ -1,26 +1,26 @@
angular.module("admin.indexUtils").directive "ofnSelect2", ($sanitize, $timeout) ->
angular.module("admin.indexUtils").directive "ofnSelect2", ($sanitize, $timeout, $filter) ->
require: 'ngModel'
restrict: 'C'
scope:
data: "="
minSearch: "@?"
text: "@?"
minSearch: "@"
text: "@"
blank: "=?"
filter: "=?"
onSelecting: "=?"
multiple: '@'
link: (scope, element, attrs, ngModel) ->
$timeout ->
scope.text ||= 'name'
scope.data.unshift(scope.blank) if scope.blank? && typeof scope.blank is "object"
scope.text ?= 'name'
scope.multiple ?= false
scope.filter ?= -> true
item.name = $sanitize(item.name) for item in scope.data
element.select2
minimumResultsForSearch: scope.minSearch || 0
data: { results: scope.data, text: scope.text }
initSelection: (element, callback) ->
callback scope.data[0]
formatSelection: (item) ->
item[scope.text]
formatResult: (item) ->
item[scope.text]
if scope.data.$promise
scope.data.$promise.then -> init()
else
init()
element.on "select2-opening", scope.onSelecting || angular.noop
attrs.$observe 'disabled', (value) ->
element.select2('enable', !value)
@@ -28,3 +28,22 @@ angular.module("admin.indexUtils").directive "ofnSelect2", ($sanitize, $timeout)
ngModel.$formatters.push (value) ->
element.select2('val', value)
value
ngModel.$parsers.push (value) ->
return value.split(",") if scope.multiple
value
init = ->
scope.data.unshift(scope.blank) if scope.blank? && typeof scope.blank is "object"
item.name = $sanitize(item.name) for item in scope.data
element.select2
multiple: scope.multiple
minimumResultsForSearch: scope.minSearch || 0
data: ->
filtered = $filter('filter')(scope.data,scope.filter)
{ results: filtered, text: scope.text }
formatSelection: (item) ->
item[scope.text]
formatResult: (item) ->
item[scope.text]

View File

@@ -0,0 +1,21 @@
angular.module("admin.indexUtils").directive "panelCtrl", (Panels) ->
restrict: "C"
scope:
object: "="
selected: "@?"
controller: ($scope, $element) ->
this.toggle = (name) ->
Panels.toggle($scope.object, name)
this.select = (selection) ->
$scope.$broadcast("selection:changed", selection)
$element.toggleClass("expanded", selection?)
this.registerSelectionListener = (callback) ->
$scope.$on "selection:changed", (event, selection) ->
callback(selection)
this
link: (scope, element, attrs, ctrl) ->
Panels.register(ctrl, scope.object, scope.selected)

View File

@@ -1,37 +1,24 @@
angular.module("admin.indexUtils").directive "panelRow", (Panels, Columns) ->
restrict: "C"
require: "^^panelCtrl"
templateUrl: "admin/panel.html"
scope:
object: "="
panels: "="
link: (scope, element, attrs) ->
scope.template = ""
selected = null
scope.columnCount = Columns.visibleCount
colspan: "=?"
locals: '@?'
link: (scope, element, attrs, ctrl) ->
scope.template = null
scope.columnCount = (scope.colspan || Columns.visibleCount)
if scope.locals
scope[local] = scope.$parent.$eval(local.trim()) for local in scope.locals.split(',')
scope.$on "columnCount:changed", (event, count) ->
scope.columnCount = count
setTemplate = ->
if selected?
scope.template = 'admin/panels/' + scope.panels[selected] + '.html'
ctrl.registerSelectionListener (selection) ->
if selection?
scope.template = "admin/panels/#{scope.panels[selection]}.html"
else
scope.template = ""
scope.getSelected = ->
selected
scope.setSelected = (name) ->
scope.$apply ->
selected = name
setTemplate()
scope.open = (name) ->
element.show 0, ->
scope.setSelected name
scope.close = ->
element.hide 0, ->
scope.setSelected null
Panels.register(scope.object.id, scope)
scope.template = null

View File

@@ -2,11 +2,13 @@ angular.module("admin.indexUtils").directive "panelToggle", ->
restrict: "C"
transclude: true
template: '<div ng-transclude></div><i class=\'icon-chevron\'></i>'
require: "^panelToggleRow"
require: "^^panelCtrl"
scope:
name: "@"
link: (scope, element, attrs, ctrl) ->
scope.selected = ctrl.register(scope.name, element)
element.on "click", ->
scope.selected = ctrl.select(scope.name)
scope.$apply ->
ctrl.toggle(scope.name)
ctrl.registerSelectionListener (selection) ->
element.toggleClass('selected', selection == scope.name)

View File

@@ -1,29 +0,0 @@
angular.module("admin.indexUtils").directive "panelToggleRow", (Panels) ->
restrict: "C"
scope:
object: "="
selected: "@?"
controller: ($scope) ->
panelToggles = {}
this.register = (name, element) ->
panelToggles[name] = element
panelToggles[name].addClass("selected") if $scope.selected == name
$scope.selected == name
this.select = (name) ->
panelToggle.removeClass("selected") for panelName, panelToggle of panelToggles
switch $scope.selected = Panels.toggle($scope.object.id, name)
when null
panelToggles[name].parent(".panel-toggle-row").removeClass("expanded")
else
panelToggles[$scope.selected].addClass("selected")
panelToggles[$scope.selected].parent(".panel-toggle-row").addClass("expanded")
$scope.selected == name
this
#
# link: (scope, element, attrs) ->
# Panels.registerInitialSelection(scope.object.id, scope.selected)

View File

@@ -0,0 +1,12 @@
angular.module("admin.indexUtils").component 'showMore',
templateUrl: 'admin/show_more.html'
bindings:
data: "="
limit: "="
increment: "="
# For now, this component is not being used.
# Something about binding "data" to a variable on the parent scope that is continually refreshed by
# being assigned within an ng-repeat means that we get $digest iteration errors. Seems to be solved
# by using the new "as" syntax for ng-repeat to assign and alias the outcome of the filters, but this
# has the limitation of not being able to be limited AFTER the assignment has been made, which we need

View File

@@ -1,8 +0,0 @@
angular.module("admin.indexUtils").directive "toggleColumn", (Columns) ->
link: (scope, element, attrs) ->
element.addClass "selected" if scope.column.visible
element.click "click", ->
scope.$apply ->
Columns.toggleColumn(scope.column)
element.toggleClass "selected"

View File

@@ -1 +1 @@
angular.module("admin.indexUtils", ['ngResource', 'ngSanitize', 'templates']).config ($httpProvider) ->
angular.module("admin.indexUtils", ['admin.resources', 'ngSanitize', 'templates', 'admin.utils']).config ($httpProvider) ->

View File

@@ -1,13 +1,21 @@
angular.module("admin.indexUtils").factory 'Columns', ($rootScope) ->
angular.module("admin.indexUtils").factory 'Columns', ($rootScope, $http, $injector) ->
new class Columns
savedColumns: {}
columns: {}
visibleCount: 0
setColumns: (columns) =>
constructor: ->
@columns = {}
@columns[name] = column for name, column of columns
for column in @injectColumns()
@columns[column.column_name] = column
@savedColumns[column.column_name] = angular.copy(column)
@calculateVisibleCount()
@columns
injectColumns: ->
if $injector.has('columns')
$injector.get('columns')
else
[]
toggleColumn: (column) =>
column.visible = !column.visible
@@ -16,3 +24,18 @@ angular.module("admin.indexUtils").factory 'Columns', ($rootScope) ->
calculateVisibleCount: =>
@visibleCount = (column for name, column of @columns when column.visible).length
$rootScope.$broadcast "columnCount:changed", @visibleCount
preferencesSaved: =>
angular.equals(@columns, @savedColumns)
savePreferences: (action_name) =>
$http
method: "PUT"
url: "/admin/column_preferences/bulk_update"
data:
action_name: action_name
column_preferences: (preference for column_name, preference of @columns)
.success (data) =>
for column in data
angular.extend(@columns[column.column_name], column)
angular.extend(@savedColumns[column.column_name], column)

View File

@@ -3,7 +3,8 @@ angular.module("admin.indexUtils").factory 'Dereferencer', ->
dereference: (array, data)->
if array
for object, i in array
array[i] = data[object.id]
match = data[object.id]
array[i] = match if match?
dereferenceAttr: (array, attr, data)->
if array

View File

@@ -1,19 +1,22 @@
angular.module("admin.indexUtils").factory 'Panels', ->
new class Panels
panels: {}
panels: []
register: (id, scope) ->
if id? && scope?
@panels[id] = scope
register: (ctrl, object, selected=null) ->
if ctrl? && object?
@panels.push { ctrl: ctrl, object: object, selected: selected }
ctrl.select(selected) if selected?
toggle: (id, name) ->
scope = @panels[id]
selected = scope.getSelected()
switch selected
when name
scope.close()
when null
scope.open(name)
else
scope.setSelected(name)
scope.getSelected()
toggle: (object, name, state=null) ->
panel = @findPanelByObject(object)
if panel.selected == name
@select(panel, null) unless state == "open"
else
@select(panel, name) unless state == "closed"
select: (panel, name) ->
panel.selected = name
panel.ctrl.select(name)
findPanelByObject: (object) ->
(panel for panel in @panels when panel.object == object)[0]

View File

@@ -1,24 +1,36 @@
angular.module("admin.indexUtils").factory "pendingChanges", (resources) ->
angular.module("admin.indexUtils").factory "pendingChanges", ($q, resources, StatusMessage) ->
new class pendingChanges
pendingChanges: {}
errors: []
add: (id, attr, change) =>
@pendingChanges["#{id}"] = {} unless @pendingChanges.hasOwnProperty("#{id}")
@pendingChanges["#{id}"]["#{attr}"] = change
StatusMessage.display('notice', "You have made #{@changeCount(@pendingChanges)} unsaved changes")
removeAll: =>
@pendingChanges = {}
StatusMessage.clear()
remove: (id, attr) =>
if @pendingChanges.hasOwnProperty("#{id}")
delete @pendingChanges["#{id}"]["#{attr}"]
delete @pendingChanges["#{id}"] if @changeCount( @pendingChanges["#{id}"] ) < 1
submitAll: =>
submitAll: (form=null) =>
all = []
@errors = []
StatusMessage.display('progress', "Saving...")
for id, objectChanges of @pendingChanges
for attrName, change of objectChanges
all.push @submit(change)
$q.all(all).then =>
if @errors.length == 0
StatusMessage.display('success', "All changes saved successfully")
form.$setPristine() if form?
else
StatusMessage.display('failure', "Oh no! I was unable to save your changes")
all
submit: (change) ->
@@ -26,8 +38,12 @@ angular.module("admin.indexUtils").factory "pendingChanges", (resources) ->
@remove change.object.id, change.attr
change.scope.reset( data["#{change.attr}"] )
change.scope.success()
, (error) ->
, (error) =>
@errors.push error
change.scope.error()
unsavedCount: ->
Object.keys(@pendingChanges).length
changeCount: (objectChanges) ->
Object.keys(objectChanges).length

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