synergy 0.50.0.rc2 → 0.50.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,7 +2,10 @@
2
2
  Admin::ProductsController.class_eval do
3
3
  require 'nokogiri'
4
4
  require 'open-uri'
5
-
5
+
6
+ update.before :nullify_description_if_blank
7
+ create.before :nullify_description_if_blank
8
+
6
9
  def import_from_yandex_market
7
10
  if params[:model_id].to_i > 0
8
11
  market_url = "http://market.yandex.ru/model.xml?modelid=#{params[:model_id]}"
@@ -52,9 +55,16 @@ Admin::ProductsController.class_eval do
52
55
  end
53
56
  redirect_to admin_products_path
54
57
  end
55
-
58
+
59
+ def nullify_description_if_blank
60
+ description = params[object_name][:description]
61
+ if description && ActionController::Base.helpers.strip_tags(description).gsub(' ', '').strip.empty?
62
+ params[object_name][:description] = nil
63
+ end
64
+ end
65
+
56
66
  private
57
-
67
+
58
68
  def download_remote_image(image_url)
59
69
  io = open(URI.parse(image_url))
60
70
  def io.original_filename; [base_uri.path.split('/').last, '.jpg'].join; end
@@ -0,0 +1,6 @@
1
+ Spree::BaseController.class_eval do
2
+ def render_404(exception = nil)
3
+ @title = I18n.t(:page_not_found)
4
+ render :template => 'errors/404', :status => "404 Not Found"
5
+ end
6
+ end
@@ -0,0 +1,23 @@
1
+ UserSessionsController.class_eval do
2
+ private
3
+ def associate_user
4
+ return unless current_user
5
+ guest_order = current_order
6
+ order = current_user.orders.where(:completed_at => nil).last
7
+ if order
8
+ if guest_order
9
+ guest_order.line_items.each do |line_item|
10
+ order.add_variant(line_item.variant, line_item.quantity)
11
+ end
12
+ order.save
13
+ session[:return_to].gsub!(guest_order.number, order.number) if session[:return_to]
14
+ guest_order.destroy
15
+ end
16
+ session[:order_id] = order.id
17
+ else
18
+ guest_order.associate_user!(current_user) if guest_order
19
+ end
20
+
21
+ session[:guest_token] = nil
22
+ end
23
+ end
@@ -47,22 +47,22 @@
47
47
  <table id="order_totals">
48
48
  <tr>
49
49
  <td style="width:23%;">
50
- <label id="orders_total"><%= number_with_delimiter @orders_total.to_i %>&nbsp;<%= t("number.currency.format.unit") %></label>
50
+ <label id="orders_total"><%= number_to_currency(@orders_total.round) %></label>
51
51
  <span><%= t('orders') %> (<%= t('amount') %>)</span>
52
52
  </td>
53
53
  <td class="spacer">|</td>
54
54
  <td style="width:23%;">
55
- <label id="orders_line_total"><%= number_with_delimiter @orders_line_total.to_i %>&nbsp;<%= t("number.currency.format.unit") %></label>
55
+ <label id="orders_line_total"><%= number_to_currency(@orders_line_total.round) %></label>
56
56
  <span><%== t('items') %> (<%= t('amount') %>)</span>
57
57
  </td>
58
58
  <td class="spacer">|</td>
59
59
  <td style="width:23%;">
60
- <label id="orders_adjustment_total"><%= number_with_delimiter @orders_adjustment_total.to_i %>&nbsp;<%= t("number.currency.format.unit") %></label>
60
+ <label id="orders_adjustment_total"><%= number_to_currency(@orders_adjustment_total.round) %></label>
61
61
  <span><%= t('adjustments') %></span>
62
62
  </td>
63
63
  <td class="spacer">|</td>
64
64
  <td style="width:22%">
65
- <label id="orders_adjustment_total"><%= number_with_delimiter @orders_credit_total.to_i %>&nbsp;<%= t("number.currency.format.unit") %></label>
65
+ <label id="orders_adjustment_total"><%= number_to_currency(@orders_credit_total.round) %></label>
66
66
  <span><%= t('credits') %></span>
67
67
  </td>
68
68
  </tr>
@@ -0,0 +1,7 @@
1
+ <h1><%= t(:page_not_found) %></h1>
2
+
3
+ <% content_for :sidebar do %>
4
+ <%= hook :taxon_sidebar_navigation do %>
5
+ <%= render :partial => "shared/taxonomies" %>
6
+ <% end %>
7
+ <% end %>
@@ -1,5 +1,6 @@
1
1
  ru:
2
2
  cash_on_delivery: "Наложенный платёж"
3
+ page_not_found: "Страница не найдена"
3
4
 
4
5
  activerecord:
5
6
  attributes:
@@ -0,0 +1,6 @@
1
+ ActionView::Helpers::NumberHelper.module_eval do
2
+ def number_to_currency_with_synergy(number, options = {})
3
+ number_to_currency_without_synergy(number, options).gsub(' ', "\302\240")
4
+ end
5
+ alias_method_chain :number_to_currency, :synergy
6
+ end
@@ -1,6 +1,7 @@
1
1
  # coding: utf-8
2
2
  require 'spree_core'
3
3
  require 'synergy_hooks'
4
+ require 'ext/number_helper'
4
5
 
5
6
  module Synergy
6
7
  class Engine < Rails::Engine
@@ -23,6 +24,7 @@ module Synergy
23
24
  Spree::Config.set(:default_country_id => 168)
24
25
  Spree::Config.set(:allow_ssl_in_production => false)
25
26
  Spree::Config.set(:disable_bill_address => true)
27
+ Spree::Config.set(:admin_interface_logo => "admin/logo.png")
26
28
  checkout_zone = Zone.first
27
29
  Spree::Config.set(:checkout_zone => checkout_zone.name) if checkout_zone
28
30
  end
@@ -35,7 +37,7 @@ module Synergy
35
37
  self.parameterize
36
38
  end
37
39
  end
38
-
40
+
39
41
  # зарегистрировать калькулятор для доставки наложенным платежём
40
42
  Calculator::CashOnDelivery.register
41
43
 
@@ -20,8 +20,7 @@ fields = {
20
20
  payment_method_name: "Для отображения в магазине.",
21
21
  payment_method_description: "Дополнительное описание, показывается покупателю<br />на шаге выбора способа оплаты.",
22
22
  payment_method_display_on: "Везде: способ будет доступен как покупателю, так и администратору.<br />В публичном интерфейсе: способ будет доступен только покупателю.<br />В административном интерфейсе: способ будет доступен только администратору при редактировании заказа вручную.",
23
- taxonomy_name: "Для отображения в магазине.",
24
- 'calc-type': "Правило расчета стоимости доставки.",
23
+ taxonomy_name: "Для отображения в магазине.",
25
24
  shipping_method_display_on: "Везде: способ будет доступен как покупателю, так и администратору.<br />В публичном интерфейсе: способ будет доступен только покупателю.<br />В административном интерфейсе: способ будет доступен только администратору при редактировании заказа вручную.",
26
25
  shipping_method_name: "Для отображения в магазине.",
27
26
  promotion_name: "Для отображения в магазине.",
@@ -6,3 +6,93 @@ ul#shipping-specs li {
6
6
  display: block;
7
7
  list-style-image: none;
8
8
  }
9
+
10
+ #content {
11
+ position: relative;
12
+ }
13
+
14
+ input.format-y-m-d { width: 90% }
15
+
16
+ body {
17
+ background-color: #bbb;
18
+ }
19
+
20
+ h1 {
21
+ font-weight: normal;
22
+ font-size: 18pt;
23
+ }
24
+
25
+ h2 {
26
+ font-weight: normal;
27
+ }
28
+
29
+ #logo {
30
+ margin-top: 30px;
31
+ }
32
+
33
+ #header h1 a {
34
+ color: white;
35
+
36
+ }
37
+
38
+ #login-nav {
39
+ color: black;
40
+ font-weight: bold;
41
+ }
42
+
43
+ #login-nav a {
44
+ color: black;
45
+ font-weight: normal;
46
+ }
47
+
48
+ #login-nav a:hover {
49
+ text-decoration: underline;
50
+ }
51
+
52
+ #admin-menu {
53
+ background: url("../../images/admin/bg/admin_menu_back.png") repeat-x scroll left top;
54
+ border-bottom: none;
55
+ border-right: none;
56
+ border-top: 1px solid white;
57
+ }
58
+
59
+ #admin-menu ul li:first-child {
60
+ border-left: none;
61
+ }
62
+
63
+ #admin-menu ul li a {
64
+ color: black;
65
+ }
66
+
67
+ #admin-menu ul li.selected a {
68
+ color: white;
69
+ background-color: transparent;
70
+ }
71
+
72
+ #admin-menu ul li.selected {
73
+ border-style: none;
74
+ border-top: 1px solid black;
75
+ background: #3d3d3d;
76
+ }
77
+
78
+ #sub-menu {
79
+ background: url("../../images/admin/bg/admin_sub_menu_back.png") repeat-x scroll left top;
80
+ border-top: 1px solid black;
81
+ box-shadow: #A1A1A1 0 -1px 0;
82
+ border-left: none;
83
+ border-right: none;
84
+ }
85
+
86
+ #sub-menu ul li a {
87
+ color: white;
88
+ margin: 8px 5px;
89
+ }
90
+
91
+ #sub-menu ul li.selected a {
92
+ color: #00d1fc;
93
+ text-shadow: #3a3a3a 0 1px 0;
94
+ background: #595959;
95
+ border: 1px solid #333;
96
+ border-right-color: #999;
97
+ border-bottom-color: #999;
98
+ }
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.platform = Gem::Platform::RUBY
3
3
  s.name = 'synergy'
4
- s.version = '0.50.0.rc2'
4
+ s.version = '0.50.0'
5
5
  s.summary = 'Russian e-commerce solution based on Spree'
6
6
  #s.description = 'Add (optional) gem description here'
7
7
  s.required_ruby_version = '>= 1.8.7'
@@ -25,6 +25,6 @@ Gem::Specification.new do |s|
25
25
  s.add_dependency('spree_robokassa', '~> 0.50.0')
26
26
  s.add_dependency('spree_yandex_market', '~> 1.2.0')
27
27
  s.add_dependency('spree_online_support', '~> 0.50.0')
28
- s.add_dependency('spree_address_book', '~> 0.50.0')
28
+ s.add_dependency('spree_address_book', '~> 0.50.1')
29
29
  s.add_dependency('spree_dynamic_sitemaps', '~> 0.50.1')
30
30
  end
metadata CHANGED
@@ -1,13 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: synergy
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: true
4
+ prerelease: false
5
5
  segments:
6
6
  - 0
7
7
  - 50
8
8
  - 0
9
- - rc2
10
- version: 0.50.0.rc2
9
+ version: 0.50.0
11
10
  platform: ruby
12
11
  authors:
13
12
  - Roman Smirnov
@@ -15,7 +14,7 @@ autorequire:
15
14
  bindir: bin
16
15
  cert_chain: []
17
16
 
18
- date: 2011-05-06 00:00:00 +04:00
17
+ date: 2011-05-12 00:00:00 +04:00
19
18
  default_executable:
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency
@@ -154,8 +153,8 @@ dependencies:
154
153
  segments:
155
154
  - 0
156
155
  - 50
157
- - 0
158
- version: 0.50.0
156
+ - 1
157
+ version: 0.50.1
159
158
  type: :runtime
160
159
  version_requirements: *id010
161
160
  - !ruby/object:Gem::Dependency
@@ -187,11 +186,14 @@ files:
187
186
  - Rakefile
188
187
  - app/controllers/admin/products_controller_decorator.rb
189
188
  - app/controllers/checkout_controller_decorator.rb
189
+ - app/controllers/spree/base_controller_decorator.rb
190
+ - app/controllers/user_sessions_controller_decorator.rb
190
191
  - app/models/calculator/cash_on_delivery.rb
191
192
  - app/models/order_decorator.rb
192
193
  - app/models/taxon_decorator.rb
193
194
  - app/views/admin/overview/index.html.erb
194
195
  - app/views/admin/products/index.html.erb
196
+ - app/views/errors/404.html.erb
195
197
  - app/views/order_mailer/cancel_email.text.erb
196
198
  - app/views/order_mailer/confirm_email.text.erb
197
199
  - app/views/shared/_filters.html.erb
@@ -216,11 +218,15 @@ files:
216
218
  - db/sample/preferences.yml
217
219
  - db/sample/shipping_categories.yml
218
220
  - db/sample/shipping_methods.yml
221
+ - lib/ext/number_helper.rb
219
222
  - lib/synergy.rb
220
223
  - lib/synergy_hooks.rb
221
224
  - lib/tasks/install.rake
222
225
  - lib/tasks/synergy.rake
226
+ - public/images/admin/bg/admin_menu_back.png
227
+ - public/images/admin/bg/admin_sub_menu_back.png
223
228
  - public/images/admin/icons/help.png
229
+ - public/images/admin/logo.png
224
230
  - public/javascripts/admin/inline_help.js
225
231
  - public/javascripts/admin/jquery.simpletip-1.3.1.pack.js
226
232
  - public/stylesheets/admin/inline_help.css
@@ -247,13 +253,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
247
253
  version: 1.8.7
248
254
  required_rubygems_version: !ruby/object:Gem::Requirement
249
255
  requirements:
250
- - - ">"
256
+ - - ">="
251
257
  - !ruby/object:Gem::Version
252
258
  segments:
253
- - 1
254
- - 3
255
- - 1
256
- version: 1.3.1
259
+ - 0
260
+ version: "0"
257
261
  requirements:
258
262
  - none
259
263
  rubyforge_project: