synergy 0.50.0 → 0.60.0.RC1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (31) hide show
  1. data/README.md +6 -2
  2. data/app/controllers/admin/base_controller_decorator.rb +16 -0
  3. data/app/controllers/admin/orders_controller_decorator.rb +6 -0
  4. data/app/controllers/admin/products_controller_decorator.rb +5 -4
  5. data/app/controllers/checkout_controller_decorator.rb +1 -2
  6. data/app/controllers/orders_controller_decorator.rb +7 -0
  7. data/app/helpers/checkout_helper.rb +32 -0
  8. data/app/models/payment_method/sber_bank_invoice.rb +14 -0
  9. data/app/views/admin/orders/courier_instruction.html.erb +68 -0
  10. data/app/views/admin/payments/source_forms/_sberbankinvoice.html.erb +0 -0
  11. data/app/views/admin/payments/source_views/_sberbankinvoice.html.erb +0 -0
  12. data/app/views/admin/shared/_tabs.html.erb +6 -0
  13. data/app/views/checkout/payment/_sberbankinvoice.html.erb +0 -0
  14. data/app/views/errors/404.html.erb +11 -0
  15. data/app/views/orders/sberbank_invoice.html.erb +74 -0
  16. data/app/views/orders/show.html.erb +17 -0
  17. data/app/views/user_mailer/reset_password_instructions.text.erb +11 -0
  18. data/config/locales/ru.yml +63 -0
  19. data/config/locales/sberbank_ru.yml +10 -0
  20. data/config/routes.rb +2 -0
  21. data/lib/ext/number_helper.rb +2 -0
  22. data/lib/synergy.rb +21 -4
  23. data/lib/synergy_hooks.rb +6 -0
  24. data/public/500.html +28 -0
  25. data/public/javascripts/admin/inline_help.js +5 -2
  26. data/public/stylesheets/admin/inline_help.css +1 -1
  27. data/public/stylesheets/admin/synergy.css +9 -0
  28. data/public/stylesheets/courier_instruction.css +136 -0
  29. data/public/stylesheets/reset.css +42 -0
  30. data/synergy.gemspec +10 -10
  31. metadata +45 -25
data/README.md CHANGED
@@ -19,7 +19,8 @@ Synergy
19
19
  1. Добавьте в Gemfile следующие строки:
20
20
 
21
21
  gem 'mysql2', '0.2.7'
22
- gem 'spree', '~> 0.50.2'
22
+ gem 'russian', :git => 'git://github.com/yaroslav/russian.git'
23
+ gem 'spree', '~> 0.60.0'
23
24
  gem 'spree_i18n', :git => 'git://github.com/spree/spree_i18n.git'
24
25
  gem 'spree_static_content'
25
26
  gem 'spree_editor'
@@ -28,7 +29,8 @@ Synergy
28
29
  gem 'spree_yandex_market'
29
30
  gem 'spree_address_book'
30
31
  gem 'spree_dynamic_sitemaps'
31
- gem 'synergy', '~> 0.50.0.rc1'
32
+ gem 'synergy', '~> 0.50.0'
33
+ gem 'synergy_default_theme', '1.0.1'
32
34
 
33
35
  1. Выполните следующие команды:
34
36
 
@@ -36,8 +38,10 @@ Synergy
36
38
  rails g spree:site -f
37
39
  rake spree:install
38
40
  rake synergy:install
41
+ rake synergy_default_theme:install
39
42
  rake db:migrate
40
43
  rake db:seed db:sample
44
+ rake db:admin:create
41
45
  rails s
42
46
 
43
47
 
@@ -0,0 +1,16 @@
1
+ # coding: utf-8
2
+ Admin::BaseController.class_eval do
3
+ def flash_message_for(object, event_sym)
4
+ resource_i18n_class_name = object.class.model_name.human.mb_chars
5
+ resource_desc = resource_i18n_class_name
6
+ resource_desc += " \"#{object.name}\"" if object.respond_to?(:name)
7
+
8
+ if (resource_i18n_class_name =~ /[ое](\s|$)/)
9
+ I18n.t("it_#{event_sym}", :resource => resource_desc)
10
+ elsif (resource_i18n_class_name =~ /[ая](\s|$)/)
11
+ I18n.t("she_#{event_sym}", :resource => resource_desc)
12
+ else
13
+ I18n.t(event_sym, :resource => resource_desc)
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,6 @@
1
+ Admin::OrdersController.class_eval do
2
+ def courier_instruction
3
+ @order = Order.find_by_number(params[:id])
4
+ render :layout => false
5
+ end
6
+ end
@@ -26,9 +26,9 @@ Admin::ProductsController.class_eval do
26
26
  end
27
27
 
28
28
  taxon_name = doc.css(".b-breadcrumbs a").last.content
29
- price = doc.css(".price span").first.content.gsub(nbsp, '')
29
+ price = doc.css(".b-model-prices__avg span").first.content.gsub(nbsp, '')
30
30
  image_urls = doc.css("#model-pictures a").map{|link| link['href'] }
31
- name = doc.css("#global-model-name").first.content
31
+ name = doc.css(".b-page-title").first.content
32
32
 
33
33
  p = Product.new(:name => name, :price => price)
34
34
  p.available_on = Time.now if params[:available]
@@ -50,8 +50,9 @@ Admin::ProductsController.class_eval do
50
50
  flash[:notice] = "Данные о товаре \"#{p.name}\" успешно скачены с Яндекс.Маркет"
51
51
  end
52
52
  end
53
- rescue
54
- flash[:error] = "Данные о товаре не удалось взять с Яндекс.Маркет, проверьте ID товара и наличие полной информации о нём по ссылке #{market_url}"
53
+ rescue Exception => error
54
+ flash[:notice] = "Данные о товаре не удалось взять с Яндекс.Маркет, проверьте ID товара и наличие полной информации о нём по ссылке #{market_url}."
55
+ flash[:error] = error.backtrace.find{|line| line =~ /#{__FILE__}/}.to_s + "(#{$!})"
55
56
  end
56
57
  redirect_to admin_products_path
57
58
  end
@@ -3,8 +3,7 @@ CheckoutController.class_eval do
3
3
 
4
4
  def after_payment
5
5
  if @order.shipping_method.calculator.is_a?(Calculator::CashOnDelivery)
6
- @order.complete_without_payment!
7
- after_complete
6
+ @order.confirm_without_payment!
8
7
  end
9
8
  end
10
9
  end
@@ -0,0 +1,7 @@
1
+ OrdersController.class_eval do
2
+ def sberbank_invoice
3
+ @order = Order.find_by_number(params[:id])
4
+ @preferences = @order.payment_method.preferences
5
+ render :layout => false
6
+ end
7
+ end
@@ -0,0 +1,32 @@
1
+ module CheckoutHelper
2
+
3
+ def checkout_states
4
+ %w(address delivery payment confirm)
5
+ end
6
+
7
+ # TODO: this can be deleted from extension after Spree 0.70.0 release
8
+ def checkout_progress
9
+ states = checkout_states
10
+ items = states.map do |state|
11
+ text = t("order_state.#{state}").titleize
12
+
13
+ css_classes = []
14
+ current_index = states.index(@order.state)
15
+ state_index = states.index(state)
16
+
17
+ if state_index < current_index
18
+ css_classes << 'completed'
19
+ text = link_to text, checkout_state_path(state)
20
+ end
21
+
22
+ css_classes << 'next' if state_index == current_index + 1
23
+ css_classes << 'current' if state == @order.state
24
+ css_classes << 'first' if state_index == 0
25
+ css_classes << 'last' if state_index == states.length - 1
26
+ # It'd be nice to have separate classes but combining them with a dash helps out for IE6 which only sees the last class
27
+ content_tag('li', content_tag('span', text), :class => css_classes.join('-'))
28
+ end
29
+ content_tag('ol', raw(items.join("\n")), :class => 'progress-steps', :id => "checkout-step-#{@order.state}")
30
+ end
31
+
32
+ end
@@ -0,0 +1,14 @@
1
+ class PaymentMethod::SberBankInvoice < PaymentMethod::Check
2
+ preference :recipient, :string
3
+ preference :inn, :string
4
+ preference :kpp, :string
5
+ preference :corr, :string
6
+ preference :bik, :string
7
+ preference :settlement_acc, :string
8
+ preference :recipient_bank, :string
9
+ preference :recipient_bank_city, :string
10
+
11
+ def desc
12
+ "<p>#{I18n.t('sberbank_invoice')}</p>".html_safe
13
+ end
14
+ end
@@ -0,0 +1,68 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Товарный чек</title>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
6
+
7
+ <link rel="shortcut icon" type="image/vnd.microsoft.icon" href="/favicon.ico">
8
+ <link rel="icon" type="image/png" href="/favicon.png"/>
9
+
10
+ <%= stylesheet_link_tag 'reset' %>
11
+ <%= stylesheet_link_tag 'courier_instruction', :media => :all %>
12
+
13
+ </head>
14
+ <body>
15
+ <div id="main">
16
+ <header>
17
+ <div id="header">
18
+ <h1><%= Spree::Config[:site_name] %></h1>
19
+
20
+ <div class="site_url"><%= Spree::Config[:site_url] %></div>
21
+ <div class="store_email"><%= Spree::Config[:store_email] %></div>
22
+ <div class="store_phone"><%= Spree::Config[:store_phone] %></div>
23
+
24
+ </div>
25
+ </header>
26
+ <section>
27
+ <div id="content">
28
+ <h1>Заказ №<%= @order.number %> от <%= Russian::strftime(@order.completed_at, "%d %B %Y г.") %></h1>
29
+
30
+ <h2>Адрес доставки:</h2>
31
+ <div><%= @order.ship_address.address1 %></div>
32
+
33
+ <h2>Контактное лицо:</h2>
34
+ <div><%= @order.ship_address.full_name %></div>
35
+ <div><%= @order.ship_address.phone %></div>
36
+
37
+ <table class="order_line_items" cellspacing="0" cellpadding="0" style="border-collapse: collapse;">
38
+ <colgroup>
39
+ <col width="50"/>
40
+ <col/>
41
+ <col width="100"/>
42
+ </colgroup>
43
+ <tr>
44
+ <th>№</th>
45
+ <th>Наименование товара</th>
46
+ <th>Кол-во</th>
47
+ </tr>
48
+ <% if @order.line_items.any? %>
49
+ <% @order.line_items.each_with_index do |li, index| %>
50
+ <tr>
51
+ <td><%= index + 1 %></td>
52
+ <td><%= li.product.name %></td>
53
+ <td style="text-align: right"><%= li.quantity %></td>
54
+ </tr>
55
+ <% end %>
56
+ <% end %>
57
+ </table>
58
+ <div id="total_desc">Всего наименований: <%= @order.line_items.count %></div>
59
+ <div id="seller">
60
+ <div id="order_delivered">Заказ доставил&nbsp;________________/______________/ &nbsp; "___" __________ 2011</div>
61
+ <div id="order_recieved">Заказ получил&nbsp;&nbsp;________________/______________/ &nbsp; "___" __________ 2011</div>
62
+ </div>
63
+ </div>
64
+ </section>
65
+ </div>
66
+ <script type="text/javascript"> window.print(); </script>
67
+ </body>
68
+ </html>
@@ -0,0 +1,6 @@
1
+ <%= tab :overview, :route => :admin %>
2
+ <%= tab :orders, :payments, :creditcard_payments, :shipments, :creditcards, :return_authorizations %>
3
+ <%= tab :products , :option_types, :properties, :prototypes, :variants, :product_properties, :taxons, :product_groups, :reviews, :vasia %>
4
+ <%= tab :reports %>
5
+ <%= tab :configurations, :general_settings, :mail_methods, :tax_categories, :zones, :states, :payment_methods, :inventory_settings, :taxonomies, :shipping_methods, :trackers, :editor_settings, :online_support_settings, :authentication_methods, :label => 'configuration' %>
6
+ <%= tab :users %>
@@ -1,5 +1,16 @@
1
1
  <h1><%= t(:page_not_found) %></h1>
2
2
 
3
+ <p>Запрошенному вами URL не соответствует ни одна страница сайта.</p>
4
+ <p>Возможные причины:</p>
5
+ <ul>
6
+ <li>Вам могли прислать неверную ссылку.</li>
7
+ <li>Вы могли набрать адрес с ошибкой.</li>
8
+ <li>Страница могла быть удалена с изменением структуры сайта.</li>
9
+ <li>Товар более недоступен для продажи.</li>
10
+ </ul>
11
+
12
+ <p>Если вы уверены, что адрес правильный, попробуйте начать поиск информации с <%= link_to 'главной страницы сайта', '/' %></p>
13
+
3
14
  <% content_for :sidebar do %>
4
15
  <%= hook :taxon_sidebar_navigation do %>
5
16
  <%= render :partial => "shared/taxonomies" %>
@@ -0,0 +1,74 @@
1
+ <html>
2
+ <header>
3
+ <style>
4
+ td{font:normal 12px/140% Verdana,Geneva, sans-serif;
5
+ color:#000;
6
+ padding:5px;
7
+ text-align:left;}
8
+ .kvit{border:1px solid #000;
9
+ border-collapse:collapse;
10
+ width:650px;}
11
+ .kvit .dashed{border:1px solid #000;
12
+ border-bottom:1px dashed #000;
13
+ border-collapse:collapse;}
14
+ .kvit .nodashed{border:1px solid #000;
15
+ border-top:none;
16
+ border-collapse:collapse;}
17
+ table{border:1px solid #8a8a8a;
18
+ border-collapse:collapse;
19
+ width:415px;}
20
+ table td{border:1px solid #8a8a8a;
21
+ border-collapse:collapse;}
22
+ .comment{border-top:1px solid #8a8a8a;
23
+ margin:3px 0 10px;}
24
+ </style>
25
+ </header>
26
+ <body>
27
+ <table cellpadding="3" class="kvit">
28
+ <% 2.times do %>
29
+ <tr>
30
+ <td align="left" width="230" class="dashed">
31
+ &nbsp;&nbsp;<b>КВИТАНЦИЯ</b>
32
+ <%== '<br />' * 14 %>
33
+ &nbsp;&nbsp;Кассир<br /><br />
34
+ </td>
35
+ <td align="right" width="415" class="dashed">
36
+ <table border="0" cellpadding="0">
37
+ </tr>
38
+ <td colspan="3">
39
+ Получатель платежа: <%= @preferences['recipient'] %><br />
40
+ ИНН <%= @preferences['inn'] %> / КПП <%= @preferences['kpp'] %><br />
41
+ Корр.сч. <%= @preferences['corr'] %> БИК <%= @preferences['bik'] %><br />
42
+ Расч. сч. <%= @preferences['settlement_acc'] %> в <%= @preferences['recipient_bank'] %>, г.&nbsp;<%= @preferences['recipient_bank_city'] %>
43
+ </td>
44
+ </tr>
45
+ <tr>
46
+ <td COLSPAN="3"><%= @order.ship_address.zipcode %>, г.&nbsp;<%= @order.ship_address.city %>, <%= [@order.ship_address.address1, @order.ship_address.address2].join %>
47
+ <div align="center" class="comment"><small>Адрес плательщика</small></div>
48
+ </td>
49
+ </tr>
50
+ <tr>
51
+ <td align="center">Вид платежа</td>
52
+ <td align="center">Дата</td>
53
+ <td align="center">Сумма</td>
54
+ </tr>
55
+ <tr>
56
+ <td align="left">Оплата заказа № <%= @order.number %></td>
57
+ <td width="" valign="bottom"><%= Time.now.strftime("%d.%m.%Y") %></td>
58
+ <td width="" valign="bottom"><%= @order.total.to_i %>&nbsp;руб.&nbsp;00&nbsp;коп.</td>
59
+ </tr>
60
+ <tr>
61
+ <td colspan="3" valign="center"><br><small>Плательщик (ФИО, подпись):</small>&nbsp;<em><%= [@order.ship_address.lastname, @order.shipment.address.firstname, @order.shipment.address.secondname].join(' ') %></em></td>
62
+ </tr>
63
+ </table>
64
+ </td>
65
+ </tr>
66
+ <% end %>
67
+ </table><script language="JavaScript" type="text/JavaScript">
68
+ //setTimeout('window.print()',1000);
69
+ </script>
70
+ </body>
71
+ </html>
72
+
73
+
74
+
@@ -0,0 +1,17 @@
1
+ <h1><%= accurate_title %></h1>
2
+
3
+ <div id="order">
4
+ <% if params.has_key? :checkout_complete %>
5
+ <h3><%= t('thank_you_for_your_order') %></h3>
6
+ <% end %>
7
+ <%= render :partial => 'shared/order_details', :locals => {:order => @order} %>
8
+ <p>
9
+ <%= link_to t('back_to_store'), root_path %>
10
+ <% unless params.has_key? :checkout_complete %>
11
+ | <%= link_to t('my_account'), account_path if current_user%>
12
+ <% end %>
13
+ </p>
14
+ <% if @order.payment_method.is_a?(PaymentMethod::SberBankInvoice) %>
15
+ <%= link_to t('print_sberbank_invoice'), orders_sberbank_invoice_path %>
16
+ <% end %>
17
+ </div>
@@ -0,0 +1,11 @@
1
+ Добрый день.
2
+
3
+ С вашего адреса был сделан запрос на сброс пароля.
4
+ Если вы этого не делали, проигнорируйте это письмо.
5
+
6
+ Если вы действительно запрашивали сброс пароля, перейдите по ссылке ниже:
7
+
8
+ <%= @edit_password_reset_url %>
9
+
10
+ Если ссылка не открывается, попробуйте скопировать ее и вставить в адресную строку вашего браузера.
11
+ Если вам не удалось сбросить пароль, свяжитесь пожалуйста с администрацией магазина.
@@ -1,6 +1,16 @@
1
1
  ru:
2
2
  cash_on_delivery: "Наложенный платёж"
3
+ sberbank_invoice: "Квитанция СберБанка"
3
4
  page_not_found: "Страница не найдена"
5
+ courier_instructions: "Поручение курьеру"
6
+
7
+ it_successfully_created: "%{resource} успешно создано!"
8
+ it_successfully_removed: "%{resource} успешно удалено!"
9
+ it_successfully_updated: "%{resource} успешно обновлено!"
10
+
11
+ she_successfully_created: "%{resource} успешно создана!"
12
+ she_successfully_removed: "%{resource} успешно удалена!"
13
+ she_successfully_updated: "%{resource} успешно обновлена!"
4
14
 
5
15
  activerecord:
6
16
  attributes:
@@ -18,6 +28,59 @@ ru:
18
28
  one: "Адрес"
19
29
  few: "Адреса"
20
30
  other: "Адресов"
31
+
32
+ adjustment:
33
+ one: Надбавка
34
+ other: Надбавки
35
+ calculator:
36
+ one: Калькулятор
37
+ other: Калькуляторы
38
+ configuration:
39
+ one: Конфигурация
40
+ other: Конфигурации
41
+ mail_method:
42
+ one: Метод отправки почты
43
+ other: Методы отправки почты
44
+ option_type:
45
+ one: Тип опции
46
+ other: Типы опций
47
+ option_value:
48
+ one: Значение опции
49
+ other: Значения опции
50
+ page:
51
+ one: Страница
52
+ other: Страницы
53
+ payment_method:
54
+ one: Способ оплаты
55
+ other: Способы оплаты
56
+ preference:
57
+ one: Настройка
58
+ other: Настройки
59
+ product_option_type:
60
+ one: Тип опции продукта
61
+ other: Типы опций продукта
62
+ product_property:
63
+ one: Свойство товара
64
+ other: Свойства товара
65
+ product_scope:
66
+ one: Фильтр
67
+ other: Фильтры
68
+ promotion:
69
+ one: Промо-акция
70
+ other: Промо-акции
71
+ promotion_rule:
72
+ one: Правило промо-акции
73
+ other: Правила промо-акции
74
+ shipping_method:
75
+ one: Способ доставки
76
+ other: Способы доставки
77
+ tracker:
78
+ one: Трекер
79
+ other: Трекеры
80
+
81
+ errors:
82
+ messages:
83
+ blank: "не может быть пустым"
21
84
 
22
85
  errors_prohibited_this_record_from_being_saved:
23
86
  one: "1 ошибка не позволяет сохранить запись в базе"
@@ -0,0 +1,10 @@
1
+ ru:
2
+ recipient: Получатель платежа
3
+ inn: ИНН
4
+ kpp: КПП
5
+ corr: Корр.сч.
6
+ bik: БИК
7
+ settlement_acc: Расч. сч.
8
+ recipient_bank: Банк получатель
9
+ recipient_bank_city: Город банка получателя
10
+ print_sberbank_invoice: Напечатать квитанцию Сбербанка
data/config/routes.rb CHANGED
@@ -1,4 +1,6 @@
1
1
  Rails.application.routes.draw do
2
2
  # Add your extension routes here
3
3
  match "/admin/products/import_from_yandex_market" => "admin/products#import_from_yandex_market", :as => :import_from_yandex_market
4
+ match "/admin/orders/:id/courier_instruction" => "admin/orders#courier_instruction", :as => :orders_courier_instruction
5
+ match "/orders/:id/sberbank_invoice" => "orders#sberbank_invoice", :as => :orders_sberbank_invoice
4
6
  end
@@ -1,3 +1,5 @@
1
+ # coding: utf-8
2
+
1
3
  ActionView::Helpers::NumberHelper.module_eval do
2
4
  def number_to_currency_with_synergy(number, options = {})
3
5
  number_to_currency_without_synergy(number, options).gsub(' ', "\302\240")
data/lib/synergy.rb CHANGED
@@ -27,6 +27,12 @@ module Synergy
27
27
  Spree::Config.set(:admin_interface_logo => "admin/logo.png")
28
28
  checkout_zone = Zone.first
29
29
  Spree::Config.set(:checkout_zone => checkout_zone.name) if checkout_zone
30
+ # store email address
31
+ Spree::Config.set(:store_email => 'test@site.ru') unless Spree::Config[:store_email]
32
+ # store phone
33
+ Spree::Config.set(:store_phone => '+7 (495) 1234567') unless Spree::Config[:store_phone]
34
+ # store address
35
+ #Spree::Config.set(:store_address => 'Somewhere st. Nowhere')
30
36
  end
31
37
 
32
38
  ADDRESS_FIELDS.clear << ["lastname", "firstname", "secondname", "country", "state", "city", "zipcode", "address1", "phone"]
@@ -41,10 +47,21 @@ module Synergy
41
47
  # зарегистрировать калькулятор для доставки наложенным платежём
42
48
  Calculator::CashOnDelivery.register
43
49
 
44
- # добавить событие для перехода от шага доставки к шагу завершения, минуя шаг оплаты
45
- complete_event = StateMachine::Event.new(Order.state_machine, :complete_without_payment)
46
- complete_event.transition(:to => 'complete')
47
- Order.state_machine.events << complete_event
50
+ PaymentMethod::SberBankInvoice.register
51
+
52
+ # добавить событие для перехода от шага доставки к шагу подтверждения, минуя шаг оплаты
53
+ confirm_event = StateMachine::Event.new(Order.state_machine, :confirm_without_payment)
54
+ confirm_event.transition :to => 'confirm'
55
+ Order.state_machine.events << confirm_event
56
+
57
+ # переопределение события :next для отображения шага подтверждения в любом случае
58
+ next_event = StateMachine::Event.new(Order.state_machine, :next)
59
+ next_event.transition :from => 'cart', :to => 'address'
60
+ next_event.transition :from => 'address', :to => 'delivery'
61
+ next_event.transition :from => 'delivery', :to => 'payment'
62
+ next_event.transition :from => 'payment', :to => 'confirm'
63
+ next_event.transition :from => 'confirm', :to => 'complete'
64
+ Order.state_machine.events << next_event
48
65
  end
49
66
 
50
67
  config.to_prepare &method(:activate).to_proc
data/lib/synergy_hooks.rb CHANGED
@@ -1,4 +1,10 @@
1
1
  class SecointHooks < Spree::ThemeSupport::HookListener
2
+ insert_before :admin_order_show_buttons do
3
+ %(
4
+ <%= button_link_to t("courier_instructions"), orders_courier_instruction_path(@order) if @order.completed_at %>
5
+ )
6
+ end
7
+
2
8
  insert_after :admin_inside_head do
3
9
  %(
4
10
  <%= javascript_include_tag 'admin/inline_help.js', 'admin/jquery.simpletip-1.3.1.pack.js' %>
data/public/500.html ADDED
@@ -0,0 +1,28 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>500 Internal Server Error</title>
5
+ <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
6
+ <style type="text/css">
7
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
8
+ div.dialog {
9
+ width: 25em;
10
+ padding: 0 4em;
11
+ margin: 4em auto 0 auto;
12
+ border: 1px solid #ccc;
13
+ border-right-color: #999;
14
+ border-bottom-color: #999;
15
+ }
16
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
17
+ </style>
18
+ </head>
19
+
20
+ <body>
21
+ <!-- This file lives in public/500.html -->
22
+ <div class="dialog">
23
+ <h1>500 Internal Server Error</h1>
24
+ <p>В процессе обработки вашего запроса произошла неожиданная ошибка сервера.</p>
25
+ <p><a href='/'>Вернуться в интернет-магазин</a></p>
26
+ </div>
27
+ </body>
28
+ </html>
@@ -34,8 +34,11 @@ fields = {
34
34
 
35
35
  function register_help() {
36
36
  jQuery.each(fields, function(element_id, help_msg) {
37
- jQuery('label[for='+element_id+']').after("&nbsp;<span class='help' id='help_"+element_id+"'><img src='/images/admin/icons/help.png' alt='help' /></span>");
38
- jQuery('#help_'+element_id).simpletip({ position: 'right', offset: [-10, -230], content: help_msg});
37
+ if (jQuery('#help_'+element_id).length == 0)
38
+ {
39
+ jQuery('label[for='+element_id+']').append("&nbsp;<span class='help' id='help_"+element_id+"'><img src='/images/admin/icons/help.png' alt='help' /></span>");
40
+ jQuery('#help_'+element_id).simpletip({ position: 'right', offset: [-10, -230], content: help_msg});
41
+ }
39
42
  });
40
43
  }
41
44
 
@@ -10,7 +10,7 @@
10
10
  font-family: sans-serif;
11
11
  font-size: 12px;
12
12
  line-height: 18px;
13
- text-align: center;
13
+ text-align: left;
14
14
  }
15
15
 
16
16
  .tooltip h3{
@@ -9,6 +9,7 @@ ul#shipping-specs li {
9
9
 
10
10
  #content {
11
11
  position: relative;
12
+ min-height: 640px;
12
13
  }
13
14
 
14
15
  input.format-y-m-d { width: 90% }
@@ -96,3 +97,11 @@ h2 {
96
97
  border-right-color: #999;
97
98
  border-bottom-color: #999;
98
99
  }
100
+
101
+ a.button span, .actions a {
102
+ white-space: nowrap;
103
+ }
104
+
105
+ .toolbar {
106
+ margin-bottom: 0;
107
+ }
@@ -0,0 +1,136 @@
1
+ /* ----- */
2
+
3
+ html, body {
4
+ height: 100%;
5
+ }
6
+ body {
7
+ font-family: 'Verdana', sans-serif;
8
+ color: black;
9
+ font-size: 15px;
10
+ line-height: 1.4em;
11
+ }
12
+
13
+ div, img {
14
+ position: relative;
15
+ }
16
+
17
+ #main {
18
+ width: 900px;
19
+ margin: 0 auto;
20
+ }
21
+
22
+ @media print {
23
+
24
+ #main {
25
+ width: 100%;
26
+ margin: 0 auto;
27
+ }
28
+
29
+ }
30
+
31
+ h1, h2, h3, h4, h5, h6 {
32
+ font-family: "Times New Roman", serif
33
+ }
34
+ h1 { font-size: 24px; text-align: center; font-weight: bold; }
35
+ h2 { font-size: 18px; }
36
+ h3 { font-size: 16px; }
37
+ h4 { font-size: 14px; }
38
+ h5 { font-size: 12px; }
39
+ h6 { font-size: 10px; }
40
+
41
+ h1, h2, h3, h4, h5, h6, p, hr, ul, ol {
42
+ margin: 15px 0 10px 0;
43
+ }
44
+
45
+ a {
46
+ text-decoration: underline;
47
+ color: #0000ff;
48
+ outline-style: none;
49
+ }
50
+ a:hover {
51
+ text-decoration: none;
52
+ }
53
+
54
+ b, strong {
55
+ font-weight: bold;
56
+ }
57
+
58
+ #content table {
59
+ width: 100%;
60
+ }
61
+
62
+ #content td, #content th {
63
+ border: 1px solid #000;
64
+ border-collapse: collapse;
65
+ border-spacing: 0;
66
+ }
67
+
68
+ #content td {
69
+ padding: 3px 8px;
70
+ }
71
+ #content th {
72
+ font-weight: bold;
73
+ font-size: 16px;
74
+ padding: 3px 8px;
75
+ }
76
+
77
+ #content .default, #content .default th, #content .default td {
78
+ margin: 0;
79
+ padding: 0;
80
+ border-style: none;
81
+ }
82
+
83
+ #header {
84
+ height: 140px;
85
+ }
86
+
87
+ #header h1 {
88
+ text-align: left;
89
+ }
90
+ #logo {
91
+ position: absolute;
92
+ left: 5px;
93
+ top: 45px;
94
+ }
95
+ #header_adress {
96
+ position: absolute;
97
+ left: 134px;
98
+ top: 44px;
99
+ font-size: 18px;
100
+ }
101
+
102
+ #total {
103
+ text-align: right;
104
+ font-size: 16px;
105
+ font-weight: bold;
106
+ padding: 3px 8px 3px 0;
107
+ }
108
+ #total span {
109
+ padding-right: 25px;
110
+ }
111
+ #total_desc {
112
+ font-size: 16px;
113
+ }
114
+ #total_words {
115
+ margin: 5px 0 20px 0;
116
+ font-weight: bold;
117
+ font-size: 16px;
118
+ }
119
+ #seller_line {
120
+ position: absolute;
121
+ left: 70px;
122
+ bottom: 3px;
123
+ width: 230px;
124
+ border-bottom: 1px solid #000;
125
+ }
126
+ .order_line_items {
127
+ margin: 1em 0;
128
+ }
129
+
130
+ #seller {
131
+ margin-top: 2em;
132
+ }
133
+
134
+ #seller div {
135
+ margin: 1em 0;
136
+ }
@@ -0,0 +1,42 @@
1
+ html, body, div, span, applet, object, iframe,
2
+ h1, h2, h3, h4, h5, h6, p, blockquote, pre,
3
+ a, abbr, acronym, address, big, cite, code,
4
+ del, dfn, em, img, ins, kbd, q, s, samp,
5
+ small, strike, strong, sub, sup, tt, var,
6
+ b, u, i, center,
7
+ dl, dt, dd, ol, ul, li,
8
+ fieldset, form, label, legend,
9
+ table, caption, tbody, tfoot, thead, tr, th, td,
10
+ article, aside, canvas, details, embed,
11
+ figure, figcaption, footer, header, hgroup,
12
+ menu, nav, output, ruby, section, summary,
13
+ time, mark, audio, video {
14
+ margin: 0;
15
+ padding: 0;
16
+ border: 0;
17
+ font-size: 100%;
18
+ font: inherit;
19
+ }
20
+ /* HTML5 display-role reset for older browsers */
21
+ article, aside, details, figcaption, figure,
22
+ footer, header, hgroup, menu, nav, section {
23
+ display: block;
24
+ }
25
+ body {
26
+ line-height: 1;
27
+ }
28
+ ol, ul {
29
+ list-style: none;
30
+ }
31
+ blockquote, q {
32
+ quotes: none;
33
+ }
34
+ blockquote:before, blockquote:after,
35
+ q:before, q:after {
36
+ content: '';
37
+ content: none;
38
+ }
39
+ table {
40
+ border-collapse: collapse;
41
+ border-spacing: 0;
42
+ }
data/synergy.gemspec CHANGED
@@ -1,28 +1,28 @@
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'
4
+ s.version = '0.60.0.RC1'
5
5
  s.summary = 'Russian e-commerce solution based on Spree'
6
- #s.description = 'Add (optional) gem description here'
6
+ s.description = ''
7
7
  s.required_ruby_version = '>= 1.8.7'
8
8
 
9
9
  s.author = 'Roman Smirnov'
10
10
  s.email = 'roman@railsdog.com'
11
11
  s.homepage = 'https://github.com/secoint/synergy'
12
- # s.rubyforge_project = 'actionmailer'
12
+ s.rubyforge_project = 'synergy'
13
13
 
14
14
  s.files = `git ls-files`.split("\n")
15
15
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
16
16
  s.require_path = 'lib'
17
17
  s.requirements << 'none'
18
18
 
19
- s.add_dependency('russian', '0.2.7')
20
- s.add_dependency('json', '1.5.1')
21
- s.add_dependency('nokogiri', '1.4.4')
22
- s.add_dependency('spree', '>= 0.50.2')
23
- s.add_dependency('spree_static_content', '~> 0.40.2')
24
- s.add_dependency('spree_editor', '~> 0.50.0')
25
- s.add_dependency('spree_robokassa', '~> 0.50.0')
19
+ s.add_dependency('synergy_russian', '0.2.8')
20
+ s.add_dependency('json', '~> 1.5.1')
21
+ s.add_dependency('nokogiri', '~> 1.4.4')
22
+ s.add_dependency('spree', '~> 0.60.0')
23
+ s.add_dependency('spree_static_content', '~> 0.60.1')
24
+ s.add_dependency('spree_editor', '~> 0.50.1')
25
+ s.add_dependency('spree_robokassa', '~> 0.50.2')
26
26
  s.add_dependency('spree_yandex_market', '~> 1.2.0')
27
27
  s.add_dependency('spree_online_support', '~> 0.50.0')
28
28
  s.add_dependency('spree_address_book', '~> 0.50.1')
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: synergy
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: false
4
+ prerelease: true
5
5
  segments:
6
6
  - 0
7
- - 50
7
+ - 60
8
8
  - 0
9
- version: 0.50.0
9
+ - RC1
10
+ version: 0.60.0.RC1
10
11
  platform: ruby
11
12
  authors:
12
13
  - Roman Smirnov
@@ -14,11 +15,11 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2011-05-12 00:00:00 +04:00
18
+ date: 2011-06-25 00:00:00 +04:00
18
19
  default_executable:
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency
21
- name: russian
22
+ name: synergy_russian
22
23
  prerelease: false
23
24
  requirement: &id001 !ruby/object:Gem::Requirement
24
25
  requirements:
@@ -27,8 +28,8 @@ dependencies:
27
28
  segments:
28
29
  - 0
29
30
  - 2
30
- - 7
31
- version: 0.2.7
31
+ - 8
32
+ version: 0.2.8
32
33
  type: :runtime
33
34
  version_requirements: *id001
34
35
  - !ruby/object:Gem::Dependency
@@ -36,7 +37,7 @@ dependencies:
36
37
  prerelease: false
37
38
  requirement: &id002 !ruby/object:Gem::Requirement
38
39
  requirements:
39
- - - "="
40
+ - - ~>
40
41
  - !ruby/object:Gem::Version
41
42
  segments:
42
43
  - 1
@@ -50,7 +51,7 @@ dependencies:
50
51
  prerelease: false
51
52
  requirement: &id003 !ruby/object:Gem::Requirement
52
53
  requirements:
53
- - - "="
54
+ - - ~>
54
55
  - !ruby/object:Gem::Version
55
56
  segments:
56
57
  - 1
@@ -64,13 +65,13 @@ dependencies:
64
65
  prerelease: false
65
66
  requirement: &id004 !ruby/object:Gem::Requirement
66
67
  requirements:
67
- - - ">="
68
+ - - ~>
68
69
  - !ruby/object:Gem::Version
69
70
  segments:
70
71
  - 0
71
- - 50
72
- - 2
73
- version: 0.50.2
72
+ - 60
73
+ - 0
74
+ version: 0.60.0
74
75
  type: :runtime
75
76
  version_requirements: *id004
76
77
  - !ruby/object:Gem::Dependency
@@ -82,9 +83,9 @@ dependencies:
82
83
  - !ruby/object:Gem::Version
83
84
  segments:
84
85
  - 0
85
- - 40
86
- - 2
87
- version: 0.40.2
86
+ - 60
87
+ - 1
88
+ version: 0.60.1
88
89
  type: :runtime
89
90
  version_requirements: *id005
90
91
  - !ruby/object:Gem::Dependency
@@ -97,8 +98,8 @@ dependencies:
97
98
  segments:
98
99
  - 0
99
100
  - 50
100
- - 0
101
- version: 0.50.0
101
+ - 1
102
+ version: 0.50.1
102
103
  type: :runtime
103
104
  version_requirements: *id006
104
105
  - !ruby/object:Gem::Dependency
@@ -111,8 +112,8 @@ dependencies:
111
112
  segments:
112
113
  - 0
113
114
  - 50
114
- - 0
115
- version: 0.50.0
115
+ - 2
116
+ version: 0.50.2
116
117
  type: :runtime
117
118
  version_requirements: *id007
118
119
  - !ruby/object:Gem::Dependency
@@ -171,7 +172,7 @@ dependencies:
171
172
  version: 0.50.1
172
173
  type: :runtime
173
174
  version_requirements: *id011
174
- description:
175
+ description: ""
175
176
  email: roman@railsdog.com
176
177
  executables: []
177
178
 
@@ -184,20 +185,33 @@ files:
184
185
  - LICENSE.txt
185
186
  - README.md
186
187
  - Rakefile
188
+ - app/controllers/admin/base_controller_decorator.rb
189
+ - app/controllers/admin/orders_controller_decorator.rb
187
190
  - app/controllers/admin/products_controller_decorator.rb
188
191
  - app/controllers/checkout_controller_decorator.rb
192
+ - app/controllers/orders_controller_decorator.rb
189
193
  - app/controllers/spree/base_controller_decorator.rb
190
194
  - app/controllers/user_sessions_controller_decorator.rb
195
+ - app/helpers/checkout_helper.rb
191
196
  - app/models/calculator/cash_on_delivery.rb
192
197
  - app/models/order_decorator.rb
198
+ - app/models/payment_method/sber_bank_invoice.rb
193
199
  - app/models/taxon_decorator.rb
200
+ - app/views/admin/orders/courier_instruction.html.erb
194
201
  - app/views/admin/overview/index.html.erb
202
+ - app/views/admin/payments/source_forms/_sberbankinvoice.html.erb
203
+ - app/views/admin/payments/source_views/_sberbankinvoice.html.erb
195
204
  - app/views/admin/products/index.html.erb
205
+ - app/views/admin/shared/_tabs.html.erb
206
+ - app/views/checkout/payment/_sberbankinvoice.html.erb
196
207
  - app/views/errors/404.html.erb
197
208
  - app/views/order_mailer/cancel_email.text.erb
198
209
  - app/views/order_mailer/confirm_email.text.erb
210
+ - app/views/orders/sberbank_invoice.html.erb
211
+ - app/views/orders/show.html.erb
199
212
  - app/views/shared/_filters.html.erb
200
213
  - app/views/shipment_mailer/shipped_email.text.erb
214
+ - app/views/user_mailer/reset_password_instructions.text.erb
201
215
  - config/initializers/secoint.rb
202
216
  - config/locales/affiliate_ru.yml
203
217
  - config/locales/devise.ru.yml
@@ -205,6 +219,7 @@ files:
205
219
  - config/locales/reviews_ru.yml
206
220
  - config/locales/robokassa_ru.yml
207
221
  - config/locales/ru.yml
222
+ - config/locales/sberbank_ru.yml
208
223
  - config/locales/wishlist_ru.yml
209
224
  - config/routes.rb
210
225
  - db/default/countries.yml
@@ -223,6 +238,7 @@ files:
223
238
  - lib/synergy_hooks.rb
224
239
  - lib/tasks/install.rake
225
240
  - lib/tasks/synergy.rake
241
+ - public/500.html
226
242
  - public/images/admin/bg/admin_menu_back.png
227
243
  - public/images/admin/bg/admin_sub_menu_back.png
228
244
  - public/images/admin/icons/help.png
@@ -231,6 +247,8 @@ files:
231
247
  - public/javascripts/admin/jquery.simpletip-1.3.1.pack.js
232
248
  - public/stylesheets/admin/inline_help.css
233
249
  - public/stylesheets/admin/synergy.css
250
+ - public/stylesheets/courier_instruction.css
251
+ - public/stylesheets/reset.css
234
252
  - spec/spec_helper.rb
235
253
  - synergy.gemspec
236
254
  has_rdoc: true
@@ -253,14 +271,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
253
271
  version: 1.8.7
254
272
  required_rubygems_version: !ruby/object:Gem::Requirement
255
273
  requirements:
256
- - - ">="
274
+ - - ">"
257
275
  - !ruby/object:Gem::Version
258
276
  segments:
259
- - 0
260
- version: "0"
277
+ - 1
278
+ - 3
279
+ - 1
280
+ version: 1.3.1
261
281
  requirements:
262
282
  - none
263
- rubyforge_project:
283
+ rubyforge_project: synergy
264
284
  rubygems_version: 1.3.6
265
285
  signing_key:
266
286
  specification_version: 3