tienda 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (193) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/Rakefile +35 -0
  4. data/app/assets/images/tienda/chosen-sprite.png +0 -0
  5. data/app/assets/images/tienda/chosen-sprite@2x.png +0 -0
  6. data/app/assets/images/tienda/document.svg +1 -0
  7. data/app/assets/images/tienda/icons/bag.svg +1 -0
  8. data/app/assets/images/tienda/icons/balance.svg +1 -0
  9. data/app/assets/images/tienda/icons/box.svg +1 -0
  10. data/app/assets/images/tienda/icons/building.svg +1 -0
  11. data/app/assets/images/tienda/icons/chart.svg +1 -0
  12. data/app/assets/images/tienda/icons/chat.svg +1 -0
  13. data/app/assets/images/tienda/icons/checkbox.svg +1 -0
  14. data/app/assets/images/tienda/icons/checkbox2.svg +1 -0
  15. data/app/assets/images/tienda/icons/cloud.svg +1 -0
  16. data/app/assets/images/tienda/icons/cone.svg +1 -0
  17. data/app/assets/images/tienda/icons/credit_card.svg +1 -0
  18. data/app/assets/images/tienda/icons/currency.svg +1 -0
  19. data/app/assets/images/tienda/icons/edit.svg +14 -0
  20. data/app/assets/images/tienda/icons/flowchart.svg +1 -0
  21. data/app/assets/images/tienda/icons/gift.svg +1 -0
  22. data/app/assets/images/tienda/icons/globe.svg +1 -0
  23. data/app/assets/images/tienda/icons/id.svg +1 -0
  24. data/app/assets/images/tienda/icons/id2.svg +1 -0
  25. data/app/assets/images/tienda/icons/locked.svg +1 -0
  26. data/app/assets/images/tienda/icons/report.svg +1 -0
  27. data/app/assets/images/tienda/icons/search.svg +1 -0
  28. data/app/assets/images/tienda/icons/support.svg +1 -0
  29. data/app/assets/images/tienda/icons/tags.svg +1 -0
  30. data/app/assets/images/tienda/icons/toolbox.svg +1 -0
  31. data/app/assets/images/tienda/icons/unlocked.svg +1 -0
  32. data/app/assets/images/tienda/icons/wallet.svg +1 -0
  33. data/app/assets/images/tienda/logo.svg +47 -0
  34. data/app/assets/images/tienda/move.svg +1 -0
  35. data/app/assets/images/tienda/shoppe.svg +25 -0
  36. data/app/assets/images/tienda/square.svg +9 -0
  37. data/app/assets/images/tienda/statuses/accepted.svg +14 -0
  38. data/app/assets/images/tienda/statuses/paid.svg +16 -0
  39. data/app/assets/images/tienda/statuses/received.svg +15 -0
  40. data/app/assets/images/tienda/statuses/rejected.svg +14 -0
  41. data/app/assets/images/tienda/statuses/shipped.svg +14 -0
  42. data/app/assets/images/tienda/table-tear-off.png +0 -0
  43. data/app/assets/javascripts/tienda/application.coffee +119 -0
  44. data/app/assets/javascripts/tienda/chosen.jquery.js +1166 -0
  45. data/app/assets/javascripts/tienda/jquery_ui.js +6 -0
  46. data/app/assets/javascripts/tienda/mousetrap.js +9 -0
  47. data/app/assets/javascripts/tienda/order_form.coffee +47 -0
  48. data/app/assets/stylesheets/tienda/application.scss +585 -0
  49. data/app/assets/stylesheets/tienda/chosen.scss +424 -0
  50. data/app/assets/stylesheets/tienda/dialog.scss +25 -0
  51. data/app/assets/stylesheets/tienda/elements.scss +79 -0
  52. data/app/assets/stylesheets/tienda/printable.scss +67 -0
  53. data/app/assets/stylesheets/tienda/reset.scss +93 -0
  54. data/app/assets/stylesheets/tienda/sub.scss +106 -0
  55. data/app/assets/stylesheets/tienda/variables.scss +1 -0
  56. data/app/controllers/tienda/application_controller.rb +46 -0
  57. data/app/controllers/tienda/attachments_controller.rb +14 -0
  58. data/app/controllers/tienda/countries_controller.rb +47 -0
  59. data/app/controllers/tienda/dashboard_controller.rb +9 -0
  60. data/app/controllers/tienda/delivery_service_prices_controller.rb +45 -0
  61. data/app/controllers/tienda/delivery_services_controller.rb +47 -0
  62. data/app/controllers/tienda/orders_controller.rb +90 -0
  63. data/app/controllers/tienda/payments_controller.rb +33 -0
  64. data/app/controllers/tienda/product_categories_controller.rb +47 -0
  65. data/app/controllers/tienda/products_controller.rb +58 -0
  66. data/app/controllers/tienda/sessions_controller.rb +34 -0
  67. data/app/controllers/tienda/settings_controller.rb +16 -0
  68. data/app/controllers/tienda/stock_level_adjustments_controller.rb +40 -0
  69. data/app/controllers/tienda/tax_rates_controller.rb +49 -0
  70. data/app/controllers/tienda/users_controller.rb +53 -0
  71. data/app/controllers/tienda/variants_controller.rb +50 -0
  72. data/app/helpers/tienda/application_helper.rb +60 -0
  73. data/app/mailers/tienda/order_mailer.rb +25 -0
  74. data/app/mailers/tienda/user_mailer.rb +10 -0
  75. data/app/models/tienda/country.rb +27 -0
  76. data/app/models/tienda/delivery_service.rb +33 -0
  77. data/app/models/tienda/delivery_service_price.rb +31 -0
  78. data/app/models/tienda/order/actions.rb +98 -0
  79. data/app/models/tienda/order/billing.rb +105 -0
  80. data/app/models/tienda/order/delivery.rb +229 -0
  81. data/app/models/tienda/order/states.rb +69 -0
  82. data/app/models/tienda/order.rb +93 -0
  83. data/app/models/tienda/order_item.rb +239 -0
  84. data/app/models/tienda/payment.rb +80 -0
  85. data/app/models/tienda/product/product_attributes.rb +20 -0
  86. data/app/models/tienda/product/variants.rb +51 -0
  87. data/app/models/tienda/product.rb +169 -0
  88. data/app/models/tienda/product_attribute.rb +66 -0
  89. data/app/models/tienda/product_category.rb +23 -0
  90. data/app/models/tienda/setting.rb +68 -0
  91. data/app/models/tienda/stock_level_adjustment.rb +19 -0
  92. data/app/models/tienda/tax_rate.rb +46 -0
  93. data/app/models/tienda/user.rb +49 -0
  94. data/app/validators/permalink_validator.rb +7 -0
  95. data/app/views/layouts/tienda/application.html.haml +34 -0
  96. data/app/views/layouts/tienda/printable.html.haml +11 -0
  97. data/app/views/layouts/tienda/sub.html.haml +10 -0
  98. data/app/views/tienda/countries/_form.html.haml +35 -0
  99. data/app/views/tienda/countries/edit.html.haml +6 -0
  100. data/app/views/tienda/countries/index.html.haml +25 -0
  101. data/app/views/tienda/countries/new.html.haml +7 -0
  102. data/app/views/tienda/delivery_service_prices/_form.html.haml +44 -0
  103. data/app/views/tienda/delivery_service_prices/edit.html.haml +6 -0
  104. data/app/views/tienda/delivery_service_prices/index.html.haml +23 -0
  105. data/app/views/tienda/delivery_service_prices/new.html.haml +6 -0
  106. data/app/views/tienda/delivery_services/_form.html.haml +38 -0
  107. data/app/views/tienda/delivery_services/edit.html.haml +9 -0
  108. data/app/views/tienda/delivery_services/index.html.haml +27 -0
  109. data/app/views/tienda/delivery_services/new.html.haml +6 -0
  110. data/app/views/tienda/order_mailer/accepted.text.erb +12 -0
  111. data/app/views/tienda/order_mailer/received.text.erb +12 -0
  112. data/app/views/tienda/order_mailer/rejected.text.erb +10 -0
  113. data/app/views/tienda/order_mailer/shipped.text.erb +16 -0
  114. data/app/views/tienda/orders/_form.html.haml +55 -0
  115. data/app/views/tienda/orders/_order_details.html.haml +57 -0
  116. data/app/views/tienda/orders/_order_items.html.haml +38 -0
  117. data/app/views/tienda/orders/_order_items_form.html.haml +61 -0
  118. data/app/views/tienda/orders/_payments_form.html.haml +15 -0
  119. data/app/views/tienda/orders/_payments_table.html.haml +37 -0
  120. data/app/views/tienda/orders/_search_form.html.haml +24 -0
  121. data/app/views/tienda/orders/_status_bar.html.haml +35 -0
  122. data/app/views/tienda/orders/despatch_note.html.haml +45 -0
  123. data/app/views/tienda/orders/edit.html.haml +21 -0
  124. data/app/views/tienda/orders/index.html.haml +39 -0
  125. data/app/views/tienda/orders/new.html.haml +14 -0
  126. data/app/views/tienda/orders/show.html.haml +25 -0
  127. data/app/views/tienda/payments/refund.html.haml +13 -0
  128. data/app/views/tienda/product_categories/_form.html.haml +26 -0
  129. data/app/views/tienda/product_categories/edit.html.haml +6 -0
  130. data/app/views/tienda/product_categories/index.html.haml +19 -0
  131. data/app/views/tienda/product_categories/new.html.haml +6 -0
  132. data/app/views/tienda/products/_form.html.haml +118 -0
  133. data/app/views/tienda/products/_table.html.haml +42 -0
  134. data/app/views/tienda/products/edit.html.haml +8 -0
  135. data/app/views/tienda/products/import.html.haml +63 -0
  136. data/app/views/tienda/products/index.html.haml +9 -0
  137. data/app/views/tienda/products/new.html.haml +7 -0
  138. data/app/views/tienda/sessions/new.html.haml +12 -0
  139. data/app/views/tienda/sessions/reset.html.haml +12 -0
  140. data/app/views/tienda/settings/edit.html.haml +19 -0
  141. data/app/views/tienda/shared/error.html.haml +6 -0
  142. data/app/views/tienda/stock_level_adjustments/index.html.haml +40 -0
  143. data/app/views/tienda/tax_rates/form.html.haml +28 -0
  144. data/app/views/tienda/tax_rates/index.html.haml +17 -0
  145. data/app/views/tienda/user_mailer/new_password.text.erb +9 -0
  146. data/app/views/tienda/users/_form.html.haml +27 -0
  147. data/app/views/tienda/users/edit.html.haml +5 -0
  148. data/app/views/tienda/users/index.html.haml +17 -0
  149. data/app/views/tienda/users/new.html.haml +7 -0
  150. data/app/views/tienda/variants/form.html.haml +66 -0
  151. data/app/views/tienda/variants/index.html.haml +33 -0
  152. data/config/locales/en.yml +650 -0
  153. data/config/locales/pl.yml +650 -0
  154. data/config/locales/pt-BR.yml +643 -0
  155. data/config/routes.rb +42 -0
  156. data/db/countries.txt +252 -0
  157. data/db/migrate/20150124094549_create_tienda_initial_schema.rb +184 -0
  158. data/db/seeds.rb +128 -0
  159. data/db/seeds_data/poe400.jpg +0 -0
  160. data/db/seeds_data/snom-870-blk.jpg +0 -0
  161. data/db/seeds_data/snom-870-grey.jpg +0 -0
  162. data/db/seeds_data/snom-mm2.jpg +0 -0
  163. data/db/seeds_data/spa303.jpg +0 -0
  164. data/db/seeds_data/t18p.jpg +0 -0
  165. data/db/seeds_data/t20p.jpg +0 -0
  166. data/db/seeds_data/t22p.jpg +0 -0
  167. data/db/seeds_data/t26p.jpg +0 -0
  168. data/db/seeds_data/t41pn.jpg +0 -0
  169. data/db/seeds_data/t46gn.jpg +0 -0
  170. data/db/seeds_data/w52p.jpg +0 -0
  171. data/db/seeds_data/yhs32.jpg +0 -0
  172. data/lib/tasks/tienda.rake +29 -0
  173. data/lib/tienda/associated_countries.rb +20 -0
  174. data/lib/tienda/country_importer.rb +14 -0
  175. data/lib/tienda/default_navigation.rb +20 -0
  176. data/lib/tienda/engine.rb +48 -0
  177. data/lib/tienda/error.rb +21 -0
  178. data/lib/tienda/errors/inappropriate_delivery_service.rb +6 -0
  179. data/lib/tienda/errors/insufficient_stock_to_fulfil.rb +15 -0
  180. data/lib/tienda/errors/invalid_configuration.rb +6 -0
  181. data/lib/tienda/errors/not_enough_stock.rb +15 -0
  182. data/lib/tienda/errors/payment_declined.rb +6 -0
  183. data/lib/tienda/errors/refund_failed.rb +6 -0
  184. data/lib/tienda/errors/unorderable_item.rb +6 -0
  185. data/lib/tienda/navigation_manager.rb +81 -0
  186. data/lib/tienda/orderable_item.rb +39 -0
  187. data/lib/tienda/settings.rb +26 -0
  188. data/lib/tienda/settings_loader.rb +16 -0
  189. data/lib/tienda/setup_generator.rb +10 -0
  190. data/lib/tienda/version.rb +3 -0
  191. data/lib/tienda/view_helpers.rb +16 -0
  192. data/lib/tienda.rb +59 -0
  193. metadata +604 -0
@@ -0,0 +1,39 @@
1
+ - @page_title = t('tienda.orders.orders')
2
+
3
+ = content_for :header do
4
+ %p.buttons
5
+ = link_to t('tienda.orders.new_order'), :new_order, :class => 'button green'
6
+ = link_to t('tienda.orders.search_orders'), '#', :class => 'button', :rel => 'searchOrders'
7
+ %h2.orders
8
+ = t('tienda.orders.orders')
9
+ %span= page_entries_info @orders
10
+
11
+ = render 'search_form'
12
+
13
+ .table
14
+ %table.data
15
+ %thead
16
+ %tr
17
+ %th= t('tienda.orders.number')
18
+ %th= t('tienda.orders.customer')
19
+ %th= t('tienda.orders.status')
20
+ %th= t('tienda.orders.products')
21
+ %th= t('tienda.orders.total')
22
+ %th= t('tienda.orders.payment')
23
+ %tbody
24
+ - if @orders.empty?
25
+ %tr.empty
26
+ %td{:colspan => 6}= t('tienda.orders.no_orders')
27
+ - else
28
+ - for order in @orders
29
+ %tr
30
+ %td= link_to order.number, order
31
+ %td= order.customer_name
32
+ %td= status_tag order.status
33
+ %td
34
+ %ul
35
+ - for item in order.order_items
36
+ %li #{item.quantity} x #{item.ordered_item.full_name}
37
+ %td= number_to_currency order.total
38
+ %td= boolean_tag order.paid_in_full?, nil, :true_text => number_to_currency(order.amount_paid), :false_text => number_to_currency(order.amount_paid)
39
+ = paginate @orders
@@ -0,0 +1,14 @@
1
+ - @page_title = t('tienda.orders.new_order')
2
+
3
+ = content_for :header do
4
+ %p.buttons= link_to t('tienda.orders.back_to_orders'), :orders, :class => 'button grey'
5
+ %h2.orders= t('tienda.orders.new_order')
6
+
7
+ = form_for @order, :html => {:class => 'orderForm newOrder'} do |f|
8
+ = f.error_messages
9
+ = render 'form', :f => f
10
+ = field_set_tag t('tienda.orders.ordered_products'), :class => 'padded' do
11
+ = render 'order_items_form', :f => f
12
+ %p.submit
13
+ = f.submit t('tienda.orders.create_order'), :class => 'button green'
14
+ = link_to t('tienda.cancel'), :orders, :class => 'button grey'
@@ -0,0 +1,25 @@
1
+ - @page_title = "#{t('tienda.orders.order')} ##{@order.number}"
2
+
3
+ = content_for :header do
4
+ %p.buttons
5
+ = link_to t('tienda.edit'), [:edit, @order], :class => 'button'
6
+ - if @order.accepted?
7
+ = link_to t('tienda.orders.despatch_note.despatch_note'), [:despatch_note, @order], :class => 'button', :rel => 'print'
8
+ = link_to t('tienda.orders.back_to_orders'), :orders, :class => 'button grey'
9
+ %h2.orders= t('tienda.orders.order_no_html', order_number: @order.number)
10
+
11
+ #order
12
+
13
+ - if @order.received?
14
+ = render 'order_details'
15
+ = render 'status_bar'
16
+ - else
17
+ %p.warning= t('tienda.orders.in_progress_warning')
18
+
19
+ = field_set_tag t('tienda.orders.order_items'), :class => 'padded' do
20
+ = render 'order_items'
21
+
22
+ - if @order.received?
23
+ = field_set_tag t('tienda.orders.payments'), :class => 'padded orderPayments' do
24
+ = render 'payments_table'
25
+ = render 'payments_form'
@@ -0,0 +1,13 @@
1
+
2
+ = form_tag [:refund, @order, @payment], :class => 'refundForm' do
3
+ %h2= t('tienda.refund.issue_refund')
4
+ %p.intro
5
+ = t('tienda.refund.intro_html', amount: number_to_currency(@payment.refundable_amount))
6
+
7
+ .moneyInput
8
+ .currency= Tienda.settings.currency_unit.html_safe
9
+ = text_field_tag 'amount', @payment.refundable_amount, :class => 'text'
10
+ %p.submit
11
+ = submit_tag t('tienda.refund.refund'), :class => 'button green'
12
+ = link_to t('tienda.close'), '#', :class => 'button grey', :rel => 'closeDialog'
13
+
@@ -0,0 +1,26 @@
1
+ = form_for @product_category do |f|
2
+ = f.error_messages
3
+ = field_set_tag t('tienda.product_category.category_details') do
4
+ .splitContainer
5
+ %dl.half
6
+ %dt= f.label :name, t('tienda.product_category.name')
7
+ %dd= f.text_field :name, :class => 'focus text'
8
+ %dl.half
9
+ %dt= f.label :permalink, t('tienda.product_category.permalink')
10
+ %dd= f.text_field :permalink, :class => 'text'
11
+ %dl
12
+ %dt= f.label :description, t('tienda.product_category.description')
13
+ %dd= f.text_area :description, :class => 'text'
14
+
15
+ = field_set_tag t('tienda.product_category.attachments') do
16
+ %dl
17
+ %dt= f.label :image_file, t('tienda.product_category.image')
18
+ %dd
19
+ = attachment_preview @product_category.image
20
+ %p= f.file_field :image_file
21
+
22
+ %p.submit
23
+ - unless @product_category.new_record?
24
+ %span.right= link_to t('tienda.delete') , @product_category, :class => 'button purple', :method => :delete, :data => {:confirm => t('tienda.product_category.delete_confirmation') }
25
+ = f.submit t('tienda.submit'), :class => 'button green'
26
+ = link_to t('tienda.cancel') , :product_categories, :class => 'button'
@@ -0,0 +1,6 @@
1
+ - @page_title = t('tienda.product_category.product_categories')
2
+ = content_for :header do
3
+ %p.buttons= link_to t('tienda.product_category.back_to_categories'), :product_categories, :class => 'button'
4
+ %h2.products= t('tienda.product_category.product_categories')
5
+ = render 'form'
6
+
@@ -0,0 +1,19 @@
1
+ - @page_title = t('tienda.product_category.product_categories')
2
+
3
+ = content_for :header do
4
+ %p.buttons=link_to t('tienda.product_category.new_category'), :new_product_category, :class => 'button green'
5
+ %h2.products= t('tienda.product_category.product_categories')
6
+
7
+ .table
8
+ %table.data
9
+ %thead
10
+ %tr
11
+ %th= t('tienda.product_category.name')
12
+ %tbody
13
+ - if @product_categories.empty?
14
+ %tr.empty
15
+ %td= t('tienda.product_category.no_categories')
16
+ - else
17
+ - for cat in @product_categories
18
+ %tr
19
+ %td= link_to cat.name, [:edit, cat]
@@ -0,0 +1,6 @@
1
+ - @page_title = t('tienda.product_category.product_categories')
2
+ = content_for :header do
3
+ %p.buttons= link_to t('tienda.product_category.back_to_categories'), :product_categories, :class => 'button'
4
+ %h2.products= t('tienda.product_category.product_categories')
5
+
6
+ = render 'form'
@@ -0,0 +1,118 @@
1
+ = form_for @product, :html => {:multipart => true} do |f|
2
+ = f.error_messages
3
+ = field_set_tag t('tienda.products.product_information') do
4
+ %dl
5
+ %dt= f.label :product_category_id, t('tienda.products.product_category')
6
+ %dd= f.collection_select :product_category_id, Tienda::ProductCategory.ordered, :id, :name, {:prompt => false}, {:class => 'chosen'}
7
+
8
+ .splitContainer
9
+ %dl.third
10
+ %dt= f.label :name, t('tienda.products.name')
11
+ %dd= f.text_field :name, :class => 'text focus'
12
+ %dl.third
13
+ %dt= f.label :permalink, t('tienda.products.permalink')
14
+ %dd= f.text_field :permalink, :class => 'text'
15
+ %dl.third
16
+ %dt= f.label :sku, t('tienda.products.sku')
17
+ %dd= f.text_field :sku, :class => 'text'
18
+ %dl
19
+ %dt= f.label :description, t('tienda.products.description')
20
+ %dd= f.text_area :description, :class => 'text'
21
+ %dl
22
+ %dt= f.label :short_description, t('tienda.products.short_description')
23
+ %dd= f.text_area :short_description, :class => 'text'
24
+ %dl
25
+ %dt= f.label :in_the_box, t('tienda.products.in_the_box')
26
+ %dd= f.text_area :in_the_box, :class => 'text'
27
+
28
+ = field_set_tag t('tienda.products.attributes') do
29
+ .margin
30
+ %table.productAttributes
31
+ %thead
32
+ %tr
33
+ %td= t('tienda.products.name')
34
+ %td= t('tienda.products.value')
35
+ %td.searchable= t('tienda.products.searchable?')
36
+ %td.searchable= t('tienda.products.public?')
37
+ %td.remove= t('tienda.products.remove')
38
+ %td
39
+ %tbody
40
+ %tr.template{:style => 'display:none;'}
41
+ %td= text_field_tag 'product[product_attributes_array][][key]', '', :placeholder => t('tienda.products.name')
42
+ %td= text_field_tag 'product[product_attributes_array][][value]', '', :placeholder => t('tienda.products.value')
43
+ %td.searchable= check_box_tag 'product[product_attributes_array][][searchable]', '1'
44
+ %td.searchable= check_box_tag 'product[product_attributes_array][][public]', '1'
45
+ %td.remove= link_to t('tienda.remove') , '#', :class => 'button button-mini purple'
46
+ %td.handle
47
+ - for attribute in @product.product_attributes
48
+ %tr
49
+ %td= text_field_tag 'product[product_attributes_array][][key]', attribute.key, :placeholder => t('tienda.products.name')
50
+ %td= text_field_tag 'product[product_attributes_array][][value]', attribute.value, :placeholder => t('tienda.products.value')
51
+ %td.searchable= check_box_tag 'product[product_attributes_array][][searchable]', '1', attribute.searchable?
52
+ %td.searchable= check_box_tag 'product[product_attributes_array][][public]', '1', attribute.public?
53
+ %td.remove= link_to t("tienda.remove"), '#', :class => 'button button-mini purple'
54
+ %td.handle
55
+ %p.addAttribute= link_to t('tienda.products.add_attribute') , '#', :data => {:behavior => 'addAttributeToAttributesTable'}, :class => 'button button-mini green'
56
+
57
+ = field_set_tag t('tienda.products.attachments') do
58
+ .splitContainer
59
+ %dl.half
60
+ %dt= f.label :default_image_file, t('tienda.products.default_image')
61
+ %dd
62
+ = attachment_preview @product.default_image
63
+ %p= f.file_field :default_image_file
64
+ %dl.half
65
+ %dt= f.label :data_sheet_file, t('tienda.products.datasheet')
66
+ %dd
67
+ = attachment_preview @product.data_sheet
68
+ %p= f.file_field :data_sheet_file
69
+
70
+ - unless @product.has_variants?
71
+ = field_set_tag t('tienda.products.pricing') do
72
+ .splitContainer
73
+ %dl.third
74
+ %dt= f.label :price, t('tienda.products.price')
75
+ %dd
76
+ .moneyInput
77
+ .currency= Tienda.settings.currency_unit.html_safe
78
+ = f.text_field :price, :class => 'text'
79
+ %dl.third
80
+ %dt= f.label :cost_price, t('tienda.products.cost_price')
81
+ %dd
82
+ .moneyInput
83
+ .currency= Tienda.settings.currency_unit.html_safe
84
+ = f.text_field :cost_price, :class => 'text'
85
+ %dl.third
86
+ %dt= f.label :tax_rate_id, t('tienda.products.tax_rate')
87
+ %dd= f.collection_select :tax_rate_id, Tienda::TaxRate.ordered, :id, :description, {:include_blank => true}, {:class => 'chosen-with-deselect', :data => {:placeholder => t('tienda.products.no_tax')}}
88
+
89
+ = field_set_tag t('tienda.products.stock_control') do
90
+ .splitContainer
91
+ %dl.half
92
+ %dt= f.label :weight, t('tienda.products.weight')
93
+ %dd= f.text_field :weight, :class => 'text'
94
+
95
+ %dl.half
96
+ %dt= f.label :stock_control, t('tienda.products.stock_control')
97
+ %dd.checkbox
98
+ = f.check_box :stock_control
99
+ = f.label :stock_control, t('tienda.products.enable_stock_control?')
100
+
101
+ = field_set_tag t('tienda.products.website_properties') do
102
+ .splitContainer
103
+ %dl.half
104
+ %dt= f.label :active, t('tienda.products.on_sale?')
105
+ %dd.checkbox
106
+ = f.check_box :active
107
+ = f.label :active, t('tienda.products.on_sale_info')
108
+ %dl.half
109
+ %dt= f.label :featured, t('tienda.products.featured?')
110
+ %dd.checkbox
111
+ = f.check_box :featured
112
+ = f.label :featured, t('tienda.products.featured_info')
113
+
114
+ %p.submit
115
+ - unless @product.new_record?
116
+ %span.right= link_to t('tienda.delete') , @product, :class => 'button purple', :method => :delete, :data => {:confirm => "Are you sure you wish to remove this product?"}
117
+ = f.submit t('tienda.submit'), :class => 'button green'
118
+ = link_to t('tienda.cancel'), :products, :class => 'button'
@@ -0,0 +1,42 @@
1
+ .table
2
+ %table.data
3
+ %thead
4
+ %tr
5
+ %th{:width => '20%'}= t('tienda.products.sku')
6
+ %th{:width => '40%'}= t('tienda.products.name')
7
+ %th{:width => '25%'}= t('tienda.products.price_variants')
8
+ %th{:width => '15%'}= t('tienda.products.stock')
9
+ %tbody
10
+ - if products.empty?
11
+ %tr.empty
12
+ %td{:colspan => 4}= t('tienda.products.no_products')
13
+ - else
14
+ - for category, products in products
15
+ %tr
16
+ %th{:colspan => 4}= category.name
17
+ - for product in products
18
+ %tr
19
+ %td= product.sku
20
+ %td= link_to product.name, [:edit, product]
21
+ - if product.has_variants?
22
+ %td.table{:colspan => 2}
23
+ %table.data
24
+ - for variant in product.variants
25
+ %tr
26
+ %td{:width => '40%'}= link_to variant.name, edit_product_variant_path(product, variant)
27
+ %td{:width => '30%'}= number_to_currency variant.price
28
+ %td{:width => '30%'}
29
+ - if variant.stock_control?
30
+ %span.float-right= link_to t('tienda.products.edit') , stock_level_adjustments_path(:item_type => variant.class, :item_id => variant.id), :class => 'edit', :rel => 'dialog', :data => {:dialog_width => 700, :dialog_behavior => 'stockLevelAdjustments'}
31
+ = boolean_tag(variant.in_stock?, nil, :true_text => variant.stock, :false_text => t('tienda.products.no_stock'))
32
+ - else
33
+ ∞
34
+ - else
35
+ %td= number_to_currency product.price
36
+ %td
37
+ - if product.stock_control?
38
+ %span.float-right= link_to t('tienda.products.edit'), stock_level_adjustments_path(:item_type => product.class, :item_id => product.id), :class => 'edit', :rel => 'dialog', :data => {:dialog_width => 700, :dialog_behavior => 'stockLevelAdjustments'}
39
+ = boolean_tag(product.in_stock?, nil, :true_text => product.stock, :false_text => t('tienda.products.no_stock'))
40
+ - else
41
+ ∞
42
+
@@ -0,0 +1,8 @@
1
+ - @page_title = t('tienda.products.products')
2
+ = content_for :header do
3
+ %p.buttons
4
+ = link_to t('tienda.products.variants') , [@product, :variants], :class => 'button'
5
+ = link_to t('tienda.products.stock_levels') , stock_level_adjustments_path(:item_id => @product.id, :item_type => @product.class), :class => 'button', :rel => 'dialog', :data => {:dialog_width => 700, :dialog_behavior => 'stockLevelAdjustments'}
6
+ = link_to t('tienda.products.back_to_products') , :products, :class => 'button'
7
+ %h2.products= t('tienda.products.products')
8
+ = render 'form'
@@ -0,0 +1,63 @@
1
+ - @page_title = t('tienda.products.products')
2
+
3
+ = content_for :header do
4
+ %h2.products= t('tienda.products.import_products')
5
+
6
+ = form_for "import", :url => import_products_path, :html => {:multipart => true} do |f|
7
+ = f.error_messages
8
+
9
+ = field_set_tag t('tienda.imports.file_upload') do
10
+ %dl
11
+ %dt= f.label :import_file, t('tienda.imports.required_formats')
12
+ %dd= f.file_field :import_file
13
+
14
+ = field_set_tag t('tienda.imports.example_file') do
15
+ %dl
16
+ %dd
17
+ %table.importExample
18
+ %thead
19
+ %tr
20
+ %th name
21
+ %th sku
22
+ %th description
23
+ %th short_description
24
+ %th weight
25
+ %th price
26
+ %th category_name
27
+ %th qty
28
+ %tbody
29
+ %tr
30
+ %td= t('tienda.products.imports.examples.first.name')
31
+ %td= t('tienda.products.imports.examples.first.sku')
32
+ %td= t('tienda.products.imports.examples.first.description')
33
+ %td= t('tienda.products.imports.examples.first.short_description')
34
+ %td= t('tienda.products.imports.examples.first.weight')
35
+ %td= t('tienda.products.imports.examples.first.price')
36
+ %td= t('tienda.products.imports.examples.first.category_name')
37
+ %td= t('tienda.products.imports.examples.first.qty')
38
+ %tr
39
+ %td= t('tienda.products.imports.examples.second.name')
40
+ %td= t('tienda.products.imports.examples.second.sku')
41
+ %td= t('tienda.products.imports.examples.second.description')
42
+ %td= t('tienda.products.imports.examples.second.short_description')
43
+ %td= t('tienda.products.imports.examples.second.weight')
44
+ %td= t('tienda.products.imports.examples.second.price')
45
+ %td= t('tienda.products.imports.examples.second.category_name')
46
+ %td= t('tienda.products.imports.examples.second.qty')
47
+ %tr
48
+ %td= t('tienda.products.imports.examples.third.name')
49
+ %td= t('tienda.products.imports.examples.third.sku')
50
+ %td= t('tienda.products.imports.examples.third.description')
51
+ %td= t('tienda.products.imports.examples.third.short_description')
52
+ %td= t('tienda.products.imports.examples.third.weight')
53
+ %td= t('tienda.products.imports.examples.third.price')
54
+ %td= t('tienda.products.imports.examples.third.category_name')
55
+ %td= t('tienda.products.imports.examples.third.qty')
56
+ %tr.tear-off
57
+ %td{:colspan => "8"}
58
+ %dd
59
+ %p.help= t('tienda.products.imports.help')
60
+
61
+ %p.submit
62
+ = f.submit t('tienda.import'), :class => "button green"
63
+ = link_to t('tienda.cancel'), :products, :class => "button"
@@ -0,0 +1,9 @@
1
+ - @page_title = t('tienda.products.products')
2
+
3
+ = content_for :header do
4
+ %p.buttons
5
+ = link_to t('tienda.products.new_product'), :new_product, :class => 'button green'
6
+ = link_to t('tienda.products.import_products'), :import_products, :class => 'button gray'
7
+ %h2.products= t('tienda.products.products')
8
+
9
+ = render 'table', :products => @products
@@ -0,0 +1,7 @@
1
+ - @page_title = t('tienda.products.products')
2
+
3
+ = content_for :header do
4
+ %p.buttons= link_to t('tienda.products.back_to_products') , :products, :class => 'button'
5
+ %h2.products= t('tienda.products.products')
6
+
7
+ = render 'form'
@@ -0,0 +1,12 @@
1
+ - @page_title = t('tienda.sessions.admin_login')
2
+ = display_flash
3
+ .loginArea
4
+ = form_tag :login, :class => 'login' do
5
+ %p.field
6
+ = text_field_tag 'email_address', params[:email_address], :class => 'focus', :placeholder => t('tienda.sessions.email')
7
+ %p.field
8
+ = password_field_tag 'password', params[:password], :class => '', :placeholder => t('tienda.sessions.password')
9
+ %p.submit
10
+ = submit_tag t('tienda.sessions.login'), :class => 'button green'
11
+ %p.reset
12
+ = link_to t('tienda.sessions.reset_password?'), login_reset_path
@@ -0,0 +1,12 @@
1
+ - @page_title = t('tienda.sessions.reset_password')
2
+
3
+ = display_flash
4
+ .loginArea
5
+ %h2= t('tienda.sessions.reset_password')
6
+ = form_tag :login_reset, :class => 'login' do
7
+ %p.field
8
+ = text_field_tag 'email_address', params[:email_address], :class => 'focus', :placeholder => t('tienda.sessions.email')
9
+ %p.submit
10
+ = submit_tag t('tienda.sessions.reset') , :class => 'button green'
11
+ %p.reset
12
+ = link_to t('tienda.sessions.back_to_login') , login_path
@@ -0,0 +1,19 @@
1
+ - @page_title = t("tienda.settings.settings")
2
+
3
+ = content_for :header do
4
+ %h2.settings= t("tienda.settings.settings")
5
+
6
+ = form_tag :url => settings_path do |f|
7
+
8
+ - Tienda.settings_groups.each do |group, fields|
9
+ = field_set_tag t("tienda.settings.#{group}") do
10
+ - fields.each do |f|
11
+ %dl.sided
12
+ %dt= settings_label f
13
+ %dd
14
+ = settings_field f
15
+ - if v = t("tienda.settings.help")[f]
16
+ %p.help= v
17
+
18
+ %p.submit.sided
19
+ = submit_tag t("tienda.settings.save_settings"), :class => 'button green'
@@ -0,0 +1,6 @@
1
+ - @page_title = t('tienda.shared.error')
2
+ = display_flash
3
+ .error
4
+ %h2= t('tienda.shared.error_occured')
5
+ %p.message= @exception.message
6
+ %p.back= link_to "←#{t('tienda.shared.back_to_tienda')}".html_safe, root_path, :class => 'button'
@@ -0,0 +1,40 @@
1
+ - @page_title = t('tienda.stock_level_adjustments.stock_levels_title', item_name: @item.name)
2
+
3
+ = content_for :header do
4
+ %p.buttons
5
+ - case @item
6
+ - when Tienda::Product
7
+ - @active_nav = :products
8
+ = link_to t('tienda.stock_level_adjustments.edit_product'), [:edit, @item], :class => 'button'
9
+ = link_to t('tienda.stock_level_adjustments.back_to_product'), :products, :class => 'button'
10
+
11
+ %h2.products= t('tienda.stock_level_adjustments.stock_levels_for', item_name: @item.name)
12
+
13
+ .table
14
+ %p.info
15
+ = t('tienda.stock_level_adjustments.current_stock_level_html', item_stock: @item.stock).html_safe
16
+ %span.float-right= page_entries_info @stock_level_adjustments
17
+
18
+ = form_for @new_sla do |f|
19
+ = hidden_field_tag 'item_type', params[:item_type]
20
+ = hidden_field_tag 'item_id', params[:item_id]
21
+ %table.data
22
+ %thead
23
+ %tr
24
+ %th{:width => '25%'}= t('tienda.stock_level_adjustments.date')
25
+ %th{:width => '50%'}= t('tienda.stock_level_adjustments.description')
26
+ %th{:width => '25%'}= t('tienda.stock_level_adjustments.adjustment')
27
+ %tbody
28
+ %tr.form
29
+ %td
30
+ %td.desc= f.text_field :description
31
+ %td.adjustment
32
+ = f.text_field :adjustment
33
+ = f.submit t('tienda.stock_level_adjustments.add'), :class => 'button button-mini green'
34
+ - for sla in @stock_level_adjustments
35
+ %tr
36
+ %td= l(sla.created_at, format: :long)
37
+ %td= sla.description
38
+ %td= sla.adjustment > 0 ? "+#{sla.adjustment}" : sla.adjustment
39
+
40
+ = paginate @stock_level_adjustments
@@ -0,0 +1,28 @@
1
+ - @page_title = t('tienda.tax_rates.tax_rates')
2
+ = content_for :header do
3
+ %p.buttons= link_to t('tienda.tax_rates.back_to_tax_rates'), :tax_rates, :class => 'button grey'
4
+ %h2.tax_rates= t('tienda.tax_rates.tax_rates')
5
+
6
+ = form_for @tax_rate do |f|
7
+ = f.error_messages
8
+ = field_set_tag t('tienda.tax_rates.rate_details') do
9
+ .splitContainer
10
+ %dl.half
11
+ %dt= f.label :name, t('tienda.tax_rates.name')
12
+ %dd= f.text_field :name, :class => 'focus text'
13
+ %dl.half
14
+ %dt= f.label :rate, t('tienda.tax_rates.rate')
15
+ %dd= f.text_field :rate, :class => 'text'
16
+
17
+ = field_set_tag t('tienda.tax_rates.country_restriction') do
18
+ %dl
19
+ %dd
20
+ = f.select :address_type, Tienda::TaxRate::ADDRESS_TYPES.map { |a| [t('tienda.tax_rates.address_type_option', address: t("tienda.tax_rates.#{a}")).html_safe, a]}, {}, :class => 'chosen-basic'
21
+ %dl
22
+ %dd
23
+ = f.collection_select :country_ids, Tienda::Country.ordered, :id, :name, {}, {:class => 'chosen', :multiple => true, :data => {:placeholder => t('tienda.tax_rates.all_countries') }}
24
+ %p.submit
25
+ - unless @tax_rate.new_record?
26
+ %span.right= link_to t('tienda.delete'), @tax_rate, :class => 'button purple', :method => :delete, :data => {:confirm => t('tienda.tax_rates.delete_confirmation') }
27
+ = f.submit t('tienda.submit'), :class => 'button green'
28
+ = link_to t('tienda.cancel'), :tax_rates, :class => 'button'
@@ -0,0 +1,17 @@
1
+ - @page_title = t('tienda.tax_rates.tax_rates')
2
+
3
+ = content_for :header do
4
+ %p.buttons= link_to t('tienda.tax_rates.new_tax_rate'), :new_tax_rate, :class => 'button green'
5
+ %h2.tax_rates= t('tienda.tax_rates.tax_rates')
6
+
7
+ .table
8
+ %table.data
9
+ %thead
10
+ %tr
11
+ %th= t('tienda.tax_rates.name')
12
+ %th= t('tienda.tax_rates.rate')
13
+ %tbody
14
+ - for tax_rate in @tax_rates
15
+ %tr
16
+ %td= link_to tax_rate.name, [:edit, tax_rate]
17
+ %td= tax_rate.rate
@@ -0,0 +1,9 @@
1
+ Hello <%=@user.first_name%>
2
+
3
+ Your new password for Tienda on <%=Tienda.settings.store_name%> is: <%=@user.password%>
4
+
5
+ You can login using your e-mail address.
6
+
7
+ Thanks,
8
+
9
+ The Built-in Tienda Robot
@@ -0,0 +1,27 @@
1
+ = form_for @user do |f|
2
+ = f.error_messages
3
+ = field_set_tag t('tienda.users.user_details') do
4
+ .splitContainer
5
+ %dl.half
6
+ %dt= f.label :first_name, t('tienda.users.first_name')
7
+ %dd= f.text_field :first_name, :class => 'focus text'
8
+ %dl.half
9
+ %dt= f.label :last_name, t('tienda.users.last_name')
10
+ %dd= f.text_field :last_name, :class => 'text'
11
+ = field_set_tag t("tienda.users.login") do
12
+ .splitContainer
13
+ %dl.third
14
+ %dt= f.label :email_address, t('tienda.users.email')
15
+ %dd= f.text_field :email_address, :class => 'text'
16
+ %dl.third
17
+ %dt= f.label :password, t('tienda.users.password')
18
+ %dd= f.password_field :password, :class => 'text'
19
+ %dl.third
20
+ %dt= f.label :password_confirmation, t('tienda.users.password_confirmation')
21
+ %dd= f.password_field :password_confirmation, :class => 'text'
22
+
23
+ %p.submit
24
+ - unless @user.new_record?
25
+ %span.right= link_to t('tienda.delete'), @user, :class => 'button purple', :method => :delete, :data => {:confirm => t('tienda.users.delete_confirmation')}
26
+ = f.submit t('tienda.submit'), :class => 'button green'
27
+ = link_to t('tienda.cancel'), :users, :class => 'button'
@@ -0,0 +1,5 @@
1
+ - @page_title = t('tienda.users.users')
2
+ = content_for :header do
3
+ %p.buttons= link_to t('tienda.users.back_to_users'), :users, :class => 'button'
4
+ %h2.users= t('tienda.users.users')
5
+ = render 'form'
@@ -0,0 +1,17 @@
1
+ - @page_title = t('tienda.users.users')
2
+
3
+ = content_for :header do
4
+ %p.buttons= link_to t('tienda.users.new_user'), :new_user, :class => 'button green'
5
+ %h2.users= t('tienda.users.users')
6
+
7
+ .table
8
+ %table.data
9
+ %thead
10
+ %tr
11
+ %th= t('tienda.users.name')
12
+ %th= t('tienda.users.email')
13
+ %tbody
14
+ - for user in @users
15
+ %tr
16
+ %td= link_to user.full_name, [:edit, user]
17
+ %td= user.email_address
@@ -0,0 +1,7 @@
1
+ - @page_title = t('tienda.users.users')
2
+
3
+ = content_for :header do
4
+ %p.buttons= link_to t('tienda.users.back_to_users'), :users, :class => 'button'
5
+ %h2.users= t('tienda.users.users')
6
+
7
+ = render 'form'