kylekthompson-shoppe 1.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (239) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +55 -0
  4. data/Rakefile +36 -0
  5. data/app/assets/images/shoppe/chosen-sprite.png +0 -0
  6. data/app/assets/images/shoppe/chosen-sprite@2x.png +0 -0
  7. data/app/assets/images/shoppe/document.svg +1 -0
  8. data/app/assets/images/shoppe/icons/bag.svg +1 -0
  9. data/app/assets/images/shoppe/icons/balance.svg +1 -0
  10. data/app/assets/images/shoppe/icons/box.svg +1 -0
  11. data/app/assets/images/shoppe/icons/building.svg +1 -0
  12. data/app/assets/images/shoppe/icons/chart.svg +1 -0
  13. data/app/assets/images/shoppe/icons/chat.svg +1 -0
  14. data/app/assets/images/shoppe/icons/checkbox.svg +1 -0
  15. data/app/assets/images/shoppe/icons/checkbox2.svg +1 -0
  16. data/app/assets/images/shoppe/icons/cloud.svg +1 -0
  17. data/app/assets/images/shoppe/icons/cone.svg +1 -0
  18. data/app/assets/images/shoppe/icons/credit_card.svg +1 -0
  19. data/app/assets/images/shoppe/icons/currency.svg +1 -0
  20. data/app/assets/images/shoppe/icons/edit.svg +14 -0
  21. data/app/assets/images/shoppe/icons/flowchart.svg +1 -0
  22. data/app/assets/images/shoppe/icons/gift.svg +1 -0
  23. data/app/assets/images/shoppe/icons/globe.svg +1 -0
  24. data/app/assets/images/shoppe/icons/id.svg +1 -0
  25. data/app/assets/images/shoppe/icons/id2.svg +1 -0
  26. data/app/assets/images/shoppe/icons/locked.svg +1 -0
  27. data/app/assets/images/shoppe/icons/report.svg +1 -0
  28. data/app/assets/images/shoppe/icons/search.svg +1 -0
  29. data/app/assets/images/shoppe/icons/support.svg +1 -0
  30. data/app/assets/images/shoppe/icons/tags.svg +1 -0
  31. data/app/assets/images/shoppe/icons/toolbox.svg +1 -0
  32. data/app/assets/images/shoppe/icons/unlocked.svg +1 -0
  33. data/app/assets/images/shoppe/icons/wallet.svg +1 -0
  34. data/app/assets/images/shoppe/logo.svg +47 -0
  35. data/app/assets/images/shoppe/move.svg +1 -0
  36. data/app/assets/images/shoppe/shoppe.svg +25 -0
  37. data/app/assets/images/shoppe/square.svg +9 -0
  38. data/app/assets/images/shoppe/statuses/accepted.svg +14 -0
  39. data/app/assets/images/shoppe/statuses/paid.svg +16 -0
  40. data/app/assets/images/shoppe/statuses/received.svg +15 -0
  41. data/app/assets/images/shoppe/statuses/rejected.svg +14 -0
  42. data/app/assets/images/shoppe/statuses/shipped.svg +14 -0
  43. data/app/assets/images/shoppe/table-tear-off.png +0 -0
  44. data/app/assets/javascripts/shoppe/application.coffee +123 -0
  45. data/app/assets/javascripts/shoppe/chosen.jquery.js +1166 -0
  46. data/app/assets/javascripts/shoppe/jquery_ui.js +6 -0
  47. data/app/assets/javascripts/shoppe/mousetrap.js +9 -0
  48. data/app/assets/javascripts/shoppe/order_form.coffee +47 -0
  49. data/app/assets/stylesheets/shoppe/application.scss +601 -0
  50. data/app/assets/stylesheets/shoppe/chosen.scss +424 -0
  51. data/app/assets/stylesheets/shoppe/dialog.scss +25 -0
  52. data/app/assets/stylesheets/shoppe/elements.scss +79 -0
  53. data/app/assets/stylesheets/shoppe/printable.scss +67 -0
  54. data/app/assets/stylesheets/shoppe/reset.scss +93 -0
  55. data/app/assets/stylesheets/shoppe/sub.scss +106 -0
  56. data/app/assets/stylesheets/shoppe/variables.scss +1 -0
  57. data/app/controllers/shoppe/addresses_controller.rb +47 -0
  58. data/app/controllers/shoppe/application_controller.rb +46 -0
  59. data/app/controllers/shoppe/attachments_controller.rb +14 -0
  60. data/app/controllers/shoppe/countries_controller.rb +47 -0
  61. data/app/controllers/shoppe/customers_controller.rb +55 -0
  62. data/app/controllers/shoppe/dashboard_controller.rb +9 -0
  63. data/app/controllers/shoppe/delivery_service_prices_controller.rb +45 -0
  64. data/app/controllers/shoppe/delivery_services_controller.rb +47 -0
  65. data/app/controllers/shoppe/orders_controller.rb +119 -0
  66. data/app/controllers/shoppe/payments_controller.rb +33 -0
  67. data/app/controllers/shoppe/product_categories_controller.rb +47 -0
  68. data/app/controllers/shoppe/product_category_localisations_controller.rb +58 -0
  69. data/app/controllers/shoppe/product_localisations_controller.rb +58 -0
  70. data/app/controllers/shoppe/products_controller.rb +58 -0
  71. data/app/controllers/shoppe/sessions_controller.rb +34 -0
  72. data/app/controllers/shoppe/settings_controller.rb +16 -0
  73. data/app/controllers/shoppe/stock_level_adjustments_controller.rb +40 -0
  74. data/app/controllers/shoppe/tax_rates_controller.rb +49 -0
  75. data/app/controllers/shoppe/users_controller.rb +53 -0
  76. data/app/controllers/shoppe/variants_controller.rb +50 -0
  77. data/app/helpers/shoppe/application_helper.rb +60 -0
  78. data/app/helpers/shoppe/product_category_helper.rb +36 -0
  79. data/app/mailers/shoppe/order_mailer.rb +25 -0
  80. data/app/mailers/shoppe/user_mailer.rb +10 -0
  81. data/app/models/shoppe/address.rb +44 -0
  82. data/app/models/shoppe/country.rb +27 -0
  83. data/app/models/shoppe/customer.rb +41 -0
  84. data/app/models/shoppe/delivery_service.rb +33 -0
  85. data/app/models/shoppe/delivery_service_price.rb +31 -0
  86. data/app/models/shoppe/order.rb +100 -0
  87. data/app/models/shoppe/order/actions.rb +94 -0
  88. data/app/models/shoppe/order/billing.rb +105 -0
  89. data/app/models/shoppe/order/delivery.rb +229 -0
  90. data/app/models/shoppe/order/states.rb +69 -0
  91. data/app/models/shoppe/order_item.rb +239 -0
  92. data/app/models/shoppe/payment.rb +86 -0
  93. data/app/models/shoppe/product.rb +189 -0
  94. data/app/models/shoppe/product/product_attributes.rb +20 -0
  95. data/app/models/shoppe/product/variants.rb +51 -0
  96. data/app/models/shoppe/product_attribute.rb +66 -0
  97. data/app/models/shoppe/product_categorization.rb +14 -0
  98. data/app/models/shoppe/product_category.rb +75 -0
  99. data/app/models/shoppe/setting.rb +68 -0
  100. data/app/models/shoppe/stock_level_adjustment.rb +19 -0
  101. data/app/models/shoppe/tax_rate.rb +46 -0
  102. data/app/models/shoppe/user.rb +49 -0
  103. data/app/validators/permalink_validator.rb +7 -0
  104. data/app/views/layouts/shoppe/application.html.haml +34 -0
  105. data/app/views/layouts/shoppe/printable.html.haml +11 -0
  106. data/app/views/layouts/shoppe/sub.html.haml +10 -0
  107. data/app/views/shoppe/addresses/_form.html.haml +33 -0
  108. data/app/views/shoppe/addresses/edit.html.haml +5 -0
  109. data/app/views/shoppe/addresses/new.html.haml +5 -0
  110. data/app/views/shoppe/countries/_form.html.haml +35 -0
  111. data/app/views/shoppe/countries/edit.html.haml +6 -0
  112. data/app/views/shoppe/countries/index.html.haml +25 -0
  113. data/app/views/shoppe/countries/new.html.haml +7 -0
  114. data/app/views/shoppe/customers/_addresses.html.haml +20 -0
  115. data/app/views/shoppe/customers/_form.html.haml +30 -0
  116. data/app/views/shoppe/customers/_search_form.html.haml +13 -0
  117. data/app/views/shoppe/customers/edit.html.haml +5 -0
  118. data/app/views/shoppe/customers/index.html.haml +32 -0
  119. data/app/views/shoppe/customers/new.html.haml +5 -0
  120. data/app/views/shoppe/customers/show.html.haml +53 -0
  121. data/app/views/shoppe/delivery_service_prices/_form.html.haml +44 -0
  122. data/app/views/shoppe/delivery_service_prices/edit.html.haml +6 -0
  123. data/app/views/shoppe/delivery_service_prices/index.html.haml +23 -0
  124. data/app/views/shoppe/delivery_service_prices/new.html.haml +6 -0
  125. data/app/views/shoppe/delivery_services/_form.html.haml +38 -0
  126. data/app/views/shoppe/delivery_services/edit.html.haml +9 -0
  127. data/app/views/shoppe/delivery_services/index.html.haml +27 -0
  128. data/app/views/shoppe/delivery_services/new.html.haml +6 -0
  129. data/app/views/shoppe/order_mailer/accepted.text.erb +12 -0
  130. data/app/views/shoppe/order_mailer/received.text.erb +9 -0
  131. data/app/views/shoppe/order_mailer/rejected.text.erb +10 -0
  132. data/app/views/shoppe/order_mailer/shipped.text.erb +16 -0
  133. data/app/views/shoppe/orders/_form.html.haml +58 -0
  134. data/app/views/shoppe/orders/_order_details.html.haml +57 -0
  135. data/app/views/shoppe/orders/_order_items.html.haml +38 -0
  136. data/app/views/shoppe/orders/_order_items_form.html.haml +61 -0
  137. data/app/views/shoppe/orders/_payments_form.html.haml +15 -0
  138. data/app/views/shoppe/orders/_payments_table.html.haml +37 -0
  139. data/app/views/shoppe/orders/_search_form.html.haml +24 -0
  140. data/app/views/shoppe/orders/_status_bar.html.haml +35 -0
  141. data/app/views/shoppe/orders/despatch_note.html.haml +45 -0
  142. data/app/views/shoppe/orders/edit.html.haml +21 -0
  143. data/app/views/shoppe/orders/index.html.haml +39 -0
  144. data/app/views/shoppe/orders/new.html.haml +14 -0
  145. data/app/views/shoppe/orders/show.html.haml +25 -0
  146. data/app/views/shoppe/payments/refund.html.haml +13 -0
  147. data/app/views/shoppe/product_categories/_form.html.haml +50 -0
  148. data/app/views/shoppe/product_categories/edit.html.haml +8 -0
  149. data/app/views/shoppe/product_categories/index.html.haml +27 -0
  150. data/app/views/shoppe/product_categories/new.html.haml +6 -0
  151. data/app/views/shoppe/product_category_localisations/form.html.haml +29 -0
  152. data/app/views/shoppe/product_category_localisations/index.html.haml +26 -0
  153. data/app/views/shoppe/product_localisations/form.html.haml +32 -0
  154. data/app/views/shoppe/product_localisations/index.html.haml +26 -0
  155. data/app/views/shoppe/products/_form.html.haml +118 -0
  156. data/app/views/shoppe/products/_table.html.haml +42 -0
  157. data/app/views/shoppe/products/edit.html.haml +9 -0
  158. data/app/views/shoppe/products/import.html.haml +67 -0
  159. data/app/views/shoppe/products/index.html.haml +9 -0
  160. data/app/views/shoppe/products/new.html.haml +7 -0
  161. data/app/views/shoppe/sessions/new.html.haml +12 -0
  162. data/app/views/shoppe/sessions/reset.html.haml +12 -0
  163. data/app/views/shoppe/settings/edit.html.haml +19 -0
  164. data/app/views/shoppe/shared/error.html.haml +6 -0
  165. data/app/views/shoppe/stock_level_adjustments/index.html.haml +40 -0
  166. data/app/views/shoppe/tax_rates/form.html.haml +28 -0
  167. data/app/views/shoppe/tax_rates/index.html.haml +17 -0
  168. data/app/views/shoppe/user_mailer/new_password.text.erb +9 -0
  169. data/app/views/shoppe/users/_form.html.haml +27 -0
  170. data/app/views/shoppe/users/edit.html.haml +5 -0
  171. data/app/views/shoppe/users/index.html.haml +17 -0
  172. data/app/views/shoppe/users/new.html.haml +7 -0
  173. data/app/views/shoppe/variants/form.html.haml +68 -0
  174. data/app/views/shoppe/variants/index.html.haml +33 -0
  175. data/config/locales/de.yml +653 -0
  176. data/config/locales/en.yml +744 -0
  177. data/config/locales/es.yml +653 -0
  178. data/config/locales/pl.yml +662 -0
  179. data/config/locales/pt-BR.yml +655 -0
  180. data/config/routes.rb +53 -0
  181. data/db/countries.txt +252 -0
  182. data/db/migrate/20130926094549_create_shoppe_initial_schema.rb +175 -0
  183. data/db/migrate/20131024201501_add_address_type_to_shoppe_tax_rates.rb +5 -0
  184. data/db/migrate/20131024204815_create_shoppe_payments.rb +32 -0
  185. data/db/migrate/20131102143930_remove_default_on_order_item_weight.rb +9 -0
  186. data/db/migrate/20141013192427_create_shoppe_customers.rb +14 -0
  187. data/db/migrate/20141026175622_add_indexes_to_shoppe_order_items.rb +6 -0
  188. data/db/migrate/20141026175943_add_indexes_to_shoppe_orders.rb +7 -0
  189. data/db/migrate/20141026180333_add_indexes_to_shoppe_payments.rb +6 -0
  190. data/db/migrate/20141026180835_add_indexes_to_shoppe_product_attributes.rb +7 -0
  191. data/db/migrate/20141026180952_add_indexes_to_shoppe_product_categories.rb +5 -0
  192. data/db/migrate/20141026181040_add_indexes_to_shoppe_products.rb +8 -0
  193. data/db/migrate/20141026181312_add_indexes_to_shoppe_settings.rb +5 -0
  194. data/db/migrate/20141026181354_add_indexes_to_shoppe_stock_level_adjustments.rb +6 -0
  195. data/db/migrate/20141026181559_add_indexes_to_shoppe_users.rb +5 -0
  196. data/db/migrate/20141026181716_add_indexes_to_shoppe_delivery_services.rb +9 -0
  197. data/db/migrate/20141026181717_allow_multiple_shoppe_products_per_shoppe_product_category.rb +46 -0
  198. data/db/migrate/20141026181718_add_nested_to_product_categories.rb +30 -0
  199. data/db/migrate/20141027215005_create_shoppe_addresses.rb +17 -0
  200. data/db/migrate/20150315215633_add_customer_to_shoppe_orders.rb +5 -0
  201. data/db/migrate/20150513171350_create_shoppe_product_category_translation_table.rb +17 -0
  202. data/db/migrate/20150519173350_create_shoppe_product_translation_table.rb +18 -0
  203. data/db/schema.rb +308 -0
  204. data/db/seeds.rb +137 -0
  205. data/db/seeds_data/poe400.jpg +0 -0
  206. data/db/seeds_data/snom-870-blk.jpg +0 -0
  207. data/db/seeds_data/snom-870-grey.jpg +0 -0
  208. data/db/seeds_data/snom-mm2.jpg +0 -0
  209. data/db/seeds_data/spa303.jpg +0 -0
  210. data/db/seeds_data/t18p.jpg +0 -0
  211. data/db/seeds_data/t20p.jpg +0 -0
  212. data/db/seeds_data/t22p.jpg +0 -0
  213. data/db/seeds_data/t26p.jpg +0 -0
  214. data/db/seeds_data/t41pn.jpg +0 -0
  215. data/db/seeds_data/t46gn.jpg +0 -0
  216. data/db/seeds_data/w52p.jpg +0 -0
  217. data/db/seeds_data/yhs32.jpg +0 -0
  218. data/lib/shoppe.rb +60 -0
  219. data/lib/shoppe/associated_countries.rb +20 -0
  220. data/lib/shoppe/country_importer.rb +15 -0
  221. data/lib/shoppe/default_navigation.rb +21 -0
  222. data/lib/shoppe/engine.rb +55 -0
  223. data/lib/shoppe/error.rb +21 -0
  224. data/lib/shoppe/errors/inappropriate_delivery_service.rb +6 -0
  225. data/lib/shoppe/errors/insufficient_stock_to_fulfil.rb +15 -0
  226. data/lib/shoppe/errors/invalid_configuration.rb +6 -0
  227. data/lib/shoppe/errors/not_enough_stock.rb +15 -0
  228. data/lib/shoppe/errors/payment_declined.rb +6 -0
  229. data/lib/shoppe/errors/refund_failed.rb +6 -0
  230. data/lib/shoppe/errors/unorderable_item.rb +6 -0
  231. data/lib/shoppe/navigation_manager.rb +81 -0
  232. data/lib/shoppe/orderable_item.rb +39 -0
  233. data/lib/shoppe/settings.rb +26 -0
  234. data/lib/shoppe/settings_loader.rb +16 -0
  235. data/lib/shoppe/setup_generator.rb +10 -0
  236. data/lib/shoppe/version.rb +3 -0
  237. data/lib/shoppe/view_helpers.rb +16 -0
  238. data/lib/tasks/shoppe.rake +29 -0
  239. metadata +662 -0
@@ -0,0 +1,11 @@
1
+ !!!
2
+ %html
3
+ %head
4
+ %title= @page_title
5
+ = stylesheet_link_tag 'shoppe/printable', :media => :all
6
+ :javascript
7
+ window.print();
8
+ %body
9
+ #content
10
+ = yield
11
+
@@ -0,0 +1,10 @@
1
+ !!!
2
+ %html.login
3
+ %head
4
+ %title #{@page_title} - Shoppe
5
+ %meta{:name => 'viewport', :content => 'width=device-width, initial-scale=1.0'}
6
+ = stylesheet_link_tag 'shoppe/sub'
7
+ = javascript_include_tag 'shoppe/application'
8
+ %body
9
+ #content
10
+ = yield
@@ -0,0 +1,33 @@
1
+ = form_for @address, url: [@customer, @address] do |f|
2
+ = f.error_messages
3
+
4
+ = field_set_tag "Address Information" do
5
+ %dl
6
+ %dt= f.label :address_type
7
+ %dd= f.select :address_type, Shoppe::Address::TYPES, {}, :class => "chosen"
8
+ .splitContainer
9
+ %dl.third
10
+ %dt= f.label :address1
11
+ %dd= f.text_field :address1, :class => "text"
12
+ %dl.third
13
+ %dt= f.label :address2
14
+ %dd= f.text_field :address2, :class => "text"
15
+ %dl.third
16
+ %dt= f.label :address3
17
+ %dd= f.text_field :address3, :class => "text"
18
+ .splitContainer
19
+ %dl.third
20
+ %dt= f.label :address4
21
+ %dd= f.text_field :address4, :class => "text"
22
+ %dl.third
23
+ %dt= f.label :postcode
24
+ %dd= f.text_field :postcode, :class => "text"
25
+ %dl.third
26
+ %dt= f.label :country_id
27
+ %dd= f.collection_select :country_id, Shoppe::Country.ordered, :id, :name, {:include_blank => true}, {:class => 'chosen', :data => { :placeholder => t('shoppe.orders.select_country')}}
28
+
29
+ %p.submit
30
+ - unless @address.new_record?
31
+ %span.right= link_to t('shoppe.delete'), [@customer, @address], :class => 'button purple', :method => :delete, :data => {:confirm => "Are you sure you wish to remove this address?"}
32
+ = f.submit :class => 'button green', data: {disable_with: (@address.new_record? ? "Creating Address..." : "Updating Address...")}
33
+ = link_to t('shoppe.cancel'), :customers, :class => 'button'
@@ -0,0 +1,5 @@
1
+ - @page_title = "Edit Address"
2
+ = content_for :header do
3
+ %p.buttons= link_to "Back to customer", @customer, :class => 'button'
4
+ %h2.users Edit Address
5
+ = render "form"
@@ -0,0 +1,5 @@
1
+ - @page_title = "New Address for #{@customer.name}"
2
+ = content_for :header do
3
+ %p.buttons= link_to "Back to customer", @customer, :class => 'button'
4
+ %h2.users New Address
5
+ = render "form"
@@ -0,0 +1,35 @@
1
+ = form_for @country do |f|
2
+ = f.error_messages
3
+ = field_set_tag t('shoppe.countries.country_details') do
4
+
5
+ .splitContainer
6
+ %dl.third
7
+ %dt= f.label :name, t('shoppe.countries.name')
8
+ %dd= f.text_field :name, :class => 'focus text'
9
+ %dl.third
10
+ %dt= f.label :code2, t('shoppe.countries.iso_alpha_2')
11
+ %dd= f.text_field :code2, :class => 'text'
12
+ %dl.third
13
+ %dt= f.label :code3, t('shoppe.countries.iso_alpha_3')
14
+ %dd= f.text_field :code3, :class => 'text'
15
+
16
+ .splitContainer
17
+ %dl.third
18
+ %dt= f.label :continent, t('shoppe.countries.continent')
19
+ %dd= f.text_field :continent, :class => 'text'
20
+ %dl.third
21
+ %dt= f.label :tld, t('shoppe.countries.tld')
22
+ %dd= f.text_field :tld, :class => 'text'
23
+ %dl.third
24
+ %dt= f.label :eu_member, t('shoppe.countries.eu_member')
25
+ %dd.checkbox
26
+ = f.check_box :eu_member
27
+ = f.label :eu_member, t('shoppe.countries.is_eu_member')
28
+
29
+ %p.submit
30
+ - unless @country.new_record?
31
+ %span.right
32
+ = link_to t('shoppe.delete'), @country, :class => 'button purple',
33
+ :method => :delete, :data => {:confirm => t('shoppe.countries.delete_confirmation')}
34
+ = f.submit t('shoppe.submit'), :class => 'button green'
35
+ = link_to t('shoppe.cancel'), :countries, :class => 'button'
@@ -0,0 +1,6 @@
1
+ - @page_title = t('shoppe.countries.countries')
2
+
3
+ = content_for :header do
4
+ %p.buttons= link_to t('shoppe.countries.back'), :countries, :class => 'button'
5
+ %h2.countries= t('shoppe.countries.countries')
6
+ = render 'form'
@@ -0,0 +1,25 @@
1
+ - @page_title = t('shoppe.countries.countries')
2
+
3
+ = content_for :header do
4
+ %p.buttons=link_to t('shoppe.countries.new_country') , :new_country, :class => 'button green'
5
+ %h2.countries= t('shoppe.countries.countries')
6
+
7
+ .table
8
+ %table.data
9
+ %thead
10
+ %tr
11
+ %th= t('shoppe.countries.name')
12
+ %th= t('shoppe.countries.iso_alpha_2')
13
+ %th= t('shoppe.countries.iso_alpha_3')
14
+ %th= t('shoppe.countries.continent')
15
+ %th= t('shoppe.countries.tld')
16
+ %th= t('shoppe.countries.eu?')
17
+ %tbody
18
+ - for country in @countries
19
+ %tr
20
+ %td= link_to country.name, [:edit, country]
21
+ %td= country.code2
22
+ %td= country.code3
23
+ %td= country.continent
24
+ %td= country.tld
25
+ %td= boolean_tag country.eu_member?
@@ -0,0 +1,7 @@
1
+ - @page_title = t('shoppe.countries.countries')
2
+
3
+ = content_for :header do
4
+ %p.buttons= link_to t('shoppe.countries.back') , :countries, :class => 'button'
5
+ %h2.countries= t('shoppe.countries.countries')
6
+
7
+ = render 'form'
@@ -0,0 +1,20 @@
1
+ .addresses
2
+ .table
3
+ %table.data
4
+ %thead
5
+ %tr
6
+ %th Type
7
+ %th Default
8
+ %th Address
9
+ %th
10
+ %tbody
11
+ - if @addresses.empty?
12
+ %tr.empty
13
+ %td{:colspan => 4} No addresses to display.
14
+ - else
15
+ - for address in @addresses
16
+ %tr
17
+ %td= address.address_type.capitalize
18
+ %td= boolean_tag address.default
19
+ %td= address.full_address
20
+ %td= link_to "Edit", edit_customer_address_path(@customer, address)
@@ -0,0 +1,30 @@
1
+ = form_for @customer do |f|
2
+ = f.error_messages
3
+
4
+ = field_set_tag "Customer Information" do
5
+ .splitContainer
6
+ %dl.third
7
+ %dt= f.label :first_name
8
+ %dd= f.text_field :first_name, :class => "text focus"
9
+ %dl.third
10
+ %dt= f.label :last_name
11
+ %dd= f.text_field :last_name, :class => "text"
12
+ %dl.third
13
+ %dt= f.label :company
14
+ %dd= f.text_field :company, :class => "text"
15
+ .splitContainer
16
+ %dl.third
17
+ %dt= f.label :email
18
+ %dd= f.text_field :email, :class => "text"
19
+ %dl.third
20
+ %dt= f.label :phone
21
+ %dd= f.text_field :phone, :class => "text"
22
+ %dl.third
23
+ %dt= f.label :mobile
24
+ %dd= f.text_field :mobile, :class => "text"
25
+
26
+ %p.submit
27
+ - unless @customer.new_record?
28
+ %span.right= link_to "Delete", @customer, :class => 'button purple', :method => :delete, :data => {:confirm => "Are you sure you wish to remove this product?"}
29
+ = f.submit :class => 'button green', data: {disable_with: (@customer.new_record? ? "Creating Customer..." : "Updating Customer...")}
30
+ = link_to "Cancel", :customers, :class => 'button'
@@ -0,0 +1,13 @@
1
+ .customerSearch{:style => action_name == 'search' ? "display:block" : ''}
2
+ = search_form_for @query, :url => search_customers_path, :html => { :method => :post } do |f|
3
+ %dl.left
4
+ %dt= f.label :first_name_or_last_name_or_company_cont, "First or Last Name"
5
+ %dd= f.text_field :first_name_or_last_name_or_company_cont
6
+ %dt= f.label :company_cont, "Company"
7
+ %dd= f.text_field :company_cont
8
+ %dl.right
9
+ %dt= f.label :email_cont, "Email Address"
10
+ %dd= f.text_field :email_cont
11
+ %dt= f.label :phone_cont, "Phone Number"
12
+ %dd= f.text_field :phone_cont
13
+ %dd= f.submit "Search", :class => 'button green button'
@@ -0,0 +1,5 @@
1
+ - @page_title = "Customers"
2
+ = content_for :header do
3
+ %p.buttons= link_to "Back to customer list", :customers, :class => 'button'
4
+ %h2.users Customers
5
+ = render "form"
@@ -0,0 +1,32 @@
1
+ - @page_title = "Customers"
2
+
3
+ = content_for :header do
4
+ %p.buttons
5
+ = link_to "New Customer", :new_customer, class: "button green"
6
+ = link_to "Search Customers", '#', class: 'button', rel: "searchCustomers"
7
+ %h2.users Customers
8
+
9
+ = render "search_form"
10
+
11
+ .table
12
+ %table.data
13
+ %thead
14
+ %tr
15
+ %th Name
16
+ %th Company
17
+ %th Email
18
+ %th Phone
19
+ %th Mobile
20
+ %tbody
21
+ - if @customers.empty?
22
+ %tr.empty
23
+ %td{colspan: 5} No customers to display.
24
+ - else
25
+ - for customer in @customers
26
+ %tr
27
+ %td= link_to customer.full_name, customer
28
+ %td= link_to customer.company, customer
29
+ %td= customer.email
30
+ %td= customer.phone
31
+ %td= customer.mobile
32
+ = paginate @customers
@@ -0,0 +1,5 @@
1
+ - @page_title = "Customers"
2
+ = content_for :header do
3
+ %p.buttons= link_to "Back to customer list", :customers, :class => 'button'
4
+ %h2.users Customers
5
+ = render "form"
@@ -0,0 +1,53 @@
1
+ - @page_title = "Customer - #{@customer.name}"
2
+ = content_for :header do
3
+ %p.buttons
4
+ = link_to "New Address", [:new, @customer, :address], class: "button"
5
+ = link_to "Edit", [:edit, @customer], class: "button"
6
+ %h2.users
7
+ Customer - #{@customer.name}
8
+
9
+ #customer
10
+ .details
11
+ .left
12
+ %dl
13
+ %dt Name
14
+ %dd= @customer.full_name
15
+ %dt Company
16
+ %dd= @customer.company.blank? ? '-' : @customer.company
17
+ .right
18
+ %dl
19
+ %dt Email Address
20
+ %dd= mail_to @customer.email
21
+ %dt Telephone
22
+ %dd= @customer.phone
23
+ %dt Mobile
24
+ %dd= @customer.mobile
25
+
26
+ = field_set_tag "Addresses", :class => 'padded' do
27
+ = render "addresses"
28
+
29
+ = field_set_tag t('shoppe.orders.orders'), :class => 'padded' do
30
+ .table
31
+ %table.data
32
+ %thead
33
+ %tr
34
+ %th= t('shoppe.orders.number')
35
+ %th= t('shoppe.orders.status')
36
+ %th= t('shoppe.orders.products')
37
+ %th= t('shoppe.orders.total')
38
+ %th= t('shoppe.orders.payment')
39
+ %tbody
40
+ - if @orders.empty?
41
+ %tr.empty
42
+ %td{:colspan => 6}= t('shoppe.orders.no_orders')
43
+ - else
44
+ - for order in @orders
45
+ %tr
46
+ %td= link_to order.number, order
47
+ %td= status_tag order.status
48
+ %td
49
+ %ul
50
+ - for item in order.order_items
51
+ %li #{item.quantity} x #{item.ordered_item.full_name}
52
+ %td= number_to_currency order.total
53
+ %td= boolean_tag order.paid_in_full?, nil, :true_text => number_to_currency(order.amount_paid), :false_text => number_to_currency(order.amount_paid)
@@ -0,0 +1,44 @@
1
+ = form_for [@delivery_service, @delivery_service_price] do |f|
2
+ = f.error_messages
3
+ = field_set_tag t('shoppe.delivery_service_prices.identification_weight') do
4
+ .splitContainer
5
+ %dl.third
6
+ %dt= f.label :code, t('shoppe.delivery_service_prices.code')
7
+ %dd= f.text_field :code, :class => 'focus text'
8
+
9
+ %dl.third
10
+ %dt= f.label :min_weight, t('shoppe.delivery_service_prices.min_weight')
11
+ %dd= f.text_field :min_weight, :class => 'text'
12
+ %dl.third
13
+ %dt= f.label :max_weight, t('shoppe.delivery_service_prices.max_weight')
14
+ %dd= f.text_field :max_weight, :class => 'text'
15
+
16
+ = field_set_tag t('shoppe.delivery_service_prices.pricing') do
17
+ .splitContainer
18
+ %dl.third
19
+ %dt= f.label :price, t('shoppe.delivery_service_prices.price')
20
+ %dd
21
+ .moneyInput
22
+ .currency= Shoppe.settings.currency_unit.html_safe
23
+ = f.text_field :price, :class => 'text'
24
+ %dl.third
25
+ %dt= f.label :cost_price, t('shoppe.delivery_service_prices.cost_price')
26
+ %dd
27
+ .moneyInput
28
+ .currency= Shoppe.settings.currency_unit.html_safe
29
+ = f.text_field :cost_price, :class => 'text'
30
+ %dl.third
31
+ %dt= f.label :tax_rate_id, t('shoppe.delivery_service_prices.tax_rate')
32
+ %dd= f.collection_select :tax_rate_id, Shoppe::TaxRate.ordered, :id, :description, {:include_blank => true}, {:class => 'chosen-with-deselect', :data => {:placeholder => t('shoppe.delivery_service_prices.no_tax')}}
33
+
34
+ = field_set_tag t('shoppe.delivery_service_prices.countries') do
35
+ %dl
36
+ %dd
37
+ = f.collection_select :country_ids, Shoppe::Country.ordered, :id, :name, {}, {:class => 'chosen', :multiple => true, :data => {:placeholder => t('shoppe.delivery_service_prices.all_countries')}}
38
+ %p.help= t('shoppe.delivery_service_prices.help.countries')
39
+
40
+ %p.submit
41
+ - unless @delivery_service_price.new_record?
42
+ %span.right= link_to t('shoppe.delete'), [@delivery_service, @delivery_service_price], :class => 'button purple', :method => :delete, :data => {:confirm => "Are you sure you wish to remove this price?"}
43
+ = f.submit t('shoppe.submit'), :class => 'button green'
44
+ = link_to t('shoppe.cancel'), [@delivery_service, :delivery_service_prices], :class => 'button'
@@ -0,0 +1,6 @@
1
+ - @page_title = t('shoppe.delivery_service_prices.delivery_services')
2
+
3
+ = content_for :header do
4
+ %p.buttons= link_to t('shoppe.delivery_service_prices.back'), [@delivery_service, :delivery_service_prices], :class => 'button'
5
+ %h2.delivery_services= t('shoppe.delivery_service_prices.delivery_services')
6
+ = render 'form'
@@ -0,0 +1,23 @@
1
+ - @page_title = t('shoppe.delivery_service_prices.delivery_services')
2
+
3
+ = content_for :header do
4
+ %p.buttons
5
+ = link_to t('shoppe.delivery_service_prices.new_price'), [:new, @delivery_service, :delivery_service_price], :class => 'button green'
6
+ = link_to t('shoppe.delivery_service_prices.back_to_delivery_services'), :delivery_services, :class => 'button'
7
+ %h2.delivery_services= t('shoppe.delivery_service_prices.pricing_for', delivery_name: @delivery_service.name)
8
+
9
+ .table
10
+ %table.data
11
+ %thead
12
+ %tr
13
+ %th= t('shoppe.delivery_service_prices.code')
14
+ %th= t('shoppe.delivery_service_prices.weight_allowance')
15
+ %th= t('shoppe.delivery_service_prices.price')
16
+ %th= t('shoppe.delivery_service_prices.cost')
17
+ %tbody
18
+ - for price in @delivery_service_prices
19
+ %tr
20
+ %td= link_to price.code, [:edit, @delivery_service, price]
21
+ %td #{number_to_weight price.min_weight} → #{number_to_weight price.max_weight}
22
+ %td= number_to_currency(price.price)
23
+ %td= number_to_currency price.cost_price
@@ -0,0 +1,6 @@
1
+ - @page_title = t('shoppe.delivery_service_prices.delivery_services')
2
+
3
+ = content_for :header do
4
+ %p.buttons= link_to t('shoppe.delivery_service_prices.back') , [@delivery_service, :delivery_service_prices], :class => 'button'
5
+ %h2.delivery_services= t('shoppe.delivery_service_prices.delivery_services')
6
+ = render 'form'
@@ -0,0 +1,38 @@
1
+ = form_for @delivery_service do |f|
2
+ = f.error_messages
3
+ = field_set_tag t('shoppe.delivery_services.details') do
4
+ .splitContainer
5
+ %dl.half
6
+ %dt= f.label :name, t('shoppe.delivery_services.name')
7
+ %dd= f.text_field :name, :class => 'focus text'
8
+ %dl.half
9
+ %dt= f.label :code, t('shoppe.delivery_services.code')
10
+ %dd= f.text_field :code, :class => 'text'
11
+ .splitContainer
12
+ %dl.half
13
+ %dt= f.label :active, t('shoppe.delivery_services.active')
14
+ %dd.checkbox
15
+ = f.check_box :active
16
+ = f.label :active, t('shoppe.delivery_services.active_info')
17
+ %dl.half
18
+ %dt= f.label :default, t('shoppe.delivery_services.default')
19
+ %dd.checkbox
20
+ = f.check_box :default
21
+ = f.label :default, t('shoppe.delivery_services.default_info')
22
+
23
+ = field_set_tag t('shoppe.delivery_services.courier') do
24
+ .splitContainer
25
+ %dl.half
26
+ %dt= f.label :courier, t('shoppe.delivery_services.courier_name')
27
+ %dd= f.text_field :courier, :class => 'text'
28
+ %dl.half
29
+ %dt= f.label :tracking_url, t('shoppe.delivery_services.tracking_url')
30
+ %dd
31
+ = f.text_field :tracking_url, :class => 'text'
32
+ %p.help= t('shoppe.delivery_services.tracking_url_help_html')
33
+
34
+ %p.submit
35
+ - unless @delivery_service.new_record?
36
+ %span.right= link_to t('shoppe.delete'), [@delivery_service], :class => 'button purple', :method => :delete, :data => {:confirm => t('shoppe.delivery_services.delete_confirmation')}
37
+ = f.submit t('shoppe.submit'), :class => 'button green'
38
+ = link_to t('shoppe.cancel'), :delivery_services, :class => 'button'