c80_catoffers 0.1.0.2 → 0.1.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4978d4f9ad6c30c3120a1f20f7e9b291051cd875
4
- data.tar.gz: f3bbb51a38af6e9b37001c322014bd8a6fa179ca
3
+ metadata.gz: a6dbd0074caa473be1baafb8f7e7d66e2229db2d
4
+ data.tar.gz: df3c45d4db793127c49799c4f69b99c7f5066947
5
5
  SHA512:
6
- metadata.gz: e963b8dd01b67113be7f656ccd29fde83dec1e83b0ce8a0873a1f7466093f12a47a41a3cb61598816b479d45f5dd32e55b5b54265b2d4545c4ad9e2314c2436e
7
- data.tar.gz: 1dbad5650b777ac78dabb936f366de059501e70563beaa77b4b6e549b2cba0e2ad8f15886187b030b3d25c26ea765357091bd2fd3d51ade148d83ab5a1c6c713
6
+ metadata.gz: 4764a36f6d498badab978f4c2c40a98b01da95919b36ca9245e26504728ca56115afd2c7deb4445883db3057fb737bab651002943fa60eb7461cc0ae30f14a96
7
+ data.tar.gz: 47e9f2b06009f2b75d64f17841dcc2f29f143663b54a42d08f677a2a9a3440d7c5d9e7e0e29554d700a7ee9efde3d4160732c724832db6aef54f19b1cac2ca73
data/README.md CHANGED
@@ -9,36 +9,28 @@ TODO: Delete this and the text above, and describe your gem
9
9
  Add this line to your application's Gemfile:
10
10
 
11
11
  ```ruby
12
- gem 'c80_catoffers'
12
+ gem 'c80_lazy_images', '0.1.0'
13
+ gem 'c80_catoffers'
13
14
  ```
14
15
 
15
- And then execute:
16
-
17
- $ bundle
18
-
19
- Or install it yourself as:
20
-
21
- $ gem install c80_catoffers
22
-
23
- ## Usage
24
-
25
16
  ```scss
26
- @import "c80_catoffers";
27
- @import "c80_catoffers_backend";
17
+ @import "c80_catoffers";
18
+ @import "c80_catoffers_backend";
28
19
  ```
29
20
 
30
- ## Development
31
-
32
- After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
33
-
34
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
35
-
36
- ## Contributing
37
-
38
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/c80_catoffers. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
21
+ Host app's `application_controller.rb`:
22
+ ```
23
+ helper C80LazyImages::Engine.helpers
24
+ helper C80Catoffers::Engine.helpers
25
+ ```
39
26
 
27
+ ## Usage: helpers
40
28
 
41
- ## License
29
+ ```
30
+ render_offer_full_desc(offer_tag)
31
+ render_offers_list_by_cat(category_tag)
32
+ render_offers_list_grouped
33
+ render_offers_list_iconed(css_style:'default', thumb_size:'thumb_sm')
42
34
 
43
- The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
35
+ ```
44
36
 
@@ -0,0 +1,31 @@
1
+ /*NOTE:: подразумевается дефолтное использование с thumb_sm */
2
+
3
+ @mixin default_li_iconed {
4
+ margin-bottom: 15px;
5
+
6
+ /* иконка категории в ссылке */
7
+ a.lazy-image-wrapper {
8
+ overflow: hidden;
9
+ float: left;
10
+ clear: left;
11
+
12
+ img {
13
+ max-width: 100%;
14
+ width: 100%;
15
+
16
+ }
17
+
18
+ }
19
+
20
+ /* название категории */
21
+ a.title {
22
+ padding-left: 10px;
23
+ display: inline-block;
24
+ float: left;
25
+ clear: right;
26
+ width: calc(100% - 80px); /*NOTE:: подразумевается дефолтное использование с thumb_sm */
27
+ overflow: hidden;
28
+
29
+ }
30
+
31
+ }
@@ -6,6 +6,7 @@ div.offer_list_iconed {
6
6
  list-style: none;
7
7
 
8
8
  li {
9
+ margin-bottom: 15px;
9
10
 
10
11
  /* иконка категории в ссылке */
11
12
  a.lazy-image-wrapper {
@@ -16,43 +17,18 @@ div.offer_list_iconed {
16
17
  img {
17
18
  max-width: 100%;
18
19
  width: 100%;
20
+
19
21
  }
20
22
 
21
23
  }
22
24
 
23
25
  /* название категории */
24
26
  a.title {
27
+ padding-left: 10px;
25
28
  display: inline-block;
26
29
  float: left;
27
30
  clear: right;
28
- }
29
-
30
- }
31
-
32
- }
33
-
34
- &.style_photostudio {
35
-
36
- ul {
37
-
38
-
39
- li {
40
- margin-bottom: 13px;
41
-
42
- /* иконка категории в ссылке */
43
- a.lazy-image-wrapper {
44
-
45
- img {
46
-
47
- }
48
-
49
- }
50
-
51
- /* название категории */
52
- a.title {
53
- padding-left: 15px;
54
- width: calc(100% - 80px);
55
- }
31
+ width: calc(100% - 80px); /*NOTE:: подразумевается дефолтное использование с thumb_sm */
56
32
 
57
33
  }
58
34
 
@@ -65,10 +41,10 @@ div.offer_list_iconed {
65
41
  ul {
66
42
 
67
43
  li {
68
- background-color: #dfffe4;
44
+ /*background-color: #dfffe4;*/
69
45
 
70
46
  a.lazy-image-wrapper {
71
- background-color: #e2dfff !important;
47
+ background-color: #F8F8F8 !important;
72
48
  }
73
49
 
74
50
  }
@@ -0,0 +1,21 @@
1
+ div.offer_list_iconed_columns {
2
+
3
+ div.column {
4
+ float: left;
5
+
6
+ ul {
7
+ margin:0;
8
+ padding:0;
9
+ list-style: none;
10
+
11
+ li {
12
+ @include default_li_iconed;
13
+ width: 100%;
14
+ margin-bottom: 8px;
15
+ }
16
+
17
+ }
18
+
19
+ }
20
+
21
+ }
@@ -0,0 +1,28 @@
1
+ div.offer_list_widget {
2
+
3
+ ul {
4
+
5
+ margin:0;
6
+ padding:0;
7
+ list-style: none;
8
+
9
+ > li {
10
+
11
+ float:left;
12
+ display: inline-block;
13
+ margin-right: 15px;
14
+
15
+ > * {
16
+ float: left;
17
+ clear: both;
18
+ }
19
+
20
+ a.lazy-image-wrapper {
21
+ background-color: #F8F8F8 !important;
22
+ }
23
+
24
+ }
25
+
26
+ }
27
+
28
+ }
@@ -32,6 +32,52 @@ module C80Catoffers
32
32
 
33
33
  end
34
34
 
35
+ def render_offers_list_by_cat_iconed(category_tag, css_class_for_wrapper='default', thumb_size='thumb_sm')
36
+
37
+ offers = C80Catoffers::Offer.joins(:categories).where(:c80_catoffers_categories => {:slug => category_tag})
38
+
39
+ # выведем в 4 столбца
40
+ cols_count = 4
41
+ n = offers.count / cols_count+1
42
+
43
+ # соберём в этом массиве массивов
44
+ a = []
45
+
46
+ # создадим подмассивы
47
+ cols_count.times do |i|
48
+ a << []
49
+ end
50
+
51
+ # указатель на заполняемый подмассив
52
+ k = 0
53
+
54
+ # обойдём все предложения
55
+ offers.all.each_with_index do |offer, i|
56
+ Rails.logger.debug "[TRACE] offer_id = #{offer.id} in k=#{k} sub-array."
57
+ a[k] << offer
58
+ if i % n == 0 && i != 0 && k <= cols_count
59
+ k += 1
60
+ Rails.logger.debug "[TRACE] k++: #{k}"
61
+ end
62
+ end
63
+
64
+ # чтобы вёрстка не прыгала - зафиксируем размер картинки
65
+ css_wh = _calc_css_for_list_iconed(thumb_size)
66
+
67
+ #
68
+ css_for_column = "width:#{100/cols_count}%"
69
+
70
+ render :partial => 'c80_catoffers/offers_list_iconed_columns',
71
+ :locals => {
72
+ list: a,
73
+ wrapper_div_class: "offer_list_iconed_columns clearfix cols_count_#{cols_count} #{css_class_for_wrapper}",
74
+ css_for_column: css_for_column,
75
+ css_for_a: css_wh[:a_lazy_wrapper],
76
+ css_for_title: css_wh[:title]
77
+ }
78
+
79
+ end
80
+
35
81
  def render_offers_list_grouped
36
82
 
37
83
  # результат соберём тут
@@ -52,42 +98,76 @@ module C80Catoffers
52
98
 
53
99
  end
54
100
 
101
+ ##
55
102
  # выведем линейный список категорий с иконками
56
- def render_offers_list_iconed(css_style:'default')
103
+ #
104
+ # состав view:
105
+ # иконка
106
+ # кликабельное название
107
+ #
108
+ # параметрами можно добавить css стиль и указать размер иконки
109
+ #
110
+ # порядок элементов - определяется Offer.all_widgeted.def_order
111
+ # количество позиций - фиксированно: Prop.positions_count
112
+ #
113
+ # css class: offer_list_iconed
114
+ def render_offers_list_iconed(css_style:'default', thumb_size:'thumb_sm')
115
+ # Rails.logger.debug "[TRACE] <render_offers_list_iconed>"
57
116
 
58
117
  # свойства модуля
59
118
  p = Prop.first
60
119
 
61
- # список категорий, которые надо вывести в виджете
62
- list = Offer.all_widgeted.def_order
63
-
64
- # сколько должно быть позиций?
65
- positions_count = p.positions_count
66
- # Rails.logger.debug "[TRACE] positions_count: #{positions_count}; list.count: #{list.count}"
67
-
68
- # если всего в списке меньше, чем надо - добьём список слотами
69
- if list.count < positions_count
70
- delta = positions_count - list.count
71
- delta.times do |i|
72
- # Rails.logger.debug "[TRACE] Offer.new"
73
- list << Offer.new({ title: '' })
74
- end
75
- end
120
+ # список категорий, которые надо вывести в виджете (со слотами)
121
+ list = _get_widgeted_offers_with_slots
76
122
 
77
123
  # чтобы вёрстка не прыгала - зафиксируем размер картинки
78
- w = p.thumb_sm_width
79
- h = p.thumb_sm_height
124
+ css_wh = _calc_css_for_list_iconed(thumb_size)
80
125
 
81
126
  render :partial => 'c80_catoffers/offers_list_iconed',
82
127
  :locals => {
83
128
  list: list,
84
129
  css_style_for_block: css_style,
85
- css_for_a: "width:#{w}px;height:#{h}px",
86
- css_for_title: "height:#{h}px;line-height:#{h}px"
130
+ css_for_a: css_wh[:a_lazy_wrapper],
131
+ css_for_title: css_wh[:title]
87
132
  }
88
133
 
89
134
 
90
135
  end
91
136
 
137
+ ##
138
+ # Построить линейный слотованный список предложений, каждое предложение
139
+ # в списке и представить в виде блока с указанным ВЕРТИКАЛЬНЫМ списком свойств +list_of_props+
140
+ #
141
+ def render_offers_widget(p_list_of_props, style='default', thumb_size='thumb_md')
142
+
143
+ # соберём слотованный список предложений
144
+ list_offers = _get_widgeted_offers_with_slots
145
+
146
+ # релевантный список списков значений указанных характеристик слотованного списка предложений
147
+ list_of_values = []
148
+
149
+ # обойдём этот список и для каждого предложения соберём релевантный список значений свойств
150
+ list_offers.each do |offer|
151
+
152
+ # соберём и обработаем значения нужных характеристик каждого предложения
153
+ vals = _proccess_list_of_props(p_list_of_props, offer)
154
+ list_of_values << vals
155
+ end
156
+
157
+ # чтобы вёрстка не прыгала - зафиксируем размер картинки
158
+ css_wh = _calc_css_for_list_widget(thumb_size)
159
+
160
+ render :partial => 'c80_catoffers/offers_list_widget',
161
+ :locals => {
162
+ list_props: p_list_of_props,
163
+ css_style_for_block: style,
164
+ list_offers: list_offers,
165
+ list_of_values_lists: list_of_values,
166
+ css_for_a: css_wh[:a_lazy_wrapper],
167
+ css_for_title: css_wh[:title]
168
+ }
169
+
170
+ end
171
+
92
172
  end
93
173
  end
@@ -0,0 +1,121 @@
1
+ module C80Catoffers
2
+ module Inner
3
+ module CssHelper
4
+
5
+ ##
6
+ # Помогает методу +render_offers_widget+ тем, что содержит код,
7
+ # перебирающий имена свойств из +list_of_props+,
8
+ # находит значения в элементе +offer+,
9
+ # и возвращает релевантный список значений
10
+
11
+ def _proccess_list_of_props(list_of_props, offer)
12
+
13
+ # результат соберём тут
14
+ list_of_values = []
15
+
16
+ # переберём имена свойств, подберём для каждого значение
17
+ list_of_props.each_with_index do |prop_name, index|
18
+ prop_value = offer.try(prop_name)
19
+ unless prop_value.present?
20
+ prop_value = 'Значение не определено'
21
+ end
22
+ list_of_values << prop_value
23
+ end
24
+
25
+ list_of_values
26
+
27
+ end
28
+
29
+ ##
30
+ # Помогает методам этого хелпер-модуля: выдаёт слотованный список предложений,
31
+ # которые необходимо вывести в виджете.
32
+ #
33
+
34
+ def _get_widgeted_offers_with_slots
35
+
36
+ # свойства модуля
37
+ p = Prop.first
38
+
39
+ # результат соберём тут список категорий, которые надо вывести в виджете
40
+ list = Offer.all_widgeted.def_order
41
+
42
+ # сколько должно быть позиций?
43
+ positions_count = p.positions_count
44
+ # Rails.logger.debug "[TRACE] positions_count: #{positions_count}; list.count: #{list.count}"
45
+
46
+ # если всего в списке меньше, чем надо - добьём список слотами
47
+ if list.count < positions_count
48
+ delta = positions_count - list.count
49
+ delta.times do |i|
50
+ # Rails.logger.debug "[TRACE] Offer.new"
51
+ list << Offer.new({
52
+ title: "Свободное место №#{i}",
53
+ price: 'Цену уточняйте в админке',
54
+ short_desc: 'Описание не указано'
55
+ }
56
+ )
57
+ end
58
+ end
59
+
60
+ list
61
+
62
+ end
63
+
64
+ ##
65
+ # Спец-метод узкого назначения - формирует css стиль, фиксирует габариты ссылки-конейнера,
66
+ # в которую помещена картинка.
67
+ # Также, предполагает, что СЛЕВА/СПРАВА от картинки располагается блок типа title,
68
+ # и для таких блоков фиксируется ВЫСОТА (подгоняется под ВЫСОТУ картинки)
69
+
70
+ def _calc_css_for_list_iconed(thumb_size)
71
+
72
+ # свойства модуля
73
+ p = Prop.first
74
+
75
+ # css_for_a: ,
76
+ # css_for_title:
77
+
78
+ # чтобы вёрстка не прыгала - зафиксируем размер картинки
79
+ w = p.send("#{thumb_size}_width") #.thumb_sm_width
80
+ h = p.send("#{thumb_size}_height") #.thumb_sm_height
81
+
82
+ res = {
83
+ :a_lazy_wrapper => "width:#{w}px;height:#{h}px",
84
+ :title => "height:#{h}px;line-height:#{h}px"
85
+ }
86
+
87
+ # Rails.logger.debug "[TRACE] <_calc_css_for_list_iconed> #{res}"
88
+ res
89
+
90
+ end
91
+
92
+ ##
93
+ # Спец-метод узкого назначения - формирует css стиль, фиксирует габариты ссылки-конейнера,
94
+ # в которую помещена картинка и ШИРИНУ соседних элементов списка.
95
+
96
+ def _calc_css_for_list_widget(thumb_size)
97
+
98
+ # свойства модуля
99
+ p = Prop.first
100
+
101
+ # css_for_a: ,
102
+ # css_for_title:
103
+
104
+ # чтобы вёрстка не прыгала - зафиксируем размер картинки
105
+ w = p.send("#{thumb_size}_width") #.thumb_sm_width
106
+ h = p.send("#{thumb_size}_height") #.thumb_sm_height
107
+
108
+ res = {
109
+ :a_lazy_wrapper => "width:#{w}px;height:#{h}px",
110
+ :title => "width:#{w}px"
111
+ }
112
+
113
+ # Rails.logger.debug "[TRACE] <_calc_css_for_list_iconed> #{res}"
114
+ res
115
+
116
+ end
117
+
118
+
119
+ end
120
+ end
121
+ end
@@ -49,6 +49,7 @@ module C80Catoffers
49
49
  self.joins(:props)
50
50
  end
51
51
 
52
+ # NOTE:: пока используется в list_iconed, устарел, т.к. появился ophoto_thumb
52
53
  def ophoto_thumb_sm
53
54
  res = ''
54
55
  if ophotos.count > 0
@@ -57,6 +58,16 @@ module C80Catoffers
57
58
  res
58
59
  end
59
60
 
61
+ # выдать обложку предложения указанного размера
62
+ # используется, например, при формировании списка предложений с картинками в виджете
63
+ def ophoto_thumb(thumb_size='thumb_sm')
64
+ res = ''
65
+ if ophotos.count > 0
66
+ res = ophotos.first.image_thumb(thumb_size)
67
+ end
68
+ res
69
+ end
70
+
60
71
  end
61
72
 
62
73
  end
@@ -3,6 +3,16 @@ module C80Catoffers
3
3
 
4
4
  belongs_to :offer
5
5
  mount_uploader :image, OphotoUploader
6
+
7
+ # выдать картинку указанного размера
8
+ def image_thumb(thumb_size)
9
+ res = ''
10
+ if image.present?
11
+ res = image.send("#{thumb_size}")
12
+ end
13
+ end
14
+
15
+
6
16
  end
7
17
 
8
- end
18
+ end
@@ -26,6 +26,20 @@ module C80Catoffers
26
26
  }
27
27
  end
28
28
 
29
+ version :thumb_md do
30
+ Proc.new {
31
+ p = C80Catoffers::Prop.first
32
+ process :resize_to_fill => [p.thumb_md_width, p.thumb_md_height]
33
+ }
34
+ end
35
+
36
+ version :thumb_lg do
37
+ Proc.new {
38
+ p = C80Catoffers::Prop.first
39
+ process :resize_to_fill => [p.thumb_lg_width, p.thumb_lg_height]
40
+ }
41
+ end
42
+
29
43
  def store_dir
30
44
  'uploads/oimages'
31
45
  end
@@ -4,10 +4,10 @@
4
4
  <ul class="clearfix">
5
5
  <% list.each do |offer| %>
6
6
  <li class="clearfix">
7
- <% Rails.logger.debug "[TRACE] #{offer}" %>
7
+ <%# Rails.logger.debug "[TRACE] #{offer}" %>
8
8
  <%= render_image_link_lazy({
9
9
  :alt_image => offer.title,
10
- :image => offer.ophoto_thumb_sm,
10
+ :image => offer.ophoto_thumb,
11
11
  :a_href => my_url_for_offer(offer),
12
12
  :a_class => '',
13
13
  :a_css_style => css_for_a,
@@ -0,0 +1,29 @@
1
+ <%# выдать линейный список предложений с иконками СТОЛБЦАМИ %>
2
+ <div class='<%= wrapper_div_class %>'>
3
+
4
+ <% list.each_with_index do |list_in_column, i| %>
5
+
6
+ <div class="column_<%= i %> clearfix column" style="<%= css_for_column %>">
7
+ <ul>
8
+
9
+ <% list_in_column.each do |offer|%>
10
+ <li class="clearfix">
11
+ <%= render_image_link_lazy({
12
+ :alt_image => offer.title,
13
+ :image => offer.ophoto_thumb,
14
+ :a_href => my_url_for_offer(offer),
15
+ :a_class => '',
16
+ :a_css_style => css_for_a,
17
+ :a_rel => 'nofollow'
18
+ }) %>
19
+
20
+ <%= link_to offer.title, my_url_for_offer(offer), title: offer.title, style: css_for_title, class: 'title' %>
21
+ </li>
22
+ <% end %>
23
+
24
+ </ul>
25
+ </div>
26
+
27
+ <% end %>
28
+
29
+ </div>
@@ -0,0 +1,56 @@
1
+ <% # выдать линейный слотованный список предложений, каждое предложение
2
+ # в списке представить в виде блока с указанным списком свойств +list_props+
3
+ %>
4
+
5
+ <div class="offer_list_widget clearfix list_count_<%= list_offers.count %> <%= css_style_for_block %>">
6
+
7
+ <ul class="clearfix">
8
+
9
+ <%# перебираем предложения, формируем список %>
10
+ <% list_offers.each_with_index do |offer, offer_index| %>
11
+ <li class="clearfix">
12
+
13
+ <%# перебираем все имена свойств и для каждого предложения строим список %>
14
+ <% list_props.each_with_index do |prop_name, prop_index| %>
15
+
16
+ <%# ради возможных стилизаций будем вести счетчик и впишем его в класс каждого блока свойства %>
17
+ <% prop_name_counter_class = "pr_#{prop_index}" %>
18
+
19
+ <%# NOTE:: переберём имена свойств и под каждое применим свои правила форматирования %>
20
+
21
+ <%# обложку предложения помещаем в ссылку и делаем lazy %>
22
+ <% if prop_name['thumb'].present? %>
23
+ <%= render_image_link_lazy({
24
+ :alt_image => offer.title,
25
+ :image => offer.ophoto_thumb(prop_name), # prop_name = thumb_sm, например
26
+ :a_href => my_url_for_offer(offer),
27
+ :a_class => prop_name_counter_class,
28
+ :a_css_style => css_for_a,
29
+ :a_rel => 'nofollow'
30
+ }) %>
31
+
32
+ <%# название обложки делаем кликабельным %>
33
+ <% elsif prop_name['title'].present? %>
34
+ <%= link_to offer.title,
35
+ my_url_for_offer(offer),
36
+ title: offer.title,
37
+ style: css_for_title,
38
+ class: "title #{prop_name_counter_class}"
39
+ %>
40
+
41
+ <%# остальные свойства выводим стопкой именованных дивов %>
42
+ <% else %>
43
+ <div class="<%= "#{prop_name} #{prop_name_counter_class}" %>" style="<%= css_for_title %>">
44
+ <%= list_of_values_lists[offer_index][prop_index] %> <%# NOTE:: извлекаем значение prop_index-свойства для offer_index-предложения %>
45
+ </div>
46
+ <% end %>
47
+
48
+ <%# NOTE:: закончили перебирать имена свойств %>
49
+
50
+ <% end %>
51
+
52
+ </li>
53
+ <% end %>
54
+ </ul>
55
+
56
+ </div>
@@ -0,0 +1,8 @@
1
+ class C80CatoffersAddThumbMdToProps < ActiveRecord::Migration
2
+ def change
3
+ add_column :c80_catoffers_props, :thumb_md_width, :integer
4
+ add_column :c80_catoffers_props, :thumb_md_height, :integer
5
+ add_column :c80_catoffers_props, :thumb_lg_width, :integer
6
+ add_column :c80_catoffers_props, :thumb_lg_height, :integer
7
+ end
8
+ end
@@ -2,12 +2,16 @@
2
2
 
3
3
  C80Catoffers::Prop.delete_all
4
4
  C80Catoffers::Prop.create!({
5
- per_row:3,
6
- preview_width:250, # NOTE:: [x090] синхронизировано с css
7
- preview_height:164, # NOTE:: [x090] синхронизировано с css
8
- big_one_width:621, # NOTE:: [x090] синхронизировано с css
9
- big_one_height: 377, # NOTE:: [x090] синхронизировано с css
10
- thumb_sm_width:80,
11
- thumb_sm_height: 50,
5
+ per_row: 3,
6
+ preview_width: 80, # NOTE:: размер иконки в iconed списке # NOTE:: [x090] синхронизировано с css
7
+ preview_height: 50, # NOTE:: размер иконки в iconed списке # NOTE:: [x090] синхронизировано с css
8
+ big_one_width: 621, # NOTE:: [x090] синхронизировано с css
9
+ big_one_height: 377, # NOTE:: [x090] синхронизировано с css
10
+ thumb_sm_width: 80, # NOTE:: просто стандартный размер
11
+ thumb_sm_height: 50, # NOTE:: просто стандартный размер
12
+ thumb_md_width: 250, # NOTE:: просто стандартный размер
13
+ thumb_md_height: 160, # NOTE:: просто стандартный размер
14
+ thumb_lg_width: 1000, # NOTE:: просто стандартный размер
15
+ thumb_lg_height: 550, # NOTE:: просто стандартный размер
12
16
  positions_count: 4
13
17
  })
@@ -0,0 +1,99 @@
1
+ # rake db:seed:x03_fill_offers
2
+
3
+ desc_1 = '<p>Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?</p>'
4
+ desc_2 = '<p>Quis autem vel eum iure reprehenderit qui in <strong>ea voluptate velit esse</strong> quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?</p>
5
+ <p>Sed ut perspiciatis unde omnis iste <a href="http://google.com">natus error</a> sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.</p>'
6
+ desc_3 = '<p>Sed ut perspiciatis unde omnis iste <a href="http://google.com">natus error</a> sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.</p>
7
+ <ul>
8
+ <li>aliquam quaerat voluptatem;</li>
9
+ <li>Quis autem vel eum iure reprehenderit;</li>
10
+ <li>Nemo enim ipsam voluptatem quia voluptas;</li>
11
+ </ul>'
12
+ desc_4 = '<p>Quis autem vel eum iure reprehenderit qui in <strong>ea voluptate velit esse</strong> quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?</p>
13
+ <p>Sed ut perspiciatis unde omnis iste <a href="http://google.com">natus error</a> sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.</p>
14
+ <ul>
15
+ <li>aliquam quaerat voluptatem;</li>
16
+ <li>Quis autem vel eum iure reprehenderit;</li>
17
+ <li>Nemo enim ipsam voluptatem quia voluptas;</li>
18
+ </ul>
19
+ <h4>De Finibus Bonorum et Malorum</h4>
20
+ <p>Duis aute <a href="http://google.com">irure dolor</a> in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? </p>
21
+ <blockquote>Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. (Cicero,45 BC)</blockquote>
22
+ <p>At vero eos et accusamus et iusto odio <em>dignissimos ducimus</em> qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio.</p>'
23
+ desc_5 = '<p>Nemo enim <a href="http://google.com">ipsam voluptatem </a> quia voluptas sit voluptatem accusantium doloremque lum.</p>'
24
+ desc_6 = '<p>Sed ut perspiciatis unde omnis iste <a href="http://google.com">natus error</a> sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.</p>
25
+ <ul>
26
+ <li>aliquam quaerat voluptatem;</li>
27
+ <li>Quis autem vel eum iure reprehenderit;</li>
28
+ <li>Nemo enim ipsam voluptatem quia voluptas;</li>
29
+ </ul>'
30
+ desc_7 = '<p>Quis autem vel eum iure reprehenderit qui in <strong>ea voluptate velit esse</strong> quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?</p>
31
+ <p>Sed ut perspiciatis unde omnis iste <a href="http://google.com">natus error</a> sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.</p>
32
+ <ul>
33
+ <li>aliquam quaerat voluptatem;</li>
34
+ <li>Quis autem vel eum iure reprehenderit;</li>
35
+ <li>Nemo enim ipsam voluptatem quia voluptas;</li>
36
+ </ul>
37
+ <h4>De Finibus Bonorum et Malorum</h4>
38
+ <p>Duis aute <a href="http://google.com">irure dolor</a> in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? </p>
39
+ '
40
+
41
+ C80Catoffers::Offer.delete_all
42
+ C80Catoffers::Offer.create!([
43
+ {
44
+ id:1,
45
+ ord:20,
46
+ title:'Установка розеток',
47
+ short_desc:'Nemo ipsam nulita lagua voluptatem',
48
+ desc: desc_7,
49
+ price: '400 руб'
50
+ },
51
+ {
52
+ id:2,
53
+ ord:20,
54
+ title:'Установка выключателей',
55
+ short_desc:'Deserunt mollitia ipsam',
56
+ desc: desc_6,
57
+ price: '500 руб'
58
+ },
59
+ {
60
+ id:3,
61
+ ord:30,
62
+ title:'Установка internet розетки',
63
+ short_desc:'Nemo enim ipsam voluptatem quia',
64
+ desc: desc_5,
65
+ price: '500 руб'
66
+ },
67
+ {
68
+ id:4,
69
+ ord:40,
70
+ title:'Установка TV розетки',
71
+ short_desc:'Quis autem vel eum',
72
+ desc: desc_4,
73
+ price: '400 руб'
74
+ },
75
+ {
76
+ id:5,
77
+ ord:50,
78
+ title:'Установка бокса на 12 модулей',
79
+ short_desc:'Duis aute irure dolor',
80
+ desc: desc_3,
81
+ price: '1700 руб'
82
+ },
83
+ {
84
+ id:6,
85
+ ord:60,
86
+ title:'Прокладка проводов в штробе',
87
+ short_desc:'Deserunt mollitia animi',
88
+ desc: desc_2,
89
+ price: '1500 руб'
90
+ },
91
+ {
92
+ id:7,
93
+ ord:70,
94
+ title:'Установка устройства уравнения потенциалов',
95
+ short_desc:'At vero eos et accusamus',
96
+ desc: desc_1,
97
+ price: '228 руб'
98
+ }
99
+ ])
@@ -1,3 +1,3 @@
1
1
  module C80Catoffers
2
- VERSION = "0.1.0.2"
2
+ VERSION = "0.1.0.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: c80_catoffers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.2
4
+ version: 0.1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - C80609A
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-10-10 00:00:00.000000000 Z
11
+ date: 2016-11-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -71,13 +71,17 @@ files:
71
71
  - app/assets/javascripts/c80_catoffers.js.coffee
72
72
  - app/assets/javascripts/c80_catoffers/offer_full_desc.js
73
73
  - app/assets/stylesheets/c80_catoffers.scss
74
+ - app/assets/stylesheets/c80_catoffers/_mixins/default_li_iconed.scss
74
75
  - app/assets/stylesheets/c80_catoffers/offer_full_desc.scss
75
76
  - app/assets/stylesheets/c80_catoffers/offer_full_desc_slick_custom.scss
76
77
  - app/assets/stylesheets/c80_catoffers/offer_list_grouped.scss
77
78
  - app/assets/stylesheets/c80_catoffers/offer_list_iconed.scss
79
+ - app/assets/stylesheets/c80_catoffers/offer_list_iconed_columns.scss
80
+ - app/assets/stylesheets/c80_catoffers/offer_list_widget.scss
78
81
  - app/assets/stylesheets/c80_catoffers_backend.scss
79
82
  - app/assets/stylesheets/c80_catoffers_backend/page_admin_props.scss
80
83
  - app/helpers/c80_catoffers/app_helper.rb
84
+ - app/helpers/c80_catoffers/inner/css_helper.rb
81
85
  - app/helpers/c80_catoffers/urls_helper.rb
82
86
  - app/models/c80_catoffers/category.rb
83
87
  - app/models/c80_catoffers/offer.rb
@@ -88,6 +92,8 @@ files:
88
92
  - app/views/c80_catoffers/_offers_list_by_cat.html.erb
89
93
  - app/views/c80_catoffers/_offers_list_grouped.html.erb
90
94
  - app/views/c80_catoffers/_offers_list_iconed.html.erb
95
+ - app/views/c80_catoffers/_offers_list_iconed_columns.html.erb
96
+ - app/views/c80_catoffers/_offers_list_widget.html.erb
91
97
  - bin/console
92
98
  - bin/setup
93
99
  - c80_catoffers.gemspec
@@ -100,9 +106,10 @@ files:
100
106
  - db/migrate/20161008123434_c80_catoffers_add_thumb_sm_to_props.rb
101
107
  - db/migrate/20161008134848_c80_catoffers_add_join_table_offers_props.rb
102
108
  - db/migrate/20161008151414_c80_catoffers_add_positions_count_to_props.rb
109
+ - db/migrate/20161023115252_c80_catoffers_add_thumb_md_to_props.rb
103
110
  - db/seeds/c80_catoffers_01_fill_props.rb
111
+ - db/seeds/c80_catoffers_02_fill_offers.rb
104
112
  - db/seeds/x02_fill_categories.rb
105
- - db/seeds/x03_fill_offers.rb
106
113
  - lib/c80_catoffers.rb
107
114
  - lib/c80_catoffers/engine.rb
108
115
  - lib/c80_catoffers/version.rb
@@ -1,20 +0,0 @@
1
- # rake db:seed:x03_fill_offers
2
-
3
- C80Catoffers::Offer.delete_all
4
- C80Catoffers::Offer.create!([
5
- {
6
- id:1,
7
- ord:20,
8
- title:'Фотоуслуги'
9
- },
10
- {
11
- id:2,
12
- ord:20,
13
- title:'Фотокурсы'
14
- },
15
- {
16
- id:3,
17
- ord:30,
18
- title:'Услуги визажиста'
19
- }
20
- ])