c80_estate 0.1.0.7 → 0.1.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/admin/c80_estate/admin_user.rb +64 -0
- data/app/admin/c80_estate/areas.rb +101 -36
- data/app/admin/c80_estate/astatuses.rb +1 -1
- data/app/admin/c80_estate/atypes.rb +1 -1
- data/app/admin/c80_estate/comments.rb +25 -0
- data/app/admin/c80_estate/prop_names.rb +1 -1
- data/app/admin/c80_estate/properties.rb +32 -3
- data/app/admin/c80_estate/pstats.rb +1 -1
- data/app/admin/c80_estate/role_types.rb +1 -1
- data/app/admin/c80_estate/sevents.rb +1 -1
- data/app/admin/c80_estate/uoms.rb +1 -1
- data/app/assets/javascript/c80_estate/backend/admin/areas.js +31 -1
- data/app/assets/stylesheets/c80_estate/backend/admin_areas.scss +60 -4
- data/app/assets/stylesheets/c80_estate/backend/admin_properties.scss +15 -0
- data/app/assets/stylesheets/c80_estate/backend/common.scss +15 -0
- data/app/models/c80_estate/area.rb +8 -0
- data/app/models/c80_estate/owner.rb +58 -0
- data/config/locales/ru.yml +22 -1
- data/lib/c80_estate/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef45a0734f727ca6c28d890cacc0f5b90d137f77
|
4
|
+
data.tar.gz: 95cf465ec2c7414913fb91bcd7f27653851bb714
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c343480a6bfe00c558a894e34bab39bbb56c9f9d8d4f347aea72cf87e930450132a90df7645166cc0388194aceba22b2e74aa84e37c633e9bd22deb26eddf938
|
7
|
+
data.tar.gz: 4eb510782d6a2bda0d9218c0b22bad51104c4586e241ce6a1dde9f9747cea881413ce448d6082e8f00f68648a90b000c7c48c33d6009cbf828c08e3f3fe5d56c
|
@@ -0,0 +1,64 @@
|
|
1
|
+
ActiveAdmin.register AdminUser do
|
2
|
+
|
3
|
+
permit_params :email,
|
4
|
+
:password,
|
5
|
+
:password_confirmation,
|
6
|
+
:roles_attributes => [:id, :role_type_id]
|
7
|
+
|
8
|
+
batch_action :destroy, false
|
9
|
+
|
10
|
+
controller do
|
11
|
+
|
12
|
+
def update
|
13
|
+
if params[:admin_user][:password].blank?
|
14
|
+
params[:admin_user].delete('password')
|
15
|
+
params[:admin_user].delete('password_confirmation')
|
16
|
+
end
|
17
|
+
super
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
|
22
|
+
# menu :if => proc {current_admin_user.email == "tz007@mail.ru"}
|
23
|
+
menu label: 'Пользователи', :if => proc { current_admin_user.can_view_users? }
|
24
|
+
index do
|
25
|
+
selectable_column
|
26
|
+
id_column
|
27
|
+
column :email
|
28
|
+
column :current_sign_in_at
|
29
|
+
column :sign_in_count
|
30
|
+
column :created_at
|
31
|
+
column :role do |user|
|
32
|
+
user.role_type_title
|
33
|
+
end
|
34
|
+
actions
|
35
|
+
end
|
36
|
+
|
37
|
+
filter :email
|
38
|
+
filter :current_sign_in_at
|
39
|
+
filter :sign_in_count
|
40
|
+
filter :created_at
|
41
|
+
|
42
|
+
form do |f|
|
43
|
+
f.inputs "Свойства" do
|
44
|
+
f.input :email
|
45
|
+
|
46
|
+
if f.object.new_record?
|
47
|
+
f.input :password
|
48
|
+
f.input :password_confirmation
|
49
|
+
else
|
50
|
+
# f.input :password
|
51
|
+
# f.input :password_confirmation
|
52
|
+
end
|
53
|
+
|
54
|
+
# f.input :roles
|
55
|
+
f.has_many :roles,
|
56
|
+
new_record: true,
|
57
|
+
allow_destroy: false do |r|
|
58
|
+
r.input :role_type
|
59
|
+
end
|
60
|
+
end
|
61
|
+
f.actions
|
62
|
+
end
|
63
|
+
|
64
|
+
end
|
@@ -13,21 +13,72 @@ ActiveAdmin.register C80Estate::Area, as: 'Area' do
|
|
13
13
|
:atype_id,
|
14
14
|
:property_id,
|
15
15
|
:astatus_ids => [],
|
16
|
-
:aphotos_attributes => [:id
|
16
|
+
:aphotos_attributes => [:id, :image, :_destroy],
|
17
17
|
:item_props_attributes => [:value, :_destroy, :prop_name_id, :id]
|
18
18
|
|
19
|
+
batch_action :destroy, false
|
20
|
+
|
21
|
+
batch_action 'Задать цену', form: {
|
22
|
+
# type: %w[Offensive Spam Other],
|
23
|
+
val: :text,
|
24
|
+
# notes: :textarea,
|
25
|
+
# hide: :checkbox,
|
26
|
+
# date: :datepicker
|
27
|
+
} do |ids, inputs|
|
28
|
+
# inputs is a hash of all the form fields you requested
|
29
|
+
redirect_to collection_path, notice: [ids, inputs].to_s
|
30
|
+
|
31
|
+
end
|
32
|
+
|
33
|
+
batch_action 'Задать объём площади', form: {
|
34
|
+
# type: %w[Offensive Spam Other],
|
35
|
+
val: :text,
|
36
|
+
# notes: :textarea,
|
37
|
+
# hide: :checkbox,
|
38
|
+
# date: :datepicker
|
39
|
+
} do |ids, inputs|
|
40
|
+
# inputs is a hash of all the form fields you requested
|
41
|
+
redirect_to collection_path, notice: [ids, inputs].to_s
|
42
|
+
end
|
43
|
+
|
44
|
+
config.clear_action_items!
|
45
|
+
|
46
|
+
action_item :new_model, :only => :index do
|
47
|
+
if current_admin_user.can_create_areas?
|
48
|
+
link_to I18n.t("active_admin.new_model"), '/admin/areas/new', method: :get
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
action_item only: [:show] do
|
53
|
+
if current_admin_user.can_edit_area?(resource)
|
54
|
+
link_to I18n.t("active_admin.edit_model"), edit_admin_area_path(resource)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
action_item only: [:show] do
|
59
|
+
if current_admin_user.can_delete_area?
|
60
|
+
link_to I18n.t("active_admin.delete_model"),
|
61
|
+
admin_area_path(resource),
|
62
|
+
data: {
|
63
|
+
confirm: 'Вы уверены, что хотите удалить это?',
|
64
|
+
method: 'delete'
|
65
|
+
}
|
66
|
+
# <a class="delete_link member_link" data-confirm="Вы уверены, что хотите удалить это?" rel="nofollow" data-method="delete" href="/admin/areas/1">Удалить</a>
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
19
70
|
config.sort_order = 'id_asc'
|
20
71
|
|
21
72
|
filter :atype_id,
|
22
73
|
:label => 'Тип площади',
|
23
74
|
:as => :select,
|
24
|
-
:collection => -> {C80Estate::Atype.all.map { |p| ["#{p.title}", p.id]}},
|
25
|
-
:input_html => {
|
75
|
+
:collection => -> { C80Estate::Atype.all.map { |p| ["#{p.title}", p.id] } },
|
76
|
+
:input_html => {:class => 'selectpicker', 'data-size' => "10", 'data-width' => '100%'}
|
26
77
|
filter :property_id,
|
27
78
|
:label => 'Объект недвижимости',
|
28
79
|
:as => :select,
|
29
|
-
:collection => -> {C80Estate::Property.all.map { |p| ["#{p.title}", p.id]}},
|
30
|
-
:input_html => {
|
80
|
+
:collection => -> { C80Estate::Property.all.map { |p| ["#{p.title}", p.id] } },
|
81
|
+
:input_html => {:class => 'selectpicker', 'data-size' => "10", 'data-width' => '100%'}
|
31
82
|
|
32
83
|
# filter :item_prop_square_val_in,
|
33
84
|
# :as => :string,
|
@@ -36,10 +87,10 @@ ActiveAdmin.register C80Estate::Area, as: 'Area' do
|
|
36
87
|
filter :item_prop_square_val_in,
|
37
88
|
:as => :string,
|
38
89
|
:label => 'Площадь (м.кв.)',
|
39
|
-
:input_html => {
|
90
|
+
:input_html => {data: {
|
40
91
|
provide: 'slider',
|
41
|
-
slider_ticks: C80Estate::ItemProp.all_uniq_values(9).to_json,
|
42
|
-
slider_labels: C80Estate::ItemProp.all_uniq_values(9).to_json,
|
92
|
+
slider_ticks: C80Estate::ItemProp.all_uniq_values(9).to_json, #'[0, 1, 2, 3]',
|
93
|
+
slider_labels: C80Estate::ItemProp.all_uniq_values(9).to_json, #'["none", short", "medium","long"]',
|
43
94
|
slider_min: C80Estate::ItemProp.all_uniq_values(9).last,
|
44
95
|
slider_max: C80Estate::ItemProp.all_uniq_values(9).first,
|
45
96
|
slider_step: 1,
|
@@ -50,41 +101,41 @@ ActiveAdmin.register C80Estate::Area, as: 'Area' do
|
|
50
101
|
filter :item_prop_price_val_in,
|
51
102
|
:as => :string,
|
52
103
|
:label => 'Цена (руб/м.кв в месяц)',
|
53
|
-
:input_html => {
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
104
|
+
:input_html => {data: {
|
105
|
+
provide: 'slider',
|
106
|
+
slider_ticks: C80Estate::ItemProp.all_uniq_values(1).to_json, #'[0, 1, 2, 3]',
|
107
|
+
slider_labels: C80Estate::ItemProp.all_uniq_values(1).to_json, #'["none", short", "medium","long"]',
|
108
|
+
slider_min: C80Estate::ItemProp.all_uniq_values(1).last,
|
109
|
+
slider_max: C80Estate::ItemProp.all_uniq_values(1).first,
|
110
|
+
slider_step: 1,
|
111
|
+
slider_value: 0,
|
112
|
+
slider_range: true
|
62
113
|
}}
|
63
114
|
|
64
115
|
filter :item_prop_oenter_in,
|
65
116
|
:as => :select,
|
66
|
-
:collection => [['Есть',11],['Нет',10]],
|
117
|
+
:collection => [['Есть', 11], ['Нет', 10]],
|
67
118
|
:label => 'Отдельный вход с улицы',
|
68
|
-
:input_html => {
|
119
|
+
:input_html => {:class => 'selectpicker', 'data-size' => "3", 'data-width' => '100%'}
|
69
120
|
|
70
121
|
filter :item_prop_floor_val_in,
|
71
122
|
:as => :select,
|
72
123
|
:collection => -> { C80Estate::ItemProp.all_uniq_values(5) },
|
73
124
|
:label => 'Этаж',
|
74
|
-
:input_html => {
|
125
|
+
:input_html => {:class => 'selectpicker', 'data-size' => "3", 'data-width' => '100%'}
|
75
126
|
|
76
127
|
# filter :title
|
77
128
|
filter :assigned_person_id,
|
78
129
|
:label => 'Назначенный пользователь',
|
79
130
|
:as => :select,
|
80
|
-
:collection => -> {AdminUser.all.map{|u| ["#{u.email}", u.id]}},
|
81
|
-
:input_html => {
|
131
|
+
:collection => -> { AdminUser.all.map { |u| ["#{u.email}", u.id] } },
|
132
|
+
:input_html => {:class => 'selectpicker', 'data-size' => "10", 'data-width' => '100%'}
|
82
133
|
filter :created_at
|
83
134
|
filter :updated_at
|
84
135
|
|
85
|
-
scope
|
86
|
-
scope
|
87
|
-
scope
|
136
|
+
scope "All", :all_areas
|
137
|
+
scope "Free", :free_areas
|
138
|
+
scope "Busy", :busy_areas
|
88
139
|
|
89
140
|
index do
|
90
141
|
selectable_column
|
@@ -93,29 +144,40 @@ ActiveAdmin.register C80Estate::Area, as: 'Area' do
|
|
93
144
|
area.atype_title
|
94
145
|
end
|
95
146
|
column :property do |area|
|
96
|
-
|
147
|
+
"<div class='image_vertical properties_index_logo'>
|
148
|
+
<span></span><img src='#{image_path(area.property.logo_path)}'>
|
149
|
+
</div><span class='properties_index_logo_title'>#{area.property_title}</span>".html_safe
|
150
|
+
|
97
151
|
end
|
98
152
|
column :astatuses do |area|
|
99
|
-
area.astatus_title
|
153
|
+
"<span class='status_#{area.astatus_tag}'>#{area.astatus_title}</span>".html_safe
|
100
154
|
end
|
101
155
|
column :assigned_person do |area|
|
102
156
|
area.assigned_person_title
|
103
157
|
end
|
104
|
-
actions
|
158
|
+
# actions
|
159
|
+
column '' do |area|
|
160
|
+
link_to I18n.t("active_admin.view"), "/admin/areas/#{area.id}", class: 'member_link'
|
161
|
+
end
|
162
|
+
column '' do |area|
|
163
|
+
if current_admin_user.can_edit_area?(area)
|
164
|
+
link_to I18n.t("active_admin.edit"), "/admin/areas/#{area.id}/edit", class: 'member_link'
|
165
|
+
end
|
166
|
+
end
|
105
167
|
end
|
106
168
|
|
107
169
|
form(:html => {:multipart => true}) do |f|
|
108
170
|
|
109
171
|
f.inputs 'Свойства' do
|
110
172
|
f.input :title
|
111
|
-
f.input :atype, :input_html => {
|
112
|
-
f.input :property, :input_html => {
|
173
|
+
f.input :atype, :input_html => {:class => 'selectpicker', 'data-size' => "10", 'data-width' => '400px'}
|
174
|
+
f.input :property, :input_html => {:class => 'selectpicker', 'data-size' => "10", 'data-width' => '400px'}
|
113
175
|
f.input :assigned_person,
|
114
|
-
:input_html => {
|
115
|
-
:collection => AdminUser.all.map{|u| ["#{u.email}", u.id]}
|
116
|
-
f.input :assigned_person_type, :input_html => {
|
176
|
+
:input_html => {:class => 'selectpicker', 'data-size' => "10", 'data-width' => '400px'},
|
177
|
+
:collection => AdminUser.all.map { |u| ["#{u.email}", u.id] }
|
178
|
+
f.input :assigned_person_type, :input_html => {:value => "AdminUser"}, as: :hidden
|
117
179
|
f.input :astatuses,
|
118
|
-
:input_html => {
|
180
|
+
:input_html => {:class => 'selectpicker', 'data-size' => "10", 'data-width' => '400px', :multiple => false}
|
119
181
|
f.input :desc, :as => :ckeditor
|
120
182
|
|
121
183
|
f.inputs "Свойства" do
|
@@ -133,8 +195,11 @@ ActiveAdmin.register C80Estate::Area, as: 'Area' do
|
|
133
195
|
:hint => image_tag(gp.object.image.thumb512)
|
134
196
|
end
|
135
197
|
|
136
|
-
f.
|
137
|
-
|
198
|
+
if f.object.new_record?
|
199
|
+
f.input :owner_id, :input_html => {:value => current_admin_user.id}, as: :hidden
|
200
|
+
f.input :owner_type, :input_html => {:value => "AdminUser"}, as: :hidden
|
201
|
+
end
|
202
|
+
|
138
203
|
end
|
139
204
|
|
140
205
|
f.actions
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# ПОДкатегории строительных материалов
|
2
2
|
ActiveAdmin.register C80Estate::Astatus, :as => 'Astatus' do
|
3
3
|
|
4
|
-
menu :label => "Статусы", :parent => "Настройки"
|
4
|
+
menu :label => "Статусы", :parent => "Настройки", :if => proc { current_admin_user.can_view_settings? }
|
5
5
|
|
6
6
|
permit_params :title
|
7
7
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# ПОДкатегории строительных материалов
|
2
2
|
ActiveAdmin.register C80Estate::Atype, :as => 'Atype' do
|
3
3
|
|
4
|
-
menu :label => "Типы", :parent => "Настройки"
|
4
|
+
menu :label => "Типы", :parent => "Настройки", :if => proc { current_admin_user.can_view_settings? }
|
5
5
|
|
6
6
|
permit_params :title,
|
7
7
|
:slug,
|
@@ -0,0 +1,25 @@
|
|
1
|
+
ActiveAdmin.register ActiveAdmin::Comment, :as => 'Comment' do
|
2
|
+
|
3
|
+
menu label: 'Комментарии', :if => proc { current_admin_user.can_view_comments? }
|
4
|
+
|
5
|
+
batch_action :destroy, false
|
6
|
+
|
7
|
+
config.clear_action_items!
|
8
|
+
|
9
|
+
index do
|
10
|
+
# selectable_column
|
11
|
+
id_column
|
12
|
+
column :author
|
13
|
+
column :resource
|
14
|
+
column :body
|
15
|
+
column :created_at
|
16
|
+
end
|
17
|
+
|
18
|
+
filter :author_id,
|
19
|
+
:label => 'Автор',
|
20
|
+
:as => :select,
|
21
|
+
:collection => -> { AdminUser.all.map { |u| ["#{u.email}", u.id] } },
|
22
|
+
:input_html => {:class => 'selectpicker', 'data-size' => "10", 'data-width' => '100%'}
|
23
|
+
filter :created_at
|
24
|
+
|
25
|
+
end
|
@@ -17,6 +17,16 @@ ActiveAdmin.register C80Estate::Property, as: 'Property' do
|
|
17
17
|
:pphotos_attributes => [:id,:image,:_destroy],
|
18
18
|
:plogos_attributes => [:id,:image,:_destroy]
|
19
19
|
|
20
|
+
batch_action :destroy, false
|
21
|
+
|
22
|
+
config.clear_action_items!
|
23
|
+
|
24
|
+
action_item :new_model, :only => :index do
|
25
|
+
if current_admin_user.can_create_properties?
|
26
|
+
link_to I18n.t("active_admin.new_model"), '/admin/properties/new', method: :get
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
20
30
|
config.sort_order = 'id_asc'
|
21
31
|
|
22
32
|
filter :title
|
@@ -29,6 +39,11 @@ ActiveAdmin.register C80Estate::Property, as: 'Property' do
|
|
29
39
|
|
30
40
|
index do
|
31
41
|
selectable_column
|
42
|
+
column '' do |prop|
|
43
|
+
"<div class='image_vertical properties_index_logo'>
|
44
|
+
<span></span><img src='#{image_path(prop.logo_path)}'>
|
45
|
+
</div>".html_safe
|
46
|
+
end
|
32
47
|
column :title
|
33
48
|
column :address
|
34
49
|
column :gps do |prop|
|
@@ -40,7 +55,17 @@ ActiveAdmin.register C80Estate::Property, as: 'Property' do
|
|
40
55
|
# column :atype do |prop|
|
41
56
|
# prop.atype.title
|
42
57
|
# end
|
43
|
-
actions
|
58
|
+
# actions
|
59
|
+
|
60
|
+
column '' do |property|
|
61
|
+
link_to I18n.t("active_admin.view"), "/admin/properties/#{property.id}", class: 'member_link'
|
62
|
+
end
|
63
|
+
column '' do |property|
|
64
|
+
if current_admin_user.can_edit_property?(property)
|
65
|
+
link_to I18n.t("active_admin.edit"), "/admin/properties/#{property.id}/edit", class: 'member_link'
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
44
69
|
end
|
45
70
|
|
46
71
|
form(:html => {:multipart => true}) do |f|
|
@@ -52,8 +77,12 @@ ActiveAdmin.register C80Estate::Property, as: 'Property' do
|
|
52
77
|
:collection => AdminUser.all.map{|u| ["#{u.email}", u.id]}
|
53
78
|
f.input :assigned_person_type, :input_html => { :value => "AdminUser" }, as: :hidden
|
54
79
|
# f.input :atype, :input_html => { :class => 'selectpicker', 'data-size' => "5", 'data-width' => '400px'}
|
55
|
-
|
56
|
-
f.
|
80
|
+
|
81
|
+
if f.object.new_record?
|
82
|
+
f.input :owner_id, :input_html => { :value => current_admin_user.id }, as: :hidden
|
83
|
+
f.input :owner_type, :input_html => { :value => "AdminUser" }, as: :hidden
|
84
|
+
end
|
85
|
+
|
57
86
|
f.input :address
|
58
87
|
f.input :latitude
|
59
88
|
f.input :longitude
|
@@ -2,7 +2,7 @@ ActiveAdmin.register C80Estate::Pstat, as: 'Pstat' do
|
|
2
2
|
|
3
3
|
# scope_to :current_admin_user, association_method: :sites_list
|
4
4
|
|
5
|
-
menu :label => "Объекты", :parent => 'Статистика'
|
5
|
+
menu :label => "Объекты", :parent => 'Статистика', if: proc{ current_admin_user.can_view_statistics? }
|
6
6
|
|
7
7
|
config.sort_order = 'id_asc'
|
8
8
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# ПОДкатегории строительных материалов
|
2
2
|
ActiveAdmin.register C80Estate::RoleType, :as => 'RoleType' do
|
3
3
|
|
4
|
-
menu :label => "Роли", :parent => "Настройки"
|
4
|
+
menu :label => "Роли", :parent => "Настройки", :if => proc { current_admin_user.can_view_settings? }
|
5
5
|
|
6
6
|
permit_params :title,
|
7
7
|
:desc
|
@@ -2,7 +2,7 @@ ActiveAdmin.register C80Estate::Sevent, as: 'Sevent' do
|
|
2
2
|
|
3
3
|
# scope_to :current_admin_user, association_method: :sites_list
|
4
4
|
|
5
|
-
menu :label => "Площади", :parent => 'Статистика'
|
5
|
+
menu :label => "Площади", :parent => 'Статистика', if: proc{ current_admin_user.can_view_statistics? }
|
6
6
|
|
7
7
|
permit_params :area_id,
|
8
8
|
:atype_id,
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# единицы измерения
|
2
2
|
ActiveAdmin.register C80Estate::Uom, :as => 'Uom' do
|
3
3
|
|
4
|
-
menu :label => "Единицы измерения", :parent => "Настройки"
|
4
|
+
menu :label => "Единицы измерения", :parent => "Настройки", :if => proc { current_admin_user.can_view_settings? }
|
5
5
|
|
6
6
|
permit_params :title, :comment, :is_number
|
7
7
|
|
@@ -417,7 +417,37 @@ var fEdit = function () {
|
|
417
417
|
fLoadingShow();
|
418
418
|
};
|
419
419
|
|
420
|
+
var fAreasIndex = function () {
|
421
|
+
|
422
|
+
//var $input_square_min = $('<input type="text" class="min_text_input"/>')
|
423
|
+
// .appendTo($("#q_item_prop_square_val_in").parent());
|
424
|
+
//
|
425
|
+
//var $input_square_max = $('<input type="text" class="max_text_input"/>')
|
426
|
+
// .appendTo($("#q_item_prop_square_val_in").parent());
|
427
|
+
|
428
|
+
// переведём scope надписи
|
429
|
+
|
430
|
+
var $li, $a, $a_span;
|
431
|
+
|
432
|
+
$li = $('li.scope.all');
|
433
|
+
$a = $li.find(".table_tools_button");
|
434
|
+
$a_span = $a.find('span');
|
435
|
+
$a.html('Все <span class="count">' + $a_span.text() + '</span>');
|
436
|
+
|
437
|
+
$li = $('li.scope.free');
|
438
|
+
$a = $li.find(".table_tools_button");
|
439
|
+
$a_span = $a.find('span');
|
440
|
+
$a.html('Свободные <span class="count">' + $a_span.text() + '</span>');
|
441
|
+
|
442
|
+
$li = $('li.scope.busy');
|
443
|
+
$a = $li.find(".table_tools_button");
|
444
|
+
$a_span = $a.find('span');
|
445
|
+
$a.html('Занятые <span class="count">' + $a_span.text() + '</span>');
|
446
|
+
|
447
|
+
};
|
448
|
+
|
420
449
|
YOUR_APP.areas = {
|
421
450
|
edit: fEdit,
|
422
|
-
"new": jsinit.go
|
451
|
+
"new": jsinit.go,
|
452
|
+
index: fAreasIndex
|
423
453
|
};
|
@@ -107,10 +107,6 @@ body.admin_areas {
|
|
107
107
|
|
108
108
|
}
|
109
109
|
|
110
|
-
a.delete_link {
|
111
|
-
display: none;
|
112
|
-
}
|
113
|
-
|
114
110
|
.slider.slider-horizontal {
|
115
111
|
width: 227px !important;
|
116
112
|
}
|
@@ -123,5 +119,65 @@ body.admin_areas {
|
|
123
119
|
margin-top: 0 !important;
|
124
120
|
}
|
125
121
|
|
122
|
+
&.index {
|
123
|
+
|
124
|
+
.min_text_input {
|
125
|
+
margin-top: 15px;
|
126
|
+
width: 45% !important;
|
127
|
+
}
|
128
|
+
|
129
|
+
.max_text_input {
|
130
|
+
margin-top: 15px;
|
131
|
+
width: 45% !important;
|
132
|
+
margin-left: 10%;
|
133
|
+
}
|
134
|
+
|
135
|
+
a.delete_link {
|
136
|
+
/*display: none;*/
|
137
|
+
}
|
138
|
+
|
139
|
+
span.status_free {
|
140
|
+
display: block;
|
141
|
+
position: relative;
|
142
|
+
padding: 0 0 0 17px;
|
143
|
+
|
144
|
+
&:after {
|
145
|
+
display: block;
|
146
|
+
position: absolute;
|
147
|
+
top:0;
|
148
|
+
left:0;
|
149
|
+
width: 20px;
|
150
|
+
height: 20px;
|
151
|
+
font-family: FontAwesome;
|
152
|
+
content: '\f059';
|
153
|
+
color: #51e471;
|
154
|
+
}
|
155
|
+
|
156
|
+
}
|
157
|
+
|
158
|
+
span.status_busy {
|
159
|
+
display: block;
|
160
|
+
position: relative;
|
161
|
+
padding: 0 0 0 17px;
|
162
|
+
|
163
|
+
&:after {
|
164
|
+
display: block;
|
165
|
+
position: absolute;
|
166
|
+
top:0;
|
167
|
+
left:0;
|
168
|
+
width: 20px;
|
169
|
+
height: 20px;
|
170
|
+
font-family: FontAwesome;
|
171
|
+
content: '\f058';
|
172
|
+
color: #ff2d2d;
|
173
|
+
}
|
174
|
+
|
175
|
+
}
|
176
|
+
|
177
|
+
}
|
178
|
+
|
179
|
+
&.show {
|
180
|
+
|
181
|
+
}
|
126
182
|
|
127
183
|
}
|
@@ -1,3 +1,18 @@
|
|
1
1
|
#admin_user_1 {
|
2
2
|
display: none;
|
3
|
+
}
|
4
|
+
|
5
|
+
.image_vertical {
|
6
|
+
text-align: center; /*!*/
|
7
|
+
white-space: nowrap; /*!*/
|
8
|
+
|
9
|
+
> span {
|
10
|
+
display: inline-block; /*!*/
|
11
|
+
vertical-align: middle; /*!*/
|
12
|
+
height: 100%; /*!*/
|
13
|
+
}
|
14
|
+
|
15
|
+
> img {
|
16
|
+
vertical-align: middle; /*!*/
|
17
|
+
}
|
3
18
|
}
|
@@ -48,6 +48,64 @@ module C80Estate
|
|
48
48
|
roles << r
|
49
49
|
end
|
50
50
|
|
51
|
+
def can_view_statistics?
|
52
|
+
r1 = roles.where(role_type: 1)
|
53
|
+
r2 = roles.where(role_type: 2)
|
54
|
+
r1.count > 0 || r2.count > 0
|
55
|
+
end
|
56
|
+
|
57
|
+
def can_view_comments?
|
58
|
+
r1 = roles.where(role_type: 1)
|
59
|
+
r2 = roles.where(role_type: 2)
|
60
|
+
r1.count > 0 || r2.count > 0
|
61
|
+
end
|
62
|
+
|
63
|
+
def can_view_settings?
|
64
|
+
r1 = roles.where(role_type: 1)
|
65
|
+
r1.count > 0
|
66
|
+
end
|
67
|
+
|
68
|
+
def can_view_users?
|
69
|
+
r1 = roles.where(role_type: 1)
|
70
|
+
r1.count > 0
|
71
|
+
# true
|
72
|
+
end
|
73
|
+
|
74
|
+
def can_edit_area?(area)
|
75
|
+
r1 = roles.where(role_type: 1)
|
76
|
+
# mark_is_owner = area.owner.id == id
|
77
|
+
mark_is_assigned = area.assigned_person.id == id
|
78
|
+
r1.count > 0 || mark_is_assigned # || mark_is_owner
|
79
|
+
# true
|
80
|
+
end
|
81
|
+
|
82
|
+
|
83
|
+
def can_edit_property?(property)
|
84
|
+
r1 = roles.where(role_type: 1)
|
85
|
+
# mark_is_owner = property.owner.id == id
|
86
|
+
mark_is_assigned = property.assigned_person.id == id
|
87
|
+
r1.count > 0 || mark_is_assigned # || mark_is_owner
|
88
|
+
# true
|
89
|
+
end
|
90
|
+
|
91
|
+
def can_create_areas?
|
92
|
+
r1 = roles.where(role_type: 1)
|
93
|
+
r1.count > 0
|
94
|
+
# true
|
95
|
+
end
|
96
|
+
|
97
|
+
def can_create_properties?
|
98
|
+
r1 = roles.where(role_type: 1)
|
99
|
+
r1.count > 0
|
100
|
+
# true
|
101
|
+
end
|
102
|
+
|
103
|
+
def can_delete_area?
|
104
|
+
r1 = roles.where(role_type: 1)
|
105
|
+
r1.count > 0
|
106
|
+
# true
|
107
|
+
end
|
108
|
+
|
51
109
|
end
|
52
110
|
end
|
53
111
|
end
|
data/config/locales/ru.yml
CHANGED
@@ -4,7 +4,7 @@ ru:
|
|
4
4
|
area:
|
5
5
|
one: "площадь"
|
6
6
|
other: "Площади"
|
7
|
-
|
7
|
+
c80_estate/aphoto: "изображение"
|
8
8
|
c80_news_tz/gallery: ""
|
9
9
|
c80_news_tz/gphoto: "картинку"
|
10
10
|
c80_news_tz/cphoto: ""
|
@@ -31,15 +31,36 @@ ru:
|
|
31
31
|
admin_user:
|
32
32
|
one: 'пользователя'
|
33
33
|
other: 'Пользователи'
|
34
|
+
email: 'Email'
|
35
|
+
password: 'Пароль'
|
36
|
+
password_confirmation: 'Пароль ещё раз'
|
37
|
+
role: 'роль'
|
34
38
|
attributes:
|
35
39
|
c80_estate/area:
|
36
40
|
title: "Название"
|
37
41
|
atype: 'Тип'
|
38
42
|
property: 'Объект'
|
43
|
+
desc: 'Описание'
|
39
44
|
astatus: 'Статус'
|
40
45
|
assigned_person: 'Ответственный'
|
41
46
|
created_at: 'Время создания'
|
42
47
|
updated_at: 'Изменён'
|
48
|
+
owner: 'Создатель'
|
49
|
+
astatuses: 'Статус'
|
50
|
+
c80_estate/property:
|
51
|
+
title: "Название"
|
52
|
+
address: 'Адрес'
|
53
|
+
gps: 'GPS'
|
54
|
+
desc: 'Описание'
|
55
|
+
latitude: 'Широта'
|
56
|
+
longitude: 'Долгота'
|
57
|
+
assigned_person: 'Ответственный'
|
58
|
+
created_at: 'Время создания'
|
59
|
+
updated_at: 'Изменён'
|
60
|
+
owner: 'Создатель'
|
61
|
+
astatuses: 'Статус'
|
62
|
+
c80_estate/aphoto:
|
63
|
+
image: 'Файл'
|
43
64
|
c80_news_tz/nphoto:
|
44
65
|
image: 'Файл'
|
45
66
|
c80_news_tz/adress:
|
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.8
|
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-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -65,9 +65,11 @@ files:
|
|
65
65
|
- LICENSE.txt
|
66
66
|
- README.md
|
67
67
|
- Rakefile
|
68
|
+
- app/admin/c80_estate/admin_user.rb
|
68
69
|
- app/admin/c80_estate/areas.rb
|
69
70
|
- app/admin/c80_estate/astatuses.rb
|
70
71
|
- app/admin/c80_estate/atypes.rb
|
72
|
+
- app/admin/c80_estate/comments.rb
|
71
73
|
- app/admin/c80_estate/dashboard.rb
|
72
74
|
- app/admin/c80_estate/prop_names.rb
|
73
75
|
- app/admin/c80_estate/properties.rb
|
@@ -89,6 +91,7 @@ files:
|
|
89
91
|
- app/assets/javascript/c80_estate_active_admin.js.coffee
|
90
92
|
- app/assets/stylesheets/c80_estate/backend/admin_areas.scss
|
91
93
|
- app/assets/stylesheets/c80_estate/backend/admin_prop_names.scss
|
94
|
+
- app/assets/stylesheets/c80_estate/backend/admin_properties.scss
|
92
95
|
- app/assets/stylesheets/c80_estate/backend/admin_pstats.scss
|
93
96
|
- app/assets/stylesheets/c80_estate/backend/admin_sevents.scss
|
94
97
|
- app/assets/stylesheets/c80_estate/backend/admin_users.scss
|