c80_map_floors 0.1.0.3 → 0.1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/buttons/button_back_to_map.js +3 -2
- data/app/assets/javascripts/c80_map_floors.js.coffee +1 -0
- data/app/assets/javascripts/lib/obj_size.js +31 -0
- data/app/assets/javascripts/map_objects/area.js +14 -14
- data/app/assets/javascripts/map_objects/building.js +27 -10
- data/app/assets/javascripts/src/main.js +48 -47
- data/app/assets/javascripts/src/state_controller.js +76 -18
- data/app/assets/javascripts/src/utils/i18n.js +26 -0
- data/app/assets/javascripts/ui/tabs/tabs.js +114 -31
- data/app/assets/javascripts/view/building_info/building_info.js +20 -9
- data/app/assets/javascripts/view/building_info/mobj_info_parser.js +57 -0
- data/app/assets/stylesheets/c80_map_floors.scss +1 -0
- data/app/assets/stylesheets/ui/tabs_js.scss +32 -0
- data/app/assets/stylesheets/view/elems/building_info.scss +0 -19
- data/app/controllers/c80_map_floors/ajax_controller.rb +1 -0
- data/app/models/c80_map_floors/area.rb +15 -6
- data/app/models/c80_map_floors/area_representator.rb +19 -2
- data/app/models/c80_map_floors/base_map_object.rb +8 -3
- data/app/models/c80_map_floors/building_representator.rb +27 -3
- data/app/models/c80_map_floors/floor.rb +52 -0
- data/app/models/c80_map_floors/floor_representator.rb +65 -0
- data/app/models/c80_map_floors/map_building.rb +127 -7
- data/app/models/c80_map_floors/map_json.rb +2 -2
- data/app/views/c80_map_floors/ajax/shared/_select_list_unlinked_buildings.html.erb +1 -1
- data/db/migrate/20161015190003_add_building_representator_to_c80_map_floors_buildings.rb +1 -1
- data/db/migrate/20161128181616_add_map_floor_representator_to_c80_map_floors_floors.rb +6 -0
- data/lib/c80_map_floors/version.rb +1 -1
- metadata +8 -2
@@ -24,25 +24,6 @@
|
|
24
24
|
background-color: #54658E;
|
25
25
|
}
|
26
26
|
|
27
|
-
ul {
|
28
|
-
list-style: none;
|
29
|
-
margin-left: 0;
|
30
|
-
padding-left: 0;
|
31
|
-
/*@include frankRegular(15px);*/
|
32
|
-
|
33
|
-
li {
|
34
|
-
overflow: hidden;
|
35
|
-
|
36
|
-
-webkit-transition: all 0.3s;
|
37
|
-
-moz-transition: all 0.3s;
|
38
|
-
transition: all 0.3s;
|
39
|
-
|
40
|
-
span {
|
41
|
-
color: #6f6f6f;
|
42
|
-
}
|
43
|
-
}
|
44
|
-
}
|
45
|
-
|
46
27
|
h5 {
|
47
28
|
border-top: 1px solid #14233C;
|
48
29
|
color: #1f283e;
|
@@ -24,6 +24,7 @@ module C80MapFloors
|
|
24
24
|
def link_area
|
25
25
|
Rails.logger.debug "<AjaxController.link_area> params = #{params}"
|
26
26
|
|
27
|
+
# TODO:: т.к. ПОКА используем этот gem только в stroy101, то должно быть не Rent::Area
|
27
28
|
rent_area = Rent::Area.find(params[:rent_area_id])
|
28
29
|
map_area = C80Map::Area.find(params[:map_area_id])
|
29
30
|
rent_area.map_areas.delete_all
|
@@ -5,16 +5,25 @@ module C80MapFloors
|
|
5
5
|
|
6
6
|
belongs_to :floor
|
7
7
|
belongs_to :area_representator, :polymorphic => true
|
8
|
-
# validates :coords, uniqueness: true
|
9
8
|
acts_as_base_map_object
|
10
9
|
|
11
|
-
|
10
|
+
def my_as_json
|
12
11
|
|
13
|
-
|
12
|
+
result = {
|
13
|
+
id: self.id,
|
14
|
+
tag: self.tag,
|
15
|
+
floor_id: self.floor_id,
|
16
|
+
class_name: self.class_name,
|
17
|
+
coords: self.coords,
|
18
|
+
data: nil
|
19
|
+
}
|
14
20
|
|
15
|
-
|
16
|
-
|
17
|
-
|
21
|
+
if self.area_representator.present?
|
22
|
+
result[:data] = self.area_representator.my_as_json2
|
23
|
+
end
|
24
|
+
|
25
|
+
result.as_json
|
26
|
+
end
|
18
27
|
|
19
28
|
end
|
20
29
|
end
|
@@ -19,7 +19,7 @@ module C80MapFloors
|
|
19
19
|
def acts_as_map_area_representator
|
20
20
|
class_eval do
|
21
21
|
|
22
|
-
has_many :map_areas, :as => :area_representator, :class_name => 'C80MapFloors::Area', :dependent => :
|
22
|
+
has_many :map_areas, :as => :area_representator, :class_name => 'C80MapFloors::Area', :dependent => :nullify
|
23
23
|
after_save :update_json
|
24
24
|
|
25
25
|
def self.unlinked_areas
|
@@ -33,7 +33,7 @@ module C80MapFloors
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def update_json
|
36
|
-
MapJson.update_json
|
36
|
+
# MapJson.update_json # NOTE:: возможно, временно отключён
|
37
37
|
end
|
38
38
|
|
39
39
|
end
|
@@ -42,6 +42,8 @@ module C80MapFloors
|
|
42
42
|
|
43
43
|
module InstanceMethods
|
44
44
|
|
45
|
+
=begin
|
46
|
+
# legacy от с80_map
|
45
47
|
def to_hash_a
|
46
48
|
res = {
|
47
49
|
id: id,
|
@@ -58,6 +60,21 @@ module C80MapFloors
|
|
58
60
|
}
|
59
61
|
res
|
60
62
|
end
|
63
|
+
=end
|
64
|
+
|
65
|
+
def my_as_json2
|
66
|
+
result = {
|
67
|
+
id: self.id,
|
68
|
+
title: self.name,
|
69
|
+
square: self.square,
|
70
|
+
square_free: self.square_free,
|
71
|
+
desc: self.desc,
|
72
|
+
floor_height: self.floor_height,
|
73
|
+
price_string: self.price_string,
|
74
|
+
communications: self.communications
|
75
|
+
}
|
76
|
+
result.as_json
|
77
|
+
end
|
61
78
|
|
62
79
|
# свободна ли площадь, привязанная к полигону на карте
|
63
80
|
def is_free?
|
@@ -13,11 +13,16 @@ module C80MapFloors
|
|
13
13
|
def acts_as_base_map_object
|
14
14
|
class_eval do
|
15
15
|
|
16
|
-
#
|
17
|
-
after_save :update_json
|
16
|
+
# NOTE:: возможно, временно
|
17
|
+
# after_save :update_json
|
18
|
+
|
19
|
+
# TODO:: оставить в этом файле только InstanceMethods с class_name
|
20
|
+
|
21
|
+
# TODO?
|
18
22
|
# after_destroy :update_json
|
23
|
+
|
19
24
|
# validates :coords, uniqueness: true
|
20
|
-
validates_uniqueness_of :coords, :allow_nil => true, :allow_blank => true
|
25
|
+
validates_uniqueness_of :coords, :allow_nil => true, :allow_blank => true #-> глючит для Этажей - у них могут быть одинаковые coords
|
21
26
|
|
22
27
|
def update_json
|
23
28
|
MapJson.update_json
|
@@ -19,15 +19,15 @@ module C80MapFloors
|
|
19
19
|
def acts_as_map_building_representator
|
20
20
|
class_eval do
|
21
21
|
|
22
|
-
|
22
|
+
has_one :map_building, :as => :building_representator, :class_name => 'C80MapFloors::MapBuilding', :dependent => :nullify
|
23
23
|
after_save :update_json
|
24
24
|
|
25
25
|
def self.unlinked_buildings
|
26
26
|
res = []
|
27
27
|
self.all.each do |building|
|
28
|
-
|
28
|
+
unless building.map_building.present?
|
29
29
|
res << building
|
30
|
-
|
30
|
+
end
|
31
31
|
end
|
32
32
|
res
|
33
33
|
end
|
@@ -42,6 +42,21 @@ module C80MapFloors
|
|
42
42
|
|
43
43
|
module InstanceMethods
|
44
44
|
|
45
|
+
def my_as_json
|
46
|
+
result = {
|
47
|
+
id: self.id,
|
48
|
+
title: self.title,
|
49
|
+
square: self.square,
|
50
|
+
square_free: self.square_free,
|
51
|
+
desc: self.desc,
|
52
|
+
floor_height: self.floor_height,
|
53
|
+
price_string: self.price_string,
|
54
|
+
communications: self.communications
|
55
|
+
}
|
56
|
+
result.as_json
|
57
|
+
end
|
58
|
+
|
59
|
+
=begin
|
45
60
|
def to_hash
|
46
61
|
|
47
62
|
Rails.logger.debug "<BuildingRepresentator.to_hash> self.free_square = #{self.free_square}"
|
@@ -63,6 +78,15 @@ module C80MapFloors
|
|
63
78
|
}
|
64
79
|
res
|
65
80
|
end
|
81
|
+
=end
|
82
|
+
|
83
|
+
=begin
|
84
|
+
def serializable_hash(options = nil)
|
85
|
+
super({
|
86
|
+
:except => [:created_at, :updated_at]
|
87
|
+
})
|
88
|
+
end
|
89
|
+
=end
|
66
90
|
|
67
91
|
end
|
68
92
|
|
@@ -5,6 +5,7 @@ module C80MapFloors
|
|
5
5
|
|
6
6
|
belongs_to :map_building
|
7
7
|
has_many :areas, :class_name => 'C80MapFloors::Area', :dependent => :destroy
|
8
|
+
belongs_to :map_floor_representator, :polymorphic => true
|
8
9
|
acts_as_base_map_object
|
9
10
|
|
10
11
|
# validates :coords, uniqueness: true
|
@@ -32,6 +33,22 @@ module C80MapFloors
|
|
32
33
|
end
|
33
34
|
res
|
34
35
|
end
|
36
|
+
|
37
|
+
def img_bg_url
|
38
|
+
res = nil
|
39
|
+
if img_bg.present?
|
40
|
+
res = img_bg.url
|
41
|
+
end
|
42
|
+
res
|
43
|
+
end
|
44
|
+
|
45
|
+
def img_overlay_url
|
46
|
+
res = nil
|
47
|
+
if img_overlay.present?
|
48
|
+
res = img_overlay.url
|
49
|
+
end
|
50
|
+
res
|
51
|
+
end
|
35
52
|
|
36
53
|
# private
|
37
54
|
|
@@ -42,5 +59,40 @@ module C80MapFloors
|
|
42
59
|
# MapJson.update_json
|
43
60
|
end
|
44
61
|
|
62
|
+
def my_as_json
|
63
|
+
|
64
|
+
result = {
|
65
|
+
ord: self.ord,
|
66
|
+
id: self.id,
|
67
|
+
title: self.title,
|
68
|
+
tag: self.tag,
|
69
|
+
class_name: self.class_name,
|
70
|
+
map_building_id: self.map_building_id,
|
71
|
+
img_bg: {
|
72
|
+
url: self.img_bg_url
|
73
|
+
},
|
74
|
+
img_overlay: {
|
75
|
+
url: self.img_overlay_url
|
76
|
+
},
|
77
|
+
img_bg_width: img_bg_width,
|
78
|
+
img_bg_height: img_bg_height,
|
79
|
+
coords: self.coords,
|
80
|
+
areas: [],
|
81
|
+
data: nil
|
82
|
+
}
|
83
|
+
|
84
|
+
self.areas.each do |area|
|
85
|
+
result[:areas] << area.my_as_json
|
86
|
+
end
|
87
|
+
|
88
|
+
# если имеются ДАННЫЕ - прицепим их к JSON
|
89
|
+
if self.map_floor_representator.present?
|
90
|
+
result[:data] = self.map_floor_representator.my_as_json3
|
91
|
+
end
|
92
|
+
|
93
|
+
result.as_json
|
94
|
+
|
95
|
+
end
|
96
|
+
|
45
97
|
end
|
46
98
|
end
|
@@ -0,0 +1,65 @@
|
|
1
|
+
module C80MapFloors
|
2
|
+
|
3
|
+
module FloorRepresentator
|
4
|
+
|
5
|
+
extend ActiveSupport::Concern
|
6
|
+
|
7
|
+
# ERROR: Cannot define multiple 'included' blocks for a Concern
|
8
|
+
# included do
|
9
|
+
#
|
10
|
+
# end
|
11
|
+
|
12
|
+
def self.included(klass)
|
13
|
+
klass.extend ClassMethods
|
14
|
+
klass.send(:include, InstanceMethods)
|
15
|
+
end
|
16
|
+
|
17
|
+
module ClassMethods
|
18
|
+
|
19
|
+
def acts_as_map_floor_representator
|
20
|
+
class_eval do
|
21
|
+
|
22
|
+
has_one :floor, :as => :map_floor_representator, :class_name => 'C80MapFloors::Floor', :dependent => :nullify
|
23
|
+
# after_save :update_json # NOTE:: возможно, временно
|
24
|
+
|
25
|
+
def self.unlinked_floors
|
26
|
+
res = []
|
27
|
+
self.all.each do |sfloor|
|
28
|
+
unless sfloor.floor.present?
|
29
|
+
res << sfloor
|
30
|
+
end
|
31
|
+
end
|
32
|
+
res
|
33
|
+
end
|
34
|
+
|
35
|
+
def update_json
|
36
|
+
MapJson.update_json
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
module InstanceMethods
|
44
|
+
|
45
|
+
# noinspection RubyResolve
|
46
|
+
def my_as_json3
|
47
|
+
result = {
|
48
|
+
id: self.id,
|
49
|
+
ord: self.ord,
|
50
|
+
title: self.title,
|
51
|
+
square: self.square,
|
52
|
+
square_free: self.square_free,
|
53
|
+
areas_count: self.areas.count,
|
54
|
+
areas_free_count: self.areas.free_areas.count,
|
55
|
+
price_string: self.price_string
|
56
|
+
}
|
57
|
+
result.as_json
|
58
|
+
end
|
59
|
+
|
60
|
+
end
|
61
|
+
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
ActiveRecord::Base.send :include, C80MapFloors::FloorRepresentator
|
@@ -1,16 +1,21 @@
|
|
1
|
+
# noinspection RubyResolve
|
1
2
|
require 'c80_map_floors/base_map_object'
|
2
3
|
require 'integer'
|
3
4
|
|
4
5
|
module C80MapFloors
|
6
|
+
# noinspection RubyResolve
|
5
7
|
class MapBuilding < ActiveRecord::Base
|
6
8
|
|
9
|
+
include ActiveModel::Dirty
|
10
|
+
|
7
11
|
has_many :floors, :class_name => 'C80MapFloors::Floor', :dependent => :destroy
|
8
12
|
belongs_to :building_representator, :polymorphic => true
|
9
|
-
# validates :coords, uniqueness: true
|
10
|
-
# after_save :update_json
|
11
13
|
|
12
14
|
after_create :calc_coords_img
|
13
15
|
|
16
|
+
after_create :auto_assign_floors_by_ord
|
17
|
+
after_update :auto_assign_floors_by_ord
|
18
|
+
|
14
19
|
acts_as_base_map_object
|
15
20
|
|
16
21
|
mount_uploader :img, C80MapFloors::BuildingImageUploader
|
@@ -19,11 +24,42 @@ module C80MapFloors
|
|
19
24
|
C80MapFloors::Areas.joins(:c80_map_floors_floors).where(:building_id => self.if)
|
20
25
|
end
|
21
26
|
|
22
|
-
def
|
27
|
+
def my_as_json
|
28
|
+
|
29
|
+
result = {
|
30
|
+
id: self.id,
|
31
|
+
title: self.title,
|
32
|
+
tag: self.tag,
|
33
|
+
class_name: self.class_name,
|
34
|
+
coords_img: self.coords_img,
|
35
|
+
coords: self.coords,
|
36
|
+
floors: [],
|
37
|
+
data: nil
|
38
|
+
}
|
39
|
+
|
40
|
+
self.floors.each do |floor|
|
41
|
+
result[:floors] << floor.my_as_json
|
42
|
+
end
|
43
|
+
|
44
|
+
if self.building_representator.present?
|
45
|
+
result[:data] = self.building_representator.my_as_json
|
46
|
+
end
|
47
|
+
|
48
|
+
result.as_json
|
49
|
+
|
50
|
+
end
|
51
|
+
|
52
|
+
# ISSUE: rails as_json except not working
|
53
|
+
# ANSWER: For those looking here for a quick work around, it's burried in the comments,
|
54
|
+
# but basically, you can work around by:
|
55
|
+
# renaming your custom as_json to serializable_hash
|
56
|
+
# github.com/rails/rails/pull/2200#issuecomment-3131652 – ChristopherJ Oct 16 '13 at 5:55
|
57
|
+
=begin
|
58
|
+
def serializable_hash(options = nil)
|
23
59
|
|
24
60
|
super({
|
25
|
-
:except => [:created_at,:updated_at,:building_representator_type],
|
26
|
-
:methods => :class_name,
|
61
|
+
:except => [:created_at,:updated_at,:building_representator_type, :building_representator_id],
|
62
|
+
:methods => [:class_name],
|
27
63
|
:include => [
|
28
64
|
:floors => {
|
29
65
|
:except => [:created_at,:updated_at],
|
@@ -38,6 +74,7 @@ module C80MapFloors
|
|
38
74
|
]
|
39
75
|
}.merge(options || {} ))
|
40
76
|
end
|
77
|
+
=end
|
41
78
|
|
42
79
|
def calc_coords_img
|
43
80
|
|
@@ -59,7 +96,7 @@ module C80MapFloors
|
|
59
96
|
|
60
97
|
xmin = ix < xmin ? ix : xmin
|
61
98
|
ymin = iy < ymin ? iy : ymin
|
62
|
-
|
99
|
+
|
63
100
|
xmax = ix > xmax ? ix : xmax
|
64
101
|
ymax = iy > ymax ? iy : ymax
|
65
102
|
|
@@ -81,11 +118,94 @@ module C80MapFloors
|
|
81
118
|
|
82
119
|
end
|
83
120
|
|
84
|
-
|
121
|
+
private
|
85
122
|
|
86
123
|
# def update_json
|
87
124
|
# MapJson.update_json
|
88
125
|
# end
|
89
126
|
|
127
|
+
# связать Полигоны этажей (принадлежащие этому Полигону здания),
|
128
|
+
# с ord-соответствующими этажами Здания (которое привязано к этому Полигону здания)
|
129
|
+
def auto_assign_floors_by_ord
|
130
|
+
Rails.logger.debug '[TRACE] <map_building.auto_assign_floors_by_ord> связать ПолигоныЭтажей с соответствующими ДаннымиЭтажей.'
|
131
|
+
|
132
|
+
# если у Полигона сменилось Здание
|
133
|
+
if self.building_representator_id_changed?
|
134
|
+
Rails.logger.debug '[TRACE] <map_building.auto_assign_floors_by_ord> У Полигона сменилось Здание.'
|
135
|
+
|
136
|
+
if self.building_representator_id_was.nil?
|
137
|
+
Rails.logger.debug '[TRACE] <map_building.auto_assign_floors_by_ord> У Полигона не было данных до этого.'
|
138
|
+
else
|
139
|
+
Rails.logger.debug '[TRACE] <map_building.auto_assign_floors_by_ord> У Полигона уже были какие-то данные до этого. TODO очистить привязки.'
|
140
|
+
# TODO:: если у ПолигонаЗдания БЫЛО Здание до этого - очистить привязки к данным у соответствующих ПолигоновЭтажей и ПолигоновПлощадей
|
141
|
+
end
|
142
|
+
|
143
|
+
# фиксируем текущие данные этого ПолигонаЗдания
|
144
|
+
bdata = self.building_representator
|
145
|
+
|
146
|
+
if bdata.present?
|
147
|
+
Rails.logger.debug "[TRACE] <map_building.auto_assign_floors_by_ord> Данные ПолигонаЗдания: {title=#{bdata.title}, id=#{bdata.id}}"
|
148
|
+
Rails.logger.debug '[TRACE] <map_building.auto_assign_floors_by_ord> Обходим ПолигоныЭтажей этого ПолигонаЗдания и назначаем им данныеЭтажей по ord.'
|
149
|
+
|
150
|
+
# теперь ПРЕДВАРИТЕЛЬНО проверим, есть ли у ПолигонаЗдания ПолигоныЭтажи
|
151
|
+
if self.floors.count > 0
|
152
|
+
Rails.logger.debug '[TRACE] <map_building.auto_assign_floors_by_ord> У ПолигонаЗдания имеются ПолигоныЭтажей.'
|
153
|
+
|
154
|
+
# еще ПРЕДВАРИТЕЛЬНО проверим, есть ли в ДанныхЗдания этажи
|
155
|
+
if bdata.sfloors.count > 0
|
156
|
+
Rails.logger.debug '[TRACE] <map_building.auto_assign_floors_by_ord> В Данных ПолигонаЗдания имеются данные об Этажах.'
|
157
|
+
|
158
|
+
# ПРОСТО проверим, совпадает ли количество ЭтажейПолигонов и ЭтажейДанных
|
159
|
+
if self.floors.count != bdata.sfloors.count
|
160
|
+
Rails.logger.debug "[TRACE] [WARNING] <map_building.auto_assign_floors_by_ord> количество ЭтажейПолигонов (count=#{self.floors.count}) и ЭтажейДанных (count=#{bdata.sfloors.count}) НЕ совпадает."
|
161
|
+
end
|
162
|
+
|
163
|
+
link_floor_sfloor(bdata)
|
164
|
+
|
165
|
+
else
|
166
|
+
Rails.logger.debug '[TRACE] [ERROR] <map_building.auto_assign_floors_by_ord> В ДанныхЗдания нет этажей.'
|
167
|
+
end
|
168
|
+
|
169
|
+
else
|
170
|
+
Rails.logger.debug '[TRACE] [ERROR] <map_building.auto_assign_floors_by_ord> У ПолигонаЗдания нет ПолигоновЭтажей.'
|
171
|
+
end
|
172
|
+
|
173
|
+
else
|
174
|
+
Rails.logger.debug '[TRACE] [WARNING] <map_building.auto_assign_floors_by_ord> У ПолигонаЗдания нет данных.'
|
175
|
+
end
|
176
|
+
|
177
|
+
end
|
178
|
+
|
179
|
+
end
|
180
|
+
|
181
|
+
def link_floor_sfloor(building_representator)
|
182
|
+
Rails.logger.debug "[TRACE] <map_building.link_floor_sfloor> СВЯЗЫВАЕМ ПОЛИГОНЫ-ЭТАЖЕЙ C ДАННЫМИ. MapBuilding.id=#{self.id}"
|
183
|
+
|
184
|
+
# обходим ПолигоныЭтажей этого ПолигонаЗдания и назначаем им данныеЭтажей по ord
|
185
|
+
Rails.logger.debug '[TRACE] <map_building.link_floor_sfloor> Перебираем ПолигоныЭтажей...'
|
186
|
+
self.floors.each do |floor|
|
187
|
+
Rails.logger.debug "[TRACE] <map_building.link_floor_sfloor> Фиксируем ПолигонЭтажа ord=#{floor.ord}."
|
188
|
+
|
189
|
+
# фиксируем ord-соответствующие данныеЭтажа (dev.. но сначала добавим в данныеЗдания данныеЭтажей)
|
190
|
+
may_be_sfloors = building_representator.sfloors.where(:ord => floor.ord)
|
191
|
+
if may_be_sfloors.count > 0
|
192
|
+
|
193
|
+
# данныеЭтажа
|
194
|
+
sfloor = may_be_sfloors.first
|
195
|
+
Rails.logger.debug "[TRACE] <map_building.link_floor_sfloor> Фиксируем ДанныеЭтажа: #{sfloor.my_as_json3}."
|
196
|
+
|
197
|
+
#-> связываем
|
198
|
+
Rails.logger.debug '[TRACE] <map_building.link_floor_sfloor> Связываем..'
|
199
|
+
floor.map_floor_representator = sfloor
|
200
|
+
floor.save!
|
201
|
+
# SQL (0.5ms) UPDATE `c80_map_floors_floors` SET `map_floor_representator_id` = 2, `map_floor_representator_type` = 'Sfloor', `updated_at` = '2016-11-28 16:54:43.700446' WHERE `c80_map_floors_floors`.`id` = 3
|
202
|
+
|
203
|
+
else
|
204
|
+
Rails.logger.debug '[TRACE] [ERROR] <map_building.auto_assign_floors_by_ord> В ДанныхЗдания нет соответствующего этажа.'
|
205
|
+
end
|
206
|
+
|
207
|
+
end
|
208
|
+
end
|
209
|
+
|
90
210
|
end
|
91
211
|
end
|
@@ -11,8 +11,8 @@ module C80MapFloors
|
|
11
11
|
|
12
12
|
# поместим в него детей - здания со всеми детьми и внуками
|
13
13
|
buildings = []
|
14
|
-
C80MapFloors::MapBuilding.all.each do |
|
15
|
-
buildings <<
|
14
|
+
C80MapFloors::MapBuilding.all.each do |map_building|
|
15
|
+
buildings << map_building.my_as_json
|
16
16
|
end
|
17
17
|
|
18
18
|
locs_hash["buildings"] = buildings
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<select id="unlinked_buildings" class="selectpicker" data-style="btn-default">
|
2
2
|
<% buildings.each do |building| %>
|
3
3
|
<% tt = building.title %>
|
4
|
-
<%
|
4
|
+
<% unless building.map_building.present? %>
|
5
5
|
<% tt += ' (полигон назначен)' %>
|
6
6
|
<% end %>
|
7
7
|
<option value="<%= building.id%>"><%= tt %></option>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
class AddBuildingRepresentatorToC80MapFloorsBuildings < ActiveRecord::Migration
|
2
2
|
def change
|
3
3
|
add_reference :c80_map_floors_map_buildings, :building_representator, index: true
|
4
|
-
add_column :c80_map_floors_map_buildings, :building_representator_type, :string, :default => '
|
4
|
+
add_column :c80_map_floors_map_buildings, :building_representator_type, :string, :default => 'Building'
|
5
5
|
end
|
6
6
|
end
|
@@ -0,0 +1,6 @@
|
|
1
|
+
class AddMapFloorRepresentatorToC80MapFloorsFloors < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
add_reference :c80_map_floors_floors, :map_floor_representator, index: true
|
4
|
+
add_column :c80_map_floors_floors, :map_floor_representator_type, :string, :default => 'Floor'
|
5
|
+
end
|
6
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: c80_map_floors
|
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
|
+
date: 2016-12-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -124,6 +124,7 @@ files:
|
|
124
124
|
- app/assets/javascripts/buttons/zoom_buttons.js
|
125
125
|
- app/assets/javascripts/c80_map_floors.js.coffee
|
126
126
|
- app/assets/javascripts/events/app_event.js
|
127
|
+
- app/assets/javascripts/lib/obj_size.js
|
127
128
|
- app/assets/javascripts/lib/spin.js
|
128
129
|
- app/assets/javascripts/map_objects/area.js
|
129
130
|
- app/assets/javascripts/map_objects/building.js
|
@@ -132,6 +133,7 @@ files:
|
|
132
133
|
- app/assets/javascripts/src/image_loader.js
|
133
134
|
- app/assets/javascripts/src/main.js
|
134
135
|
- app/assets/javascripts/src/state_controller.js
|
136
|
+
- app/assets/javascripts/src/utils/i18n.js
|
135
137
|
- app/assets/javascripts/src/utils/map_utils.js
|
136
138
|
- app/assets/javascripts/src/utils/opacity_buttons_utils.js
|
137
139
|
- app/assets/javascripts/src/utils/utils.js
|
@@ -141,9 +143,11 @@ files:
|
|
141
143
|
- app/assets/javascripts/svg_elements/polygon.js
|
142
144
|
- app/assets/javascripts/ui/tabs/tabs.js
|
143
145
|
- app/assets/javascripts/view/building_info/building_info.js
|
146
|
+
- app/assets/javascripts/view/building_info/mobj_info_parser.js
|
144
147
|
- app/assets/javascripts/view/save_preloader.js
|
145
148
|
- app/assets/stylesheets/c80_map_floors.scss
|
146
149
|
- app/assets/stylesheets/map.scss
|
150
|
+
- app/assets/stylesheets/ui/tabs_js.scss
|
147
151
|
- app/assets/stylesheets/view/buttons/area_order_button.scss
|
148
152
|
- app/assets/stylesheets/view/buttons/back_to_map_button.scss
|
149
153
|
- app/assets/stylesheets/view/elems/building_info.scss
|
@@ -161,6 +165,7 @@ files:
|
|
161
165
|
- app/models/c80_map_floors/base_map_object.rb
|
162
166
|
- app/models/c80_map_floors/building_representator.rb
|
163
167
|
- app/models/c80_map_floors/floor.rb
|
168
|
+
- app/models/c80_map_floors/floor_representator.rb
|
164
169
|
- app/models/c80_map_floors/map_building.rb
|
165
170
|
- app/models/c80_map_floors/map_json.rb
|
166
171
|
- app/models/c80_map_floors/setting.rb
|
@@ -192,6 +197,7 @@ files:
|
|
192
197
|
- db/migrate/20161015190004_create_c80_map_floors_floors.rb
|
193
198
|
- db/migrate/20161019111010_add_title_to_c80_map_floors_buildings.rb
|
194
199
|
- db/migrate/20161020184040_add_coords_img_to_c80_map_floors_buildings.rb
|
200
|
+
- db/migrate/20161128181616_add_map_floor_representator_to_c80_map_floors_floors.rb
|
195
201
|
- db/seeds/c80_map_floors_01_fill_map_settings.rb
|
196
202
|
- db/seeds/c80_map_floors_02_create_test_area.rb
|
197
203
|
- lib/c80_map_floors.rb
|