c80_catoffers 0.1.0.3 → 0.1.0.4
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 +4 -4
- data/app/admin/c80_catoffers/csamples.rb +69 -0
- data/app/admin/c80_catoffers/csprops.rb +41 -0
- data/app/assets/javascripts/c80_catoffers/offer_full_desc.js +52 -47
- data/app/assets/javascripts/c80_catoffers/offers_ajax.js +89 -0
- data/app/assets/stylesheets/c80_catoffers/offer_full_desc.scss +3 -2
- data/app/assets/stylesheets/c80_catoffers/offer_list_grouped.scss +23 -0
- data/app/assets/stylesheets/c80_catoffers/offer_list_widget.scss +19 -15
- data/app/assets/stylesheets/c80_catoffers/will_paginate.scss +65 -0
- data/app/controllers/c80_catoffers/application_controller.rb +25 -0
- data/app/helpers/c80_catoffers/app_helper.rb +47 -4
- data/app/helpers/c80_catoffers/csamples_helper.rb +52 -0
- data/app/helpers/c80_catoffers/inner/modal_helper.rb +16 -0
- data/app/helpers/c80_catoffers/price_helper.rb +17 -0
- data/app/helpers/c80_catoffers/urls_helper.rb +7 -3
- data/app/models/c80_catoffers/crow.rb +22 -0
- data/app/models/c80_catoffers/csample.rb +40 -0
- data/app/models/c80_catoffers/csprop.rb +5 -0
- data/app/models/c80_catoffers/offer.rb +7 -0
- data/app/uploaders/c80_catoffers/csphoto_uploader.rb +49 -0
- data/app/views/c80_catoffers/_bs_modal.html.erb +18 -0
- data/app/views/c80_catoffers/_csamples_widget.html.erb +43 -0
- data/app/views/c80_catoffers/_offers_list_grouped.html.erb +5 -2
- data/app/views/c80_catoffers/_offers_list_widget.html.erb +54 -48
- data/app/views/c80_catoffers/_offers_page.html.erb +23 -0
- data/app/views/c80_catoffers/_popup_price.html.erb +2 -0
- data/app/views/c80_catoffers/application/fake_main.html.erb +0 -0
- data/app/views/c80_catoffers/application/offers_guru.js.erb +10 -0
- data/app/views/c80_catoffers/application/price_me.js.erb +19 -0
- data/config/locales/ru.yml +6 -0
- data/config/routes.rb +3 -9
- data/db/migrate/20161105123939_c80_catoffers_add_per_page_to_props.rb +5 -0
- data/db/migrate/20161106154221_create_c80_catoffers_csamples.rb +13 -0
- data/db/migrate/20161106191544_create_c80_catoffers_crows.rb +13 -0
- data/db/migrate/20161107115555_c80_catoffers_create_csprops.rb +7 -0
- data/db/migrate/20161107123333_c80_catoffers_create_join_table_csprops_csamples.rb +11 -0
- data/db/seeds/c80_catoffers_01_fill_props.rb +2 -1
- data/lib/c80_catoffers/version.rb +1 -1
- metadata +27 -2
@@ -2,55 +2,61 @@
|
|
2
2
|
# в списке представить в виде блока с указанным списком свойств +list_props+
|
3
3
|
%>
|
4
4
|
|
5
|
-
<div class="
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
5
|
+
<div class="offer_list_widget_wrapper">
|
6
|
+
<% if h3_title.present? %>
|
7
|
+
<h3 class="section_title h3_for_offer_list_widget"><%= h3_title %></h3>
|
8
|
+
<% end %>
|
9
|
+
|
10
|
+
<div class="offer_list_widget clearfix list_count_<%= list_offers.count %> <%= css_style_for_block %>">
|
11
|
+
|
12
|
+
<ul class="clearfix">
|
13
|
+
|
14
|
+
<%# перебираем предложения, формируем список %>
|
15
|
+
<% list_offers.each_with_index do |offer, offer_index| %>
|
16
|
+
<li class="clearfix">
|
17
|
+
|
18
|
+
<%# перебираем все имена свойств и для каждого предложения строим список %>
|
19
|
+
<% list_props.each_with_index do |prop_name, prop_index| %>
|
20
|
+
|
21
|
+
<%# ради возможных стилизаций будем вести счетчик и впишем его в класс каждого блока свойства %>
|
22
|
+
<% prop_name_counter_class = "pr_#{prop_index}" %>
|
23
|
+
|
24
|
+
<%# NOTE:: переберём имена свойств и под каждое применим свои правила форматирования %>
|
25
|
+
|
26
|
+
<%# обложку предложения помещаем в ссылку и делаем lazy %>
|
27
|
+
<% if prop_name['thumb'].present? %>
|
28
|
+
<%= render_image_link_lazy({
|
29
|
+
:alt_image => offer.title,
|
30
|
+
:image => offer.ophoto_thumb(prop_name), # prop_name = thumb_sm, например
|
31
|
+
:a_href => my_url_for_offer(offer),
|
32
|
+
:a_class => prop_name_counter_class,
|
33
|
+
:a_css_style => css_for_a,
|
34
|
+
:a_rel => 'nofollow'
|
35
|
+
}) %>
|
36
|
+
|
37
|
+
<%# название обложки делаем кликабельным %>
|
38
|
+
<% elsif prop_name['title'].present? %>
|
39
|
+
<%= link_to offer.title,
|
40
|
+
my_url_for_offer(offer),
|
41
|
+
title: offer.title,
|
42
|
+
style: css_for_title,
|
43
|
+
class: "title #{prop_name_counter_class}"
|
44
|
+
%>
|
45
|
+
|
46
|
+
<%# остальные свойства выводим стопкой именованных дивов %>
|
47
|
+
<% else %>
|
48
|
+
<div class="<%= "#{prop_name} #{prop_name_counter_class}" %>" style="<%= css_for_title %>">
|
49
|
+
<%= list_of_values_lists[offer_index][prop_index] %> <%# NOTE:: извлекаем значение prop_index-свойства для offer_index-предложения %>
|
50
|
+
</div>
|
51
|
+
<% end %>
|
52
|
+
|
53
|
+
<%# NOTE:: закончили перебирать имена свойств %>
|
49
54
|
|
50
|
-
|
55
|
+
<% end %>
|
51
56
|
|
52
|
-
|
53
|
-
|
54
|
-
|
57
|
+
</li>
|
58
|
+
<% end %>
|
59
|
+
</ul>
|
55
60
|
|
61
|
+
</div>
|
56
62
|
</div>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<% # Нарисовать страницу просмотра всех Предложений.
|
2
|
+
#
|
3
|
+
%>
|
4
|
+
|
5
|
+
<div class="ajax_div_offers offers_page <%= css_style_for_block %>" data-css_class_offers_block="<%= css_style_for_block %>">
|
6
|
+
|
7
|
+
<%= render :partial => 'c80_catoffers/offers_list_widget',
|
8
|
+
:locals => {
|
9
|
+
list_props: list_props,
|
10
|
+
css_style_for_block: css_style_for_block,
|
11
|
+
list_offers: list_offers,
|
12
|
+
list_of_values_lists: list_of_values_lists,
|
13
|
+
css_for_a: css_for_a,
|
14
|
+
css_for_title: css_for_title,
|
15
|
+
h3_title: nil
|
16
|
+
}
|
17
|
+
%>
|
18
|
+
|
19
|
+
<div class="div_will_paginate">
|
20
|
+
<%= will_paginate list_offers %>
|
21
|
+
</div>
|
22
|
+
|
23
|
+
</div>
|
File without changes
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<%# TODO:: убрать временный хардкод %w(thumb_md title price) %>
|
2
|
+
var html_str = "<%= j render_offers_page(%w(thumb_md title price), 'sokol', 'thumb_md', params[:page]) %>";
|
3
|
+
|
4
|
+
var $aa = fOffersGetBlock();
|
5
|
+
$aa.replaceWith(html_str);
|
6
|
+
|
7
|
+
Holder.run($aa.find("img"));
|
8
|
+
fLazyStart();
|
9
|
+
|
10
|
+
fOffersProccessPaginateLinks();
|
@@ -0,0 +1,19 @@
|
|
1
|
+
|
2
|
+
var $body = $('body');
|
3
|
+
|
4
|
+
// вставим окно
|
5
|
+
var html_str = "<%= j render_popup_price %>";
|
6
|
+
var $m = $(html_str);
|
7
|
+
$body.append($m);
|
8
|
+
|
9
|
+
// покажем окно
|
10
|
+
$('#c80_catoffers_bs_modal').modal('show');
|
11
|
+
|
12
|
+
// настроим форму
|
13
|
+
//var $form = $("form#form_feedback");
|
14
|
+
//
|
15
|
+
//$form.bind("ajax:error", function (event, data, status, xhr) {
|
16
|
+
// $form.render_form_errors($.parseJSON(data.responseText));
|
17
|
+
//});
|
18
|
+
//
|
19
|
+
//$form.modal_success();
|
data/config/routes.rb
CHANGED
@@ -1,13 +1,7 @@
|
|
1
1
|
C80Catoffers::Engine.routes.draw do
|
2
2
|
|
3
|
-
#
|
4
|
-
|
5
|
-
|
6
|
-
# match 'rb', :to => 'banners#counter', :via => :post
|
7
|
-
|
8
|
-
# get '/auth/:provider/callback', to: 'sessions#create'
|
9
|
-
# delete '/logout', to: 'sessions#destroy'
|
10
|
-
|
11
|
-
# resources :comments, :only => :create
|
3
|
+
# root to: 'application#fake_main' # NOTE:: добавлен только чтобы работал UrlsHelper
|
4
|
+
match 'offers_guru', :to => 'application#offers_guru', :via => :post
|
5
|
+
match 'price_me', :to => 'application#price_me', :via => :post
|
12
6
|
|
13
7
|
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
class CreateC80CatoffersCsamples < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :c80_catoffers_csamples, :options => 'COLLATE=utf8_unicode_ci' do |t|
|
4
|
+
t.string :title
|
5
|
+
t.string :sub_title
|
6
|
+
t.string :csphoto
|
7
|
+
t.integer :ord
|
8
|
+
t.integer :summ_price
|
9
|
+
|
10
|
+
t.timestamps null: false
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
class CreateC80CatoffersCrows < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :c80_catoffers_crows, :options => 'COLLATE=utf8_unicode_ci' do |t|
|
4
|
+
t.integer :ord
|
5
|
+
t.references :csample, index: true
|
6
|
+
t.references :offer, index: true
|
7
|
+
|
8
|
+
t.timestamps null: false
|
9
|
+
end
|
10
|
+
# add_foreign_key :c80_catoffers_crows, :csamples
|
11
|
+
# add_foreign_key :c80_catoffers_crows, :offers
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
class C80CatoffersCreateJoinTableCspropsCsamples < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :c80_catoffers_csamples_csprops, :id => false do |t|
|
4
|
+
t.integer :csprop_id, :null => false
|
5
|
+
t.integer :csample_id, :null => false
|
6
|
+
end
|
7
|
+
|
8
|
+
add_index :c80_catoffers_csamples_csprops, [:csprop_id, :csample_id], :unique => true, :name => 'my_index_23'
|
9
|
+
|
10
|
+
end
|
11
|
+
end
|
@@ -13,5 +13,6 @@ C80Catoffers::Prop.create!({
|
|
13
13
|
thumb_md_height: 160, # NOTE:: просто стандартный размер
|
14
14
|
thumb_lg_width: 1000, # NOTE:: просто стандартный размер
|
15
15
|
thumb_lg_height: 550, # NOTE:: просто стандартный размер
|
16
|
-
positions_count: 4
|
16
|
+
positions_count: 4,
|
17
|
+
per_page: 6 # сколько Предложений вывести в хелпере render_offers_page
|
17
18
|
})
|
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.
|
4
|
+
version: 0.1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- C80609A
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-11-
|
11
|
+
date: 2016-11-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -66,10 +66,13 @@ files:
|
|
66
66
|
- README.md
|
67
67
|
- Rakefile
|
68
68
|
- app/admin/c80_catoffers/categories.rb
|
69
|
+
- app/admin/c80_catoffers/csamples.rb
|
70
|
+
- app/admin/c80_catoffers/csprops.rb
|
69
71
|
- app/admin/c80_catoffers/offers.rb
|
70
72
|
- app/admin/c80_catoffers/props.rb
|
71
73
|
- app/assets/javascripts/c80_catoffers.js.coffee
|
72
74
|
- app/assets/javascripts/c80_catoffers/offer_full_desc.js
|
75
|
+
- app/assets/javascripts/c80_catoffers/offers_ajax.js
|
73
76
|
- app/assets/stylesheets/c80_catoffers.scss
|
74
77
|
- app/assets/stylesheets/c80_catoffers/_mixins/default_li_iconed.scss
|
75
78
|
- app/assets/stylesheets/c80_catoffers/offer_full_desc.scss
|
@@ -78,25 +81,42 @@ files:
|
|
78
81
|
- app/assets/stylesheets/c80_catoffers/offer_list_iconed.scss
|
79
82
|
- app/assets/stylesheets/c80_catoffers/offer_list_iconed_columns.scss
|
80
83
|
- app/assets/stylesheets/c80_catoffers/offer_list_widget.scss
|
84
|
+
- app/assets/stylesheets/c80_catoffers/will_paginate.scss
|
81
85
|
- app/assets/stylesheets/c80_catoffers_backend.scss
|
82
86
|
- app/assets/stylesheets/c80_catoffers_backend/page_admin_props.scss
|
87
|
+
- app/controllers/c80_catoffers/application_controller.rb
|
83
88
|
- app/helpers/c80_catoffers/app_helper.rb
|
89
|
+
- app/helpers/c80_catoffers/csamples_helper.rb
|
84
90
|
- app/helpers/c80_catoffers/inner/css_helper.rb
|
91
|
+
- app/helpers/c80_catoffers/inner/modal_helper.rb
|
92
|
+
- app/helpers/c80_catoffers/price_helper.rb
|
85
93
|
- app/helpers/c80_catoffers/urls_helper.rb
|
86
94
|
- app/models/c80_catoffers/category.rb
|
95
|
+
- app/models/c80_catoffers/crow.rb
|
96
|
+
- app/models/c80_catoffers/csample.rb
|
97
|
+
- app/models/c80_catoffers/csprop.rb
|
87
98
|
- app/models/c80_catoffers/offer.rb
|
88
99
|
- app/models/c80_catoffers/ophoto.rb
|
89
100
|
- app/models/c80_catoffers/prop.rb
|
101
|
+
- app/uploaders/c80_catoffers/csphoto_uploader.rb
|
90
102
|
- app/uploaders/c80_catoffers/ophoto_uploader.rb
|
103
|
+
- app/views/c80_catoffers/_bs_modal.html.erb
|
104
|
+
- app/views/c80_catoffers/_csamples_widget.html.erb
|
91
105
|
- app/views/c80_catoffers/_offer_full_desc.html.erb
|
92
106
|
- app/views/c80_catoffers/_offers_list_by_cat.html.erb
|
93
107
|
- app/views/c80_catoffers/_offers_list_grouped.html.erb
|
94
108
|
- app/views/c80_catoffers/_offers_list_iconed.html.erb
|
95
109
|
- app/views/c80_catoffers/_offers_list_iconed_columns.html.erb
|
96
110
|
- app/views/c80_catoffers/_offers_list_widget.html.erb
|
111
|
+
- app/views/c80_catoffers/_offers_page.html.erb
|
112
|
+
- app/views/c80_catoffers/_popup_price.html.erb
|
113
|
+
- app/views/c80_catoffers/application/fake_main.html.erb
|
114
|
+
- app/views/c80_catoffers/application/offers_guru.js.erb
|
115
|
+
- app/views/c80_catoffers/application/price_me.js.erb
|
97
116
|
- bin/console
|
98
117
|
- bin/setup
|
99
118
|
- c80_catoffers.gemspec
|
119
|
+
- config/locales/ru.yml
|
100
120
|
- config/routes.rb
|
101
121
|
- db/migrate/201609221321_c80_catoffers_create_props.rb
|
102
122
|
- db/migrate/201609221322_c80_catoffers_create_categories.rb
|
@@ -107,6 +127,11 @@ files:
|
|
107
127
|
- db/migrate/20161008134848_c80_catoffers_add_join_table_offers_props.rb
|
108
128
|
- db/migrate/20161008151414_c80_catoffers_add_positions_count_to_props.rb
|
109
129
|
- db/migrate/20161023115252_c80_catoffers_add_thumb_md_to_props.rb
|
130
|
+
- db/migrate/20161105123939_c80_catoffers_add_per_page_to_props.rb
|
131
|
+
- db/migrate/20161106154221_create_c80_catoffers_csamples.rb
|
132
|
+
- db/migrate/20161106191544_create_c80_catoffers_crows.rb
|
133
|
+
- db/migrate/20161107115555_c80_catoffers_create_csprops.rb
|
134
|
+
- db/migrate/20161107123333_c80_catoffers_create_join_table_csprops_csamples.rb
|
110
135
|
- db/seeds/c80_catoffers_01_fill_props.rb
|
111
136
|
- db/seeds/c80_catoffers_02_fill_offers.rb
|
112
137
|
- db/seeds/x02_fill_categories.rb
|