c80_estate 0.1.0.4 → 0.1.0.5
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_estate/areas.rb +29 -1
- data/app/assets/stylesheets/c80_estate/backend/admin_areas.scss +4 -0
- data/app/assets/stylesheets/c80_estate/backend/admin_prop_names.scss +18 -0
- data/app/models/c80_estate/area.rb +71 -0
- data/app/models/c80_estate/item_prop.rb +5 -0
- data/config/locales/ru.yml +104 -0
- data/lib/c80_estate/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 92af0bcd120ccea43d4e9ca0659b0b327cb2bc99
|
4
|
+
data.tar.gz: 1044a9f90b63402bd786df086fc27d3e011dc534
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f5f1d56d4a4365128365fc574ed8864df30608746d15d238e78c9ade84caf728e45e058e437f02c3ca5277bb1d01c979f735fe0ada5f3e4f22fd84717d66daf8
|
7
|
+
data.tar.gz: 9b2fce81d9f2ac426a48f1d9c1c832cddb02bff36c35750b3f5e9d2bb68d2d65af692b3cd0108412ee8d26a09bb874db24f9faf5b07495924e91c2e47db2da43
|
@@ -18,12 +18,40 @@ ActiveAdmin.register C80Estate::Area, as: 'Area' do
|
|
18
18
|
|
19
19
|
config.sort_order = 'id_asc'
|
20
20
|
|
21
|
-
filter :
|
21
|
+
filter :atype_id,
|
22
|
+
:label => 'Тип площади',
|
23
|
+
:as => :select,
|
24
|
+
:collection => -> {C80Estate::Atype.all.map { |p| ["#{p.title}", p.id]}},
|
25
|
+
:input_html => { :class => 'selectpicker', 'data-size' => "10", 'data-width' => '100%'}
|
22
26
|
filter :property_id,
|
27
|
+
:label => 'Объект недвижимости',
|
23
28
|
:as => :select,
|
24
29
|
:collection => -> {C80Estate::Property.all.map { |p| ["#{p.title}", p.id]}},
|
25
30
|
:input_html => { :class => 'selectpicker', 'data-size' => "10", 'data-width' => '100%'}
|
31
|
+
|
32
|
+
filter :item_prop_square_val_in,
|
33
|
+
:as => :string,
|
34
|
+
:label => 'Площадь (м.кв.)'
|
35
|
+
|
36
|
+
filter :item_prop_price_val_in,
|
37
|
+
:as => :string,
|
38
|
+
:label => 'Цена'
|
39
|
+
|
40
|
+
filter :item_prop_oenter_in,
|
41
|
+
:as => :select,
|
42
|
+
:collection => [['Есть',11],['Нет',10]],
|
43
|
+
:label => 'Отдельный вход с улицы',
|
44
|
+
:input_html => { :class => 'selectpicker', 'data-size' => "3", 'data-width' => '100%'}
|
45
|
+
|
46
|
+
filter :item_prop_floor_val_in,
|
47
|
+
:as => :select,
|
48
|
+
:collection => -> { C80Estate::ItemProp.all_uniq_values(5) },
|
49
|
+
:label => 'Этаж',
|
50
|
+
:input_html => { :class => 'selectpicker', 'data-size' => "3", 'data-width' => '100%'}
|
51
|
+
|
52
|
+
# filter :title
|
26
53
|
filter :assigned_person_id,
|
54
|
+
:label => 'Назначенный пользователь',
|
27
55
|
:as => :select,
|
28
56
|
:collection => -> {AdminUser.all.map{|u| ["#{u.email}", u.id]}},
|
29
57
|
:input_html => { :class => 'selectpicker', 'data-size' => "10", 'data-width' => '100%'}
|
@@ -76,6 +76,37 @@ module C80Estate
|
|
76
76
|
sum
|
77
77
|
end
|
78
78
|
|
79
|
+
def self.where_price(v)
|
80
|
+
self.joins(:item_props)
|
81
|
+
.where(c80_estate_item_props: {prop_name_id: 1})
|
82
|
+
.where(c80_estate_item_props: {value: v})
|
83
|
+
end
|
84
|
+
|
85
|
+
def self.where_square(v)
|
86
|
+
C80Estate::Area.joins(:item_props)
|
87
|
+
.where(c80_estate_item_props: {prop_name_id: 9})
|
88
|
+
.where(c80_estate_item_props: {value: v})
|
89
|
+
end
|
90
|
+
|
91
|
+
def self.where_oenter(v)
|
92
|
+
# Rails.logger.debug "\t\t [2]: v = #{v}"
|
93
|
+
r = C80Estate::Area.joins(:item_props)
|
94
|
+
.where(c80_estate_item_props: {prop_name_id: 8})
|
95
|
+
if v.to_i == 11
|
96
|
+
r = r.where(c80_estate_item_props: {value: 1})
|
97
|
+
else
|
98
|
+
r = r.where.not(c80_estate_item_props: {value: 1})
|
99
|
+
end
|
100
|
+
r
|
101
|
+
end
|
102
|
+
|
103
|
+
def self.where_floor(v)
|
104
|
+
# Rails.logger.debug "\t\t [2]: v = #{v}"
|
105
|
+
C80Estate::Area.joins(:item_props)
|
106
|
+
.where(c80_estate_item_props: {prop_name_id: 5})
|
107
|
+
.where(c80_estate_item_props: {value: v})
|
108
|
+
end
|
109
|
+
|
79
110
|
def atype_title
|
80
111
|
res = "-"
|
81
112
|
if atype.present?
|
@@ -124,6 +155,46 @@ module C80Estate
|
|
124
155
|
res
|
125
156
|
end
|
126
157
|
|
158
|
+
ransacker :item_prop_price_val,
|
159
|
+
formatter: proc { |price|
|
160
|
+
results = C80Estate::Area.where_price(price).map(&:id)
|
161
|
+
results = results.present? ? results : nil
|
162
|
+
}, splat_params: true do |parent|
|
163
|
+
parent.table[:id]
|
164
|
+
end
|
165
|
+
|
166
|
+
ransacker :item_prop_square_val,
|
167
|
+
formatter: proc { |square|
|
168
|
+
results = C80Estate::Area.where_square(square).map(&:id)
|
169
|
+
results = results.present? ? results : nil
|
170
|
+
}, splat_params: true do |parent|
|
171
|
+
parent.table[:id]
|
172
|
+
end
|
173
|
+
|
174
|
+
ransacker :item_prop_floor_val,
|
175
|
+
formatter: proc { |v|
|
176
|
+
results = C80Estate::Area.where_floor(v).map(&:id)
|
177
|
+
results = results.present? ? results : nil
|
178
|
+
}, splat_params: true do |parent|
|
179
|
+
parent.table[:id]
|
180
|
+
end
|
181
|
+
|
182
|
+
ransacker :item_prop_oenter,
|
183
|
+
formatter: proc { |option|
|
184
|
+
# Неважно: -1
|
185
|
+
# Да: 1
|
186
|
+
# Нет: 0
|
187
|
+
Rails.logger.debug "\t\t [1]: option = #{option}"
|
188
|
+
|
189
|
+
if option.to_i == 10 || option.to_i == 11
|
190
|
+
results = C80Estate::Area.where_oenter(option).map(&:id)
|
191
|
+
end
|
192
|
+
|
193
|
+
results = results.present? ? results : nil
|
194
|
+
}, splat_params: true do |parent|
|
195
|
+
parent.table[:id]
|
196
|
+
end
|
197
|
+
|
127
198
|
protected
|
128
199
|
|
129
200
|
# при создании площади генерится начальное событие
|
@@ -0,0 +1,104 @@
|
|
1
|
+
ru:
|
2
|
+
activerecord:
|
3
|
+
models:
|
4
|
+
area:
|
5
|
+
one: "площадь"
|
6
|
+
other: "Площади"
|
7
|
+
c80_news_tz/nphoto: ""
|
8
|
+
c80_news_tz/gallery: ""
|
9
|
+
c80_news_tz/gphoto: "картинку"
|
10
|
+
c80_news_tz/cphoto: ""
|
11
|
+
c80_news_tz/fphoto: ""
|
12
|
+
c80_news_tz/adress: ""
|
13
|
+
property:
|
14
|
+
one: "объект"
|
15
|
+
other: "Объекты"
|
16
|
+
uom:
|
17
|
+
one: 'единицу измерения'
|
18
|
+
other: 'Единицы измерения'
|
19
|
+
prop_name:
|
20
|
+
one: 'имя свойства'
|
21
|
+
other: 'Имена свойств'
|
22
|
+
role_type:
|
23
|
+
one: 'роль'
|
24
|
+
other: 'Роли'
|
25
|
+
astatus:
|
26
|
+
one: 'статус'
|
27
|
+
other: 'Статусы'
|
28
|
+
atype:
|
29
|
+
one: 'тип'
|
30
|
+
other: 'Типы площадей'
|
31
|
+
admin_user:
|
32
|
+
one: 'пользователя'
|
33
|
+
other: 'Пользователи'
|
34
|
+
attributes:
|
35
|
+
c80_estate/area:
|
36
|
+
title: "Название"
|
37
|
+
atype: 'Тип'
|
38
|
+
property: 'Объект'
|
39
|
+
astatus: 'Статус'
|
40
|
+
assigned_person: 'Ответственный'
|
41
|
+
created_at: 'Время создания'
|
42
|
+
updated_at: 'Изменён'
|
43
|
+
c80_news_tz/nphoto:
|
44
|
+
image: 'Файл'
|
45
|
+
c80_news_tz/adress:
|
46
|
+
locality: 'Город'
|
47
|
+
street: 'Улица'
|
48
|
+
telephone_1: 'Телефон №1'
|
49
|
+
telephone_2: 'Телефон №2'
|
50
|
+
telephone_3: 'Телефон №3'
|
51
|
+
latitude: 'Широта'
|
52
|
+
longitude: 'Долгота'
|
53
|
+
email_1: 'Email №1'
|
54
|
+
email_2: 'Email №2'
|
55
|
+
site_1: 'Сайт №1'
|
56
|
+
site_2: 'Сайт №2'
|
57
|
+
c80_news_tz/company:
|
58
|
+
title: 'Название'
|
59
|
+
activity_type: 'Род деятельности'
|
60
|
+
desc: 'Описание'
|
61
|
+
facts: 'Публикации'
|
62
|
+
c80_news_tz/gallery:
|
63
|
+
title: 'Название галереи'
|
64
|
+
c80_news_tz/fact:
|
65
|
+
title: 'Заголовок'
|
66
|
+
created_at: 'Дата создания'
|
67
|
+
short: 'Кратко'
|
68
|
+
rubrics: 'Рубрики'
|
69
|
+
issues: 'Номер'
|
70
|
+
issue: 'Номер'
|
71
|
+
leader_abz: 'Лидер абзац'
|
72
|
+
full: ''
|
73
|
+
companies: ''
|
74
|
+
c80_news_tz/issue:
|
75
|
+
number: 'Номер'
|
76
|
+
pdf: 'PDF'
|
77
|
+
pdfs: 'PDF'
|
78
|
+
facts: 'Публикации'
|
79
|
+
c80_news_tz/rubric:
|
80
|
+
title: 'Название'
|
81
|
+
facts: 'Публикации'
|
82
|
+
c80_news_tz/location:
|
83
|
+
title: 'Название'
|
84
|
+
facts: 'Публикация'
|
85
|
+
c80_news_tz/r_live:
|
86
|
+
title: 'Название'
|
87
|
+
r_advertisers: 'Рекламодатель'
|
88
|
+
c80_news_tz/r_advertiser:
|
89
|
+
title: 'Название'
|
90
|
+
logo: 'Лого'
|
91
|
+
r_blurbs: 'Публикации'
|
92
|
+
c80_news_tz/r_blurb:
|
93
|
+
title: 'Заголовок'
|
94
|
+
created_at: 'Дата создания'
|
95
|
+
short: 'Кратко'
|
96
|
+
rubrics: 'Рубрики'
|
97
|
+
issues: 'Номер'
|
98
|
+
issue: 'Номер'
|
99
|
+
leader_abz: 'Лидер абзац'
|
100
|
+
full: ''
|
101
|
+
r_advertisers: ''
|
102
|
+
c80_news_tz/spot:
|
103
|
+
title: 'Название'
|
104
|
+
rubrics: 'Рубрика'
|
data/lib/c80_estate/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: c80_estate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.0.
|
4
|
+
version: 0.1.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- C80609A
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -87,6 +87,7 @@ files:
|
|
87
87
|
- app/assets/javascript/c80_estate/lib/jquery.canvasjs.min.js
|
88
88
|
- app/assets/javascript/c80_estate_active_admin.js.coffee
|
89
89
|
- app/assets/stylesheets/c80_estate/backend/admin_areas.scss
|
90
|
+
- app/assets/stylesheets/c80_estate/backend/admin_prop_names.scss
|
90
91
|
- app/assets/stylesheets/c80_estate/backend/admin_pstats.scss
|
91
92
|
- app/assets/stylesheets/c80_estate/backend/admin_sevents.scss
|
92
93
|
- app/assets/stylesheets/c80_estate/backend/admin_users.scss
|
@@ -129,6 +130,7 @@ files:
|
|
129
130
|
- bin/console
|
130
131
|
- bin/setup
|
131
132
|
- c80_estate.gemspec
|
133
|
+
- config/locales/ru.yml
|
132
134
|
- config/routes.rb
|
133
135
|
- db/migrate/20160629033535_create_c80_estate_properties.rb
|
134
136
|
- db/migrate/20160629033538_create_c80_estate_areas.rb
|