c80_yax 0.1.0.12 → 0.1.0.13

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 67543c9ac41ce9a2907541c4162f79cccb324ad1
4
- data.tar.gz: 28131f3a14f46add35bb7e09329f34ad6d21148c
3
+ metadata.gz: f69bc23c1a26a230fe3f9fe2f2cb633bd096de13
4
+ data.tar.gz: 80099f717e6919da3f45e6c36f6c058350d75cd8
5
5
  SHA512:
6
- metadata.gz: 129853498c49498cb181a8a75f4aa6905107f97f198fe08614298dc3b07eaee3412f53f41829dd91b6913609ca1c863ff0dc6d2e39dbaa630df8260ca2e8db51
7
- data.tar.gz: 01d8142872d507ed3cd25c3dd4e589ff75d0e7e8ac8f0f9408effe74b30eb7d3ef48b687968a9d883bbb5d3842e2dfce3992289c2f2de375305ae78350cbc080
6
+ metadata.gz: 4a7921079b99889db0ab782e890e7ffaf771d3ebf68040922ed26f62a5cc67bb98a773d70f590b82e8eb874f5ff42b3996871107c94d69c7050c9713331529eb
7
+ data.tar.gz: a87fdc1fa85e569922ede7cc8a21ead55cbea04e95cc75d8d11e5e162b4315be326e99231f2a3090463ef3d2ed8f9cab29d5d4a7821384a200f1c43e39d52acf
@@ -1,4 +1,4 @@
1
- .add_to_bucket {
1
+ @mixin add_to_bucket {
2
2
  @include color_button(#FFFFFF, $red);
3
3
 
4
4
  line-height: 35px;
@@ -10,14 +10,33 @@
10
10
  &:before {
11
11
  content: '';
12
12
  display: block;
13
+ position: absolute;
14
+ }
15
+
16
+ }
17
+
18
+ .add_to_bucket {
19
+ @include add_to_bucket;
20
+
21
+ &:before {
13
22
  width: 44px;
14
23
  height: 44px;
15
- position: absolute;
16
- background: transparent image-url('cart_icon.png') no-repeat 35% 50%;
17
24
  left: 18%;
18
25
  top: 14%;
26
+ background: transparent image-url('cart_icon.png') no-repeat 35% 50%;
19
27
  }
28
+ }
20
29
 
21
- // TODO-1:: добавить иконку корзины
30
+ .add_to_bucket_sm {
31
+ @include add_to_bucket;
32
+ width: 49px;
33
+ height: 36px;
22
34
 
35
+ &:before {
36
+ width: 33px;
37
+ height: 33px;
38
+ left: 18%;
39
+ top: 1%;
40
+ background: transparent image-url('c80_yax/cart_icon_sm.png') no-repeat 50% 50%;
41
+ }
23
42
  }
@@ -8,6 +8,10 @@ ul.item_index {
8
8
  float: left;
9
9
  margin-right: 35px;
10
10
  margin-bottom: 20px;
11
+
12
+ a.add_to_bucket_sm {
13
+ float: right;
14
+ }
11
15
  }
12
16
 
13
17
  }
@@ -2,4 +2,5 @@
2
2
  @import 'c80_yax/lib/**/*';
3
3
  @import 'c80_yax/lib_custom/**/*';
4
4
  @import 'c80_yax/elems/**/*';
5
- @import 'of';
5
+ @import 'of';
6
+ @import 'ti';
@@ -110,7 +110,7 @@ module C80Yax
110
110
  end
111
111
 
112
112
  def btn_order
113
-
113
+ h.link_to '', '#', class: 'add_to_bucket_sm'
114
114
  end
115
115
 
116
116
 
@@ -47,6 +47,36 @@ module C80Yax
47
47
  }
48
48
  end
49
49
 
50
+ def c80_yax_render_offers_index(thumb_size = 'thumb_md', page=1, per_page = 16)
51
+ itms = Item.joins(:offers)
52
+ .includes(item_props: {prop_name: [:uom, :related]})
53
+ .includes(:iphotos)
54
+ .includes(:strsubcat)
55
+ .paginate(page: page, per_page: per_page)
56
+ items = ItemDecorator.decorate_collection(itms)
57
+ render partial: 'c80_yax/items/index',
58
+ locals: {
59
+ items: items,
60
+ without_paginator: true,
61
+ thumb_size: thumb_size
62
+ }
63
+ end
64
+
65
+ def c80_yax_render_offers_hits(thumb_size = 'thumb_md', page=1, per_page = 16)
66
+ itms = Item.where(is_hit: true)
67
+ .includes(item_props: {prop_name: [:uom, :related]})
68
+ .includes(:iphotos)
69
+ .includes(:strsubcat)
70
+ .paginate(page: page, per_page: per_page)
71
+ items = ItemDecorator.decorate_collection(itms)
72
+ render partial: 'c80_yax/items/index',
73
+ locals: {
74
+ items: items,
75
+ without_paginator: true,
76
+ thumb_size: thumb_size
77
+ }
78
+ end
79
+
50
80
  private
51
81
 
52
82
  end
@@ -7,12 +7,16 @@ ActiveAdmin.register Ti::Category, as: 'Category' do
7
7
  permit_params :title,
8
8
  :full,
9
9
  :ord,
10
+ :is_listed,
10
11
  :parent_category_id
11
12
 
12
13
  config.sort_order = 'id_asc'
13
14
  # config.clear_action_items!
14
15
  config.batch_actions = false
15
16
 
17
+ scope "All", :all
18
+ scope "Listed", :listed
19
+
16
20
  # filter :title
17
21
  # filter :strsubcats
18
22
  # filter :is_excluded_from_filtering
@@ -30,6 +34,7 @@ ActiveAdmin.register Ti::Category, as: 'Category' do
30
34
 
31
35
  column :title
32
36
  column :ord
37
+ column :is_listed
33
38
  column :parent_category do |pn|
34
39
  if pn.parent_category_id.present?
35
40
  rpn = Ti::Category.find_by(id:pn.parent_category_id)
@@ -45,6 +50,7 @@ ActiveAdmin.register Ti::Category, as: 'Category' do
45
50
  f.inputs 'Свойства' do
46
51
  f.input :title
47
52
  f.input :ord
53
+ f.input :is_listed
48
54
 
49
55
  f.input :parent_category,
50
56
  as: :select,
@@ -0,0 +1,41 @@
1
+ ul.tech_info_list {
2
+ margin: 0;
3
+ padding: 0;
4
+ list-style: none;
5
+
6
+ h2 {
7
+ text-transform: uppercase;
8
+ @extend %HelveticaNeueCyrRoman;
9
+ font-size: 20px;
10
+ }
11
+
12
+ ul.docs_of_cats {
13
+ margin: 0;
14
+ padding: 0;
15
+ list-style: none;
16
+
17
+ h3 {
18
+ @extend %HelveticaNeueCyrRoman;
19
+ font-size: 15px;
20
+ background-color: #EC2127;
21
+ color: white;
22
+ padding: 15px 15px 15px 20px;
23
+ }
24
+
25
+ ul.docs {
26
+ list-style: none;
27
+ padding: 0 0 0 19px;
28
+
29
+ a {
30
+ font-family: HelveticaNeueCyrRoman;
31
+ color: #777777;
32
+ text-decoration: underline;
33
+ font-size: 15px;
34
+ &:hover {
35
+ color: #333333;
36
+ }
37
+ }
38
+ }
39
+ }
40
+
41
+ }
@@ -1,76 +1,53 @@
1
1
  module Ti
2
2
  module TechInfoListHelper
3
3
 
4
- # Выдать html unordered nested list Дилеров (включая Офисы),
5
- # разложенный по Регионам, построенный
6
- # на основе данных +rdo+ - Regions-Dealers-Offices.
7
- # Список выводится слева от карты.
8
- # (**) Не выводим регионы, у которых нет дилеров.
9
- #
10
- # Структура списка:
11
- # * Регион
12
- # * Дилер
13
- # * Офис 1
14
- # * адрес офиса
15
- # * телефон офиса
16
- # * Офис 2
17
- # * адрес офиса
18
- # * телефон офиса
19
- # * сайт дилера
20
- # * email дилера
21
- #
22
- def __render_ul_dealers_list(rdo)
4
+ def render_tech_info_list(&make_doc_url)
5
+
6
+ p_make_doc_url = Proc.new &make_doc_url
23
7
 
24
8
  res = ''
25
9
 
26
- rdo.each do |region|
27
- r = "<h2 class='region_title'>#{region.title}</h2>"
28
- ds = ul_region_dealers(region)
29
- next if ds.blank? # (**)
30
- r += ds
31
- res += "<li class='li_region' id='region_#{region.id}'>#{r}</li>"
10
+ cds = Category.includes(:docs) #where(ti_categories: {is_listed: true})
11
+
12
+ cds.each do |c|
13
+ next unless c.is_listed
14
+ cc = "<h2>#{c.title}</h2>"
15
+ cc += ul_docs_of_cats(c.child_categories, p_make_doc_url)
16
+ cc = "<li>#{cc}</li>"
17
+ res += cc
32
18
  end
33
19
 
34
- "<ul class='ul_dealers_list'>#{res}</ul>".html_safe
20
+ "<ul class='tech_info_list'>#{res}</ul>".html_safe
35
21
 
36
22
  end
37
23
 
38
24
  private
39
25
 
40
- # используется только в render_dealers_list
41
- # (*) не выводим список дилеров, если он пуст
42
- def ul_region_dealers(region)
26
+ def ul_docs_of_cats(list_of_categories, p_make_doc_url)
43
27
  res = ''
44
- # noinspection RubyResolve
45
- region.dealers.each do |dealer|
46
- d = "<h3 class='dealer_title'>#{dealer.title}</h3>"
47
- d += ul_dealer_offices(dealer)
48
- res += "<li class='li_dealer' id='dealer_#{dealer.id}'>#{d}</li>"
28
+
29
+ list_of_categories.each do |cat|
30
+ cc = "<h3>#{cat.title}</h3>"
31
+ cc += ul_docs(cat, p_make_doc_url)
32
+ cc = "<li>#{cc}</li>"
33
+ res += cc
49
34
  end
50
- return res if res.blank? # (*)
51
- "<ul class='ul_region_dealers'>#{res}</ul>" #.html_safe
35
+
36
+ "<ul class='docs_of_cats'>#{res}</ul>"
37
+
52
38
  end
53
39
 
54
- # используется только в ul_region_dealers
55
- def ul_dealer_offices(dealer)
40
+ def ul_docs(cat, p_make_doc_url)
56
41
  res = ''
57
- # noinspection RubyResolve
58
- dealer.offices.each_with_index do |office|
59
- o = "<h4 class='office_title'>#{office.title}</h4>"
60
- o += ul_office_props(office)
61
- res += "<li class='li_office' id='office_#{office.id}' data-id='#{office.id}'>#{o}</li>"
42
+
43
+ cat.docs.each do |doc|
44
+ cc = "<a href='#{p_make_doc_url.call(doc)}' title='#{doc.title}'>#{doc.title}</a>"
45
+ cc = "<li>#{cc}</li>"
46
+ res += cc
62
47
  end
63
- res += "<li class='dealer_email'>#{dealer.email}</li>"
64
- res += "<li class='dealer_site'>#{dealer.site}</li>"
65
- "<ul class='ul_dealer_offices'>#{res}</ul>" #.html_safe
66
- end
67
48
 
68
- # используется только в ul_dealer_offices
69
- def ul_office_props(office)
70
- res = ''
71
- res += "<li class='office_addr'>#{office.addr}</li>"
72
- res += "<li class='office_tel'>#{office.tel}</li>"
73
- "<ul class='ul_office_props'>#{res}</ul>" #.html_safe
49
+ "<ul class='docs'>#{res}</ul>"
50
+
74
51
  end
75
52
 
76
53
  end
@@ -7,5 +7,7 @@ module Ti
7
7
  belongs_to :parent_category, class_name: 'Ti::Category'
8
8
  has_and_belongs_to_many :docs
9
9
  validates :title, presence: true
10
+ scope :listed, -> { where(is_listed: true) }
11
+ default_scope {order(:ord => :asc)}
10
12
  end
11
13
  end
@@ -0,0 +1,5 @@
1
+ class AddTiListedToCategories < ActiveRecord::Migration
2
+ def change
3
+ add_column :ti_categories, :is_listed, :boolean
4
+ end
5
+ end
@@ -1,3 +1,3 @@
1
1
  module C80Yax
2
- VERSION = '0.1.0.12'
2
+ VERSION = '0.1.0.13'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: c80_yax
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.12
4
+ version: 0.1.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - C80609A
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-07-16 00:00:00.000000000 Z
11
+ date: 2017-07-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -132,6 +132,7 @@ files:
132
132
  - app/admin/c80_yax/uoms.rb
133
133
  - app/admin/c80_yax/vendors.rb
134
134
  - app/admin/c80_yax/x_c80_yax.rb
135
+ - app/assets/images/c80_yax/cart_icon_sm.png
135
136
  - app/assets/javascripts/c80_yax.js.coffee
136
137
  - app/assets/javascripts/c80_yax/backend/items.js
137
138
  - app/assets/javascripts/c80_yax/backend/strsubcats.js
@@ -282,8 +283,7 @@ files:
282
283
  - engines/ti/app/assets/javascripts/ti.coffee
283
284
  - engines/ti/app/assets/javascripts/ti/facts_ajax.js
284
285
  - engines/ti/app/assets/stylesheets/ti.scss
285
- - engines/ti/app/assets/stylesheets/ti/news_block.scss
286
- - engines/ti/app/assets/stylesheets/ti/will_paginate.scss
286
+ - engines/ti/app/assets/stylesheets/ti/tech_info_list.scss
287
287
  - engines/ti/app/controllers/ti/application_controller.rb
288
288
  - engines/ti/app/helpers/ti/application_helper.rb
289
289
  - engines/ti/app/helpers/ti/tech_info_list_helper.rb
@@ -308,6 +308,7 @@ files:
308
308
  - engines/ti/db/migrate/20170706050507_create_ti_categories.rb
309
309
  - engines/ti/db/migrate/20170706050606_create_ti_dphotos.rb
310
310
  - engines/ti/db/migrate/20170706083939_create_ti_join_table_categories_docs.rb
311
+ - engines/ti/db/migrate/20170718035050_add_ti_listed_to_categories.rb
311
312
  - engines/ti/db/seeds/ti_02_fill_test_data.rb
312
313
  - engines/ti/lib/ti.rb
313
314
  - engines/ti/lib/ti/engine.rb
@@ -1,49 +0,0 @@
1
- div.news_block {
2
-
3
- div.news_list {
4
- position: relative; /** Needed to ensure items are laid out relative to this container **/
5
- padding: 0;
6
- margin: 0;
7
-
8
- div.fact {
9
- display: block;
10
- float: left;
11
- /*width: 229px;*/
12
- /*max-height: 350px;*/
13
- overflow: hidden;
14
- margin-bottom: 25px;
15
-
16
- img {
17
- margin-bottom: 15px;
18
- max-width: 100%;
19
- }
20
-
21
- &.clear_left {
22
- clear: left;
23
- }
24
-
25
- }
26
-
27
- &.per_row_3 {
28
- .fact {
29
- width: 33.33333%;
30
- }
31
- }
32
-
33
- &.per_row_4 {
34
- .fact {
35
- width: 25%;
36
- }
37
- }
38
-
39
- &.is_news_page {
40
-
41
- div.fact {
42
-
43
- }
44
-
45
- }
46
-
47
- }
48
-
49
- }
@@ -1,65 +0,0 @@
1
- div.ajax_div {
2
-
3
- div.div_will_paginate {
4
- width: 100%;
5
- clear: both;
6
- float: left;
7
- padding: 0 46px;
8
-
9
- .pagination {
10
- margin: 0;
11
-
12
- span {
13
- &.previous_page {
14
- display: none;
15
- }
16
- &.next_page {
17
- display: none;
18
- }
19
- }
20
-
21
- em {
22
-
23
- display: inline-block;
24
- line-height: 29px;
25
- width: 30px;
26
- height: 30px;
27
-
28
- text-align: center;
29
- font-weight: bold !important;
30
- font-style: normal !important;
31
-
32
- border: 1px solid #B6B6B6;
33
- background-color: #E9353B;
34
- color:#ffffff;
35
-
36
- }
37
-
38
- a {
39
- display: inline-block;
40
- line-height: 29px;
41
- width: 30px;
42
- height: 30px;
43
-
44
- border: 1px solid #B6B6B6;
45
- background-color: #ffffff;
46
- color:#777777;
47
- text-align: center;
48
- font-weight: bold !important;
49
-
50
- text-decoration: none;
51
- &:hover, &:active, &:focus { text-decoration: none !important; color: black; }
52
-
53
- &.previous_page {
54
- display: none;
55
- }
56
- &.next_page {
57
- display: none;
58
- }
59
-
60
- }
61
- }
62
-
63
- }
64
-
65
- }