shoppe 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/shoppe/table-tear-off.png +0 -0
  3. data/app/assets/javascripts/shoppe/application.coffee +2 -2
  4. data/app/assets/stylesheets/shoppe/application.scss +80 -37
  5. data/app/assets/stylesheets/shoppe/elements.scss +1 -2
  6. data/app/controllers/shoppe/attachments_controller.rb +3 -3
  7. data/app/controllers/shoppe/countries_controller.rb +13 -13
  8. data/app/controllers/shoppe/delivery_service_prices_controller.rb +11 -11
  9. data/app/controllers/shoppe/delivery_services_controller.rb +13 -13
  10. data/app/controllers/shoppe/orders_controller.rb +20 -20
  11. data/app/controllers/shoppe/payments_controller.rb +8 -8
  12. data/app/controllers/shoppe/product_categories_controller.rb +13 -13
  13. data/app/controllers/shoppe/products_controller.rb +24 -13
  14. data/app/controllers/shoppe/sessions_controller.rb +7 -7
  15. data/app/controllers/shoppe/settings_controller.rb +6 -6
  16. data/app/controllers/shoppe/stock_level_adjustments_controller.rb +5 -5
  17. data/app/controllers/shoppe/tax_rates_controller.rb +13 -13
  18. data/app/controllers/shoppe/users_controller.rb +15 -15
  19. data/app/controllers/shoppe/variants_controller.rb +13 -13
  20. data/app/helpers/shoppe/application_helper.rb +12 -12
  21. data/app/models/shoppe/order/actions.rb +17 -3
  22. data/app/models/shoppe/order/billing.rb +18 -18
  23. data/app/models/shoppe/order/delivery.rb +30 -31
  24. data/app/models/shoppe/order_item.rb +33 -34
  25. data/app/models/shoppe/payment.rb +15 -15
  26. data/app/models/shoppe/product.rb +82 -21
  27. data/app/models/shoppe/product/variants.rb +10 -10
  28. data/app/models/shoppe/product_category.rb +7 -7
  29. data/app/models/shoppe/stock_level_adjustment.rb +6 -6
  30. data/app/validators/permalink_validator.rb +7 -0
  31. data/app/views/layouts/shoppe/application.html.haml +10 -20
  32. data/app/views/shoppe/countries/_form.html.haml +15 -11
  33. data/app/views/shoppe/countries/edit.html.haml +5 -4
  34. data/app/views/shoppe/countries/index.html.haml +9 -9
  35. data/app/views/shoppe/countries/new.html.haml +6 -4
  36. data/app/views/shoppe/delivery_service_prices/_form.html.haml +16 -16
  37. data/app/views/shoppe/delivery_service_prices/edit.html.haml +5 -4
  38. data/app/views/shoppe/delivery_service_prices/index.html.haml +8 -9
  39. data/app/views/shoppe/delivery_service_prices/new.html.haml +5 -4
  40. data/app/views/shoppe/delivery_services/_form.html.haml +15 -14
  41. data/app/views/shoppe/delivery_services/edit.html.haml +7 -5
  42. data/app/views/shoppe/delivery_services/index.html.haml +11 -12
  43. data/app/views/shoppe/delivery_services/new.html.haml +5 -4
  44. data/app/views/shoppe/orders/_form.html.haml +19 -19
  45. data/app/views/shoppe/orders/_order_details.html.haml +20 -15
  46. data/app/views/shoppe/orders/_order_items.html.haml +6 -6
  47. data/app/views/shoppe/orders/_order_items_form.html.haml +11 -11
  48. data/app/views/shoppe/orders/_payments_form.html.haml +4 -4
  49. data/app/views/shoppe/orders/_payments_table.html.haml +12 -12
  50. data/app/views/shoppe/orders/_search_form.html.haml +10 -10
  51. data/app/views/shoppe/orders/_status_bar.html.haml +17 -13
  52. data/app/views/shoppe/orders/despatch_note.html.haml +15 -15
  53. data/app/views/shoppe/orders/edit.html.haml +8 -8
  54. data/app/views/shoppe/orders/index.html.haml +12 -12
  55. data/app/views/shoppe/orders/new.html.haml +7 -7
  56. data/app/views/shoppe/orders/show.html.haml +9 -12
  57. data/app/views/shoppe/payments/refund.html.haml +6 -7
  58. data/app/views/shoppe/product_categories/_form.html.haml +9 -9
  59. data/app/views/shoppe/product_categories/edit.html.haml +4 -4
  60. data/app/views/shoppe/product_categories/index.html.haml +5 -5
  61. data/app/views/shoppe/product_categories/new.html.haml +4 -3
  62. data/app/views/shoppe/products/_form.html.haml +49 -50
  63. data/app/views/shoppe/products/_table.html.haml +10 -10
  64. data/app/views/shoppe/products/edit.html.haml +6 -6
  65. data/app/views/shoppe/products/import.html.haml +63 -0
  66. data/app/views/shoppe/products/index.html.haml +6 -4
  67. data/app/views/shoppe/products/new.html.haml +6 -4
  68. data/app/views/shoppe/sessions/new.html.haml +5 -5
  69. data/app/views/shoppe/sessions/reset.html.haml +6 -5
  70. data/app/views/shoppe/settings/edit.html.haml +5 -5
  71. data/app/views/shoppe/shared/error.html.haml +3 -3
  72. data/app/views/shoppe/stock_level_adjustments/index.html.haml +13 -12
  73. data/app/views/shoppe/tax_rates/form.html.haml +13 -13
  74. data/app/views/shoppe/tax_rates/index.html.haml +5 -5
  75. data/app/views/shoppe/users/_form.html.haml +10 -11
  76. data/app/views/shoppe/users/edit.html.haml +4 -4
  77. data/app/views/shoppe/users/index.html.haml +5 -5
  78. data/app/views/shoppe/users/new.html.haml +6 -4
  79. data/app/views/shoppe/variants/form.html.haml +27 -29
  80. data/app/views/shoppe/variants/index.html.haml +11 -11
  81. data/config/locales/en.yml +619 -14
  82. data/config/locales/es.yml +650 -0
  83. data/config/locales/pl.yml +650 -0
  84. data/config/locales/pt-BR.yml +643 -0
  85. data/config/routes.rb +16 -8
  86. data/db/migrate/20141026175622_add_indexes_to_shoppe_order_items.rb +6 -0
  87. data/db/migrate/20141026175943_add_indexes_to_shoppe_orders.rb +7 -0
  88. data/db/migrate/20141026180333_add_indexes_to_shoppe_payments.rb +6 -0
  89. data/db/migrate/20141026180835_add_indexes_to_shoppe_product_attributes.rb +7 -0
  90. data/db/migrate/20141026180952_add_indexes_to_shoppe_product_categories.rb +5 -0
  91. data/db/migrate/20141026181040_add_indexes_to_shoppe_products.rb +8 -0
  92. data/db/migrate/20141026181312_add_indexes_to_shoppe_settings.rb +5 -0
  93. data/db/migrate/20141026181354_add_indexes_to_shoppe_stock_level_adjustments.rb +6 -0
  94. data/db/migrate/20141026181559_add_indexes_to_shoppe_users.rb +5 -0
  95. data/db/migrate/20141026181716_add_indexes_to_shoppe_delivery_services.rb +9 -0
  96. data/db/schema.rb +36 -1
  97. data/lib/shoppe/engine.rb +6 -0
  98. data/lib/shoppe/navigation_manager.rb +1 -1
  99. data/lib/shoppe/version.rb +1 -1
  100. metadata +67 -5
@@ -1,18 +1,18 @@
1
1
  module Shoppe
2
2
  class Product < ActiveRecord::Base
3
-
3
+
4
4
  # Validations
5
- validate { errors.add :base, "can only belong to a root product" if self.parent && self.parent.parent }
6
-
5
+ validate { errors.add :base, :can_belong_to_root if self.parent && self.parent.parent }
6
+
7
7
  # Variants of the product
8
8
  has_many :variants, -> { order(:default => :desc, :name => :asc) }, :class_name => 'Shoppe::Product', :foreign_key => 'parent_id', :dependent => :destroy
9
-
9
+
10
10
  # The parent product (only applies to variants)
11
11
  belongs_to :parent, :class_name => 'Shoppe::Product', :foreign_key => 'parent_id'
12
-
12
+
13
13
  # All products which are not variants
14
14
  scope :root, -> { where(:parent_id => nil) }
15
-
15
+
16
16
  # If a variant is created, the base product should be updated so that it doesn't have stock control enabled
17
17
  after_save do
18
18
  if self.parent
@@ -24,14 +24,14 @@ module Shoppe
24
24
  self.parent.save if self.parent.changed?
25
25
  end
26
26
  end
27
-
27
+
28
28
  # Does this product have any variants?
29
29
  #
30
30
  # @return [Boolean]
31
31
  def has_variants?
32
32
  !variants.empty?
33
33
  end
34
-
34
+
35
35
  # Returns the default variant for the product or nil if none exists.
36
36
  #
37
37
  # @return [Shoppe::Product]
@@ -39,13 +39,13 @@ module Shoppe
39
39
  return nil if self.parent
40
40
  @default_variant ||= self.variants.select { |v| v.default? }.first
41
41
  end
42
-
42
+
43
43
  # Is this product a variant of another?
44
44
  #
45
45
  # @return [Boolean]
46
46
  def variant?
47
47
  !self.parent_id.blank?
48
48
  end
49
-
49
+
50
50
  end
51
51
  end
@@ -1,23 +1,23 @@
1
1
  module Shoppe
2
2
  class ProductCategory < ActiveRecord::Base
3
-
3
+
4
4
  self.table_name = 'shoppe_product_categories'
5
-
5
+
6
6
  # Categories have an image attachment
7
7
  attachment :image
8
-
8
+
9
9
  # All products within this category
10
10
  has_many :products, :dependent => :restrict_with_exception, :class_name => 'Shoppe::Product'
11
-
11
+
12
12
  # Validations
13
13
  validates :name, :presence => true
14
- validates :permalink, :presence => true, :uniqueness => true
14
+ validates :permalink, :presence => true, :uniqueness => true, :permalink => true
15
15
 
16
16
  # All categories ordered by their name ascending
17
17
  scope :ordered, -> { order(:name) }
18
-
18
+
19
19
  # Set the permalink on callback
20
20
  before_validation { self.permalink = self.name.parameterize if self.permalink.blank? && self.name.is_a?(String) }
21
-
21
+
22
22
  end
23
23
  end
@@ -1,19 +1,19 @@
1
1
  module Shoppe
2
2
  class StockLevelAdjustment < ActiveRecord::Base
3
-
3
+
4
4
  # The orderable item which the stock level adjustment belongs to
5
5
  belongs_to :item, :polymorphic => true
6
-
6
+
7
7
  # The parent (OrderItem) which the stock level adjustment belongs to
8
8
  belongs_to :parent, :polymorphic => true
9
-
9
+
10
10
  # Validations
11
11
  validates :description, :presence => true
12
12
  validates :adjustment, :numericality => true
13
- validate { errors.add(:adjustment, "must be greater or less than zero") if adjustment == 0 }
14
-
13
+ validate { errors.add(:adjustment, I18n.t('shoppe.activerecord.attributes.stock_level_adjustment.must_be_greater_or_equal_zero')) if adjustment == 0 }
14
+
15
15
  # All stock level adjustments ordered by their created date desending
16
16
  scope :ordered, -> { order(:id => :desc) }
17
-
17
+
18
18
  end
19
19
  end
@@ -0,0 +1,7 @@
1
+ class PermalinkValidator < ActiveModel::EachValidator
2
+ def validate_each(record, attribute, value)
3
+ unless value =~ /\A[a-zA-Z0-9-_]+\Z/
4
+ record.errors.add(attribute, :wrong_format)
5
+ end
6
+ end
7
+ end
@@ -13,32 +13,22 @@
13
13
  %header.logo
14
14
  %h1= link_to "Shoppe", root_path
15
15
  %p v#{Shoppe::VERSION}
16
- %p.logged
17
- Logged in as #{current_user.full_name}
16
+ %p.logged= t('.logged_in_as', user_name: current_user.full_name)
17
+
18
18
  %ul
19
19
  - for item in Shoppe::NavigationManager.find(:admin_primary).items
20
20
  %li= navigation_manager_link item
21
-
22
- -#%li
23
- -# %span.pending= Shoppe::Order.pending.count
24
- -# = link_to "Orders", [:orders], :class => @active_nav == :orders ? 'active' : ''
25
- -#%li= link_to "Products", [:products], :class => @active_nav == :products ? 'active' : ''
26
- -#%li= link_to "Product Categories", :product_categories, :class => @active_nav == :product_categories ? 'active' : ''
27
- -#%li= link_to "Delivery Services", [:delivery_services], :class => @active_nav == :delivery_services ? 'active' : ''
28
- -#%li= link_to "Tax Rates", :tax_rates, :class => @active_nav == :tax_rates ? 'active' : ''
29
- -#%li= link_to "Users", [:users], :class => @active_nav == :users ? 'active' : ''
30
- -#%li= link_to "Countries", :countries, :class => @active_nav == :countries ? 'active' : ''
31
- -#%li= link_to "Settings", :settings, :class => @active_nav == :settings ? 'active' : ''
32
- %li= link_to "Logout", [:logout], :method => :delete
33
-
21
+
22
+ %li= link_to t('.logout'), [:logout], :method => :delete
23
+
34
24
  %header.main
35
25
  = yield :header
36
-
37
- #content
26
+
27
+ #content
38
28
  = display_flash
39
29
  %section.main
40
30
  = yield
41
31
 
42
- %footer
43
- %p.store= link_to "&larr; Goto #{Shoppe.settings.store_name}".html_safe, '/'
44
-
32
+ %footer
33
+ %p.store= link_to "&larr; #{t('.goto')} #{Shoppe.settings.store_name}".html_safe, '/'
34
+
@@ -1,31 +1,35 @@
1
1
  = form_for @country do |f|
2
2
  = f.error_messages
3
- = field_set_tag "User Details" do
3
+ = field_set_tag t('shoppe.countries.country_details') do
4
+
4
5
  .splitContainer
5
6
  %dl.third
6
- %dt= f.label :name
7
+ %dt= f.label :name, t('shoppe.countries.name')
7
8
  %dd= f.text_field :name, :class => 'focus text'
8
9
  %dl.third
9
- %dt= f.label :code2, "ISO 3166-alpha-2"
10
+ %dt= f.label :code2, t('shoppe.countries.iso_alpha_2')
10
11
  %dd= f.text_field :code2, :class => 'text'
11
12
  %dl.third
12
- %dt= f.label :code3, "ISO 3166-alpha-3"
13
+ %dt= f.label :code3, t('shoppe.countries.iso_alpha_3')
13
14
  %dd= f.text_field :code3, :class => 'text'
15
+
14
16
  .splitContainer
15
17
  %dl.third
16
- %dt= f.label :continent
18
+ %dt= f.label :continent, t('shoppe.countries.continent')
17
19
  %dd= f.text_field :continent, :class => 'text'
18
20
  %dl.third
19
- %dt= f.label :tld, "TLD"
21
+ %dt= f.label :tld, t('shoppe.countries.tld')
20
22
  %dd= f.text_field :tld, :class => 'text'
21
23
  %dl.third
22
- %dt= f.label :eu_member, "EU Member?"
24
+ %dt= f.label :eu_member, t('shoppe.countries.eu_member')
23
25
  %dd.checkbox
24
26
  = f.check_box :eu_member
25
- = f.label :eu_member, 'Country is an EU member?'
27
+ = f.label :eu_member, t('shoppe.countries.is_eu_member')
26
28
 
27
29
  %p.submit
28
30
  - unless @country.new_record?
29
- %span.right= link_to "Delete", @country, :class => 'button purple', :method => :delete, :data => {:confirm => "Are you sure you wish to remove this country?"}
30
- = f.submit :class => 'button green'
31
- = link_to "Cancel", :countries, :class => 'button'
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'
@@ -1,5 +1,6 @@
1
- - @page_title = "Countries"
1
+ - @page_title = t('shoppe.countries.countries')
2
+
2
3
  = content_for :header do
3
- %p.buttons= link_to "Back to countries", :countries, :class => 'button'
4
- %h2.countries Countries
5
- = render 'form'
4
+ %p.buttons= link_to t('shoppe.countries.back'), :countries, :class => 'button'
5
+ %h2.countries= t('shoppe.countries.countries')
6
+ = render 'form'
@@ -1,19 +1,19 @@
1
- - @page_title = "Countries"
1
+ - @page_title = t('shoppe.countries.countries')
2
2
 
3
3
  = content_for :header do
4
- %p.buttons=link_to "New country", :new_country, :class => 'button green'
5
- %h2.countries Countries
4
+ %p.buttons=link_to t('shoppe.countries.new_country') , :new_country, :class => 'button green'
5
+ %h2.countries= t('shoppe.countries.countries')
6
6
 
7
7
  .table
8
8
  %table.data
9
9
  %thead
10
10
  %tr
11
- %th Name
12
- %th ISO 3166-1-alpha-2
13
- %th ISO 3166-1-alpha-3
14
- %th Continent
15
- %th TLD
16
- %th EU?
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
17
  %tbody
18
18
  - for country in @countries
19
19
  %tr
@@ -1,5 +1,7 @@
1
- - @page_title = "Countries"
1
+ - @page_title = t('shoppe.countries.countries')
2
+
2
3
  = content_for :header do
3
- %p.buttons= link_to "Back to countries", :countries, :class => 'button'
4
- %h2.countries Countries
5
- = render 'form'
4
+ %p.buttons= link_to t('shoppe.countries.back') , :countries, :class => 'button'
5
+ %h2.countries= t('shoppe.countries.countries')
6
+
7
+ = render 'form'
@@ -1,44 +1,44 @@
1
1
  = form_for [@delivery_service, @delivery_service_price] do |f|
2
2
  = f.error_messages
3
- = field_set_tag "Identification & Weight" do
3
+ = field_set_tag t('shoppe.delivery_service_prices.identification_weight') do
4
4
  .splitContainer
5
5
  %dl.third
6
- %dt= f.label :code
6
+ %dt= f.label :code, t('shoppe.delivery_service_prices.code')
7
7
  %dd= f.text_field :code, :class => 'focus text'
8
-
8
+
9
9
  %dl.third
10
- %dt= f.label :min_weight
10
+ %dt= f.label :min_weight, t('shoppe.delivery_service_prices.min_weight')
11
11
  %dd= f.text_field :min_weight, :class => 'text'
12
12
  %dl.third
13
- %dt= f.label :max_weight
13
+ %dt= f.label :max_weight, t('shoppe.delivery_service_prices.max_weight')
14
14
  %dd= f.text_field :max_weight, :class => 'text'
15
15
 
16
- = field_set_tag "Pricing" do
16
+ = field_set_tag t('shoppe.delivery_service_prices.pricing') do
17
17
  .splitContainer
18
18
  %dl.third
19
- %dt= f.label :price
19
+ %dt= f.label :price, t('shoppe.delivery_service_prices.price')
20
20
  %dd
21
21
  .moneyInput
22
22
  .currency= Shoppe.settings.currency_unit.html_safe
23
23
  = f.text_field :price, :class => 'text'
24
24
  %dl.third
25
- %dt= f.label :cost_price
25
+ %dt= f.label :cost_price, t('shoppe.delivery_service_prices.cost_price')
26
26
  %dd
27
27
  .moneyInput
28
28
  .currency= Shoppe.settings.currency_unit.html_safe
29
29
  = f.text_field :cost_price, :class => 'text'
30
30
  %dl.third
31
- %dt= f.label :tax_rate_id
32
- %dd= f.collection_select :tax_rate_id, Shoppe::TaxRate.ordered, :id, :description, {:include_blank => true}, {:class => 'chosen-with-deselect', :data => {:placeholder => "No tax"}}
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
33
 
34
- = field_set_tag "Countries" do
34
+ = field_set_tag t('shoppe.delivery_service_prices.countries') do
35
35
  %dl
36
36
  %dd
37
- = f.collection_select :country_ids, Shoppe::Country.ordered, :id, :name, {}, {:class => 'chosen', :multiple => true, :data => {:placeholder => "All countries"}}
38
- %p.help This delivery rate will only be available to orders where the country selected is listed here.
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
39
 
40
40
  %p.submit
41
41
  - unless @delivery_service_price.new_record?
42
- %span.right= link_to "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 :class => 'button green'
44
- = link_to "Cancel", [@delivery_service, :delivery_service_prices], :class => 'button'
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'
@@ -1,5 +1,6 @@
1
- - @page_title = "Delivery Services"
1
+ - @page_title = t('shoppe.delivery_service_prices.delivery_services')
2
+
2
3
  = content_for :header do
3
- %p.buttons= link_to "Back to prices", [@delivery_service, :delivery_service_prices], :class => 'button'
4
- %h2.delivery_services Delivery Services
5
- = render 'form'
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'
@@ -1,19 +1,19 @@
1
- - @page_title = "Delivery Services"
1
+ - @page_title = t('shoppe.delivery_service_prices.delivery_services')
2
2
 
3
3
  = content_for :header do
4
4
  %p.buttons
5
- = link_to "New price", [:new, @delivery_service, :delivery_service_price], :class => 'button green'
6
- = link_to "Back to delivery services", :delivery_services, :class => 'button'
7
- %h2.delivery_services Delivery Pricing for #{@delivery_service.name}
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
8
 
9
9
  .table
10
10
  %table.data
11
11
  %thead
12
12
  %tr
13
- %th Code
14
- %th Weight Allowance
15
- %th Price
16
- %th Cost
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
17
  %tbody
18
18
  - for price in @delivery_service_prices
19
19
  %tr
@@ -21,4 +21,3 @@
21
21
  %td #{number_to_weight price.min_weight} &rarr; #{number_to_weight price.max_weight}
22
22
  %td= number_to_currency(price.price)
23
23
  %td= number_to_currency price.cost_price
24
-
@@ -1,5 +1,6 @@
1
- - @page_title = "Delivery Services"
1
+ - @page_title = t('shoppe.delivery_service_prices.delivery_services')
2
+
2
3
  = content_for :header do
3
- %p.buttons= link_to "Back to prices", [@delivery_service, :delivery_service_prices], :class => 'button'
4
- %h2.delivery_services Delivery Services
5
- = render 'form'
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'
@@ -1,37 +1,38 @@
1
1
  = form_for @delivery_service do |f|
2
2
  = f.error_messages
3
- = field_set_tag "Details" do
3
+ = field_set_tag t('shoppe.delivery_services.details') do
4
4
  .splitContainer
5
5
  %dl.half
6
- %dt= f.label :name
6
+ %dt= f.label :name, t('shoppe.delivery_services.name')
7
7
  %dd= f.text_field :name, :class => 'focus text'
8
8
  %dl.half
9
- %dt= f.label :code
9
+ %dt= f.label :code, t('shoppe.delivery_services.code')
10
10
  %dd= f.text_field :code, :class => 'text'
11
11
  .splitContainer
12
12
  %dl.half
13
- %dt= f.label :active
13
+ %dt= f.label :active, t('shoppe.delivery_services.active')
14
14
  %dd.checkbox
15
15
  = f.check_box :active
16
- = f.label :active, 'Service will be available for use'
16
+ = f.label :active, t('shoppe.delivery_services.active_info')
17
17
  %dl.half
18
- %dt= f.label :default
18
+ %dt= f.label :default, t('shoppe.delivery_services.default')
19
19
  %dd.checkbox
20
20
  = f.check_box :default
21
- = f.label :default, 'Service will be used by default (if possible)'
22
- = field_set_tag "Courier" do
21
+ = f.label :default, t('shoppe.delivery_services.default_info')
22
+
23
+ = field_set_tag t('shoppe.delivery_services.courier') do
23
24
  .splitContainer
24
25
  %dl.half
25
- %dt= f.label :courier, "Courier Name"
26
+ %dt= f.label :courier, t('shoppe.delivery_services.courier_name')
26
27
  %dd= f.text_field :courier, :class => 'text'
27
28
  %dl.half
28
- %dt= f.label :tracking_url, "Tracking URL"
29
+ %dt= f.label :tracking_url, t('shoppe.delivery_services.tracking_url')
29
30
  %dd
30
31
  = f.text_field :tracking_url, :class => 'text'
31
- %p.help Use <code>{{consignment_number}}</code> to insert the consignment number.
32
+ %p.help= t('shoppe.delivery_services.tracking_url_help_html')
32
33
 
33
34
  %p.submit
34
35
  - unless @delivery_service.new_record?
35
- %span.right= link_to "Delete", [@delivery_service], :class => 'button purple', :method => :delete, :data => {:confirm => "Are you sure you wish to remove this delivery service?"}
36
- = f.submit :class => 'button green'
37
- = link_to "Cancel", :delivery_services, :class => 'button'
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'
@@ -1,7 +1,9 @@
1
- - @page_title = "Delivery Services"
1
+ - @page_title = t('shoppe.delivery_services.delivery_services')
2
+
2
3
  = content_for :header do
3
4
  %p.buttons
4
- = link_to "Prices", [@delivery_service, :delivery_service_prices], :class => 'button'
5
- = link_to "Back to delivery services", :delivery_services, :class => 'button'
6
- %h2.delivery_services Delivery Services
7
- = render 'form'
5
+ = link_to t('shoppe.delivery_services.prices'), [@delivery_service, :delivery_service_prices], :class => 'button'
6
+ = link_to t('shoppe.delivery_services.back'), :delivery_services, :class => 'button'
7
+ %h2.delivery_services= t('shoppe.delivery_services.delivery_services')
8
+
9
+ = render 'form'