caboose-rets 0.1.62 → 0.1.63
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/caboose_rets/properties_controller.rb +20 -3
- data/app/models/caboose_rets/property.rb +1 -1
- data/app/models/caboose_rets/schema.rb +1 -0
- data/app/views/caboose_rets/properties/admin_edit.html.erb +18 -0
- data/app/views/caboose_rets/properties/facebook_listings_feed.rss.builder +5 -1
- data/lib/caboose_rets/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 700436dd74e52a8160f7d9ab02aa32d48eb55605
|
4
|
+
data.tar.gz: 6399370255db68e317a58a7f63d0c0ebed440c68
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6896493c54877eee761564b421af406bad802cd1346c56d472c96ce1d2af797d1521938ab841fb55fa5edae0ba3d1e2116c241b9e2f602d912477025982ad1c2
|
7
|
+
data.tar.gz: 8010796863a955dfca2966e3a4d105600f609a3f5cfd68f829c8f9350b727c59bc984c70fb930a090dd605381131c94b6e921594d159804be9477f1d1eed2758
|
@@ -165,6 +165,21 @@ module CabooseRets
|
|
165
165
|
render :layout => 'caboose/admin'
|
166
166
|
end
|
167
167
|
|
168
|
+
# @route PUT /admin/properties/:id
|
169
|
+
def admin_update
|
170
|
+
return unless (user_is_allowed_to 'edit', 'rets_properties')
|
171
|
+
resp = Caboose::StdClass.new
|
172
|
+
prop = Property.find(params[:id])
|
173
|
+
params.each do |k,v|
|
174
|
+
case k
|
175
|
+
when "alternate_link" then prop.alternate_link = v
|
176
|
+
end
|
177
|
+
end
|
178
|
+
prop.save
|
179
|
+
resp.success = true
|
180
|
+
render :json => resp
|
181
|
+
end
|
182
|
+
|
168
183
|
# @route GET /admin/properties/:id/refresh
|
169
184
|
def admin_refresh
|
170
185
|
return unless (user_is_allowed_to 'edit', 'rets_properties')
|
@@ -195,12 +210,14 @@ module CabooseRets
|
|
195
210
|
rc = CabooseRets::RetsConfig.where(:site_id => @site.id).first
|
196
211
|
if params[:fieldtype] == 'agent' && rc && !rc.agent_mls.blank?
|
197
212
|
if @site.id == 558
|
198
|
-
@properties = CabooseRets::Property.where("list_agent_mls_id in (?)", ['118593705','118511951','118598750','SCHMANDTT','118599999','118509093','118518704','118515504']).order("original_entry_timestamp DESC").take(100)
|
213
|
+
@properties = CabooseRets::Property.where(:status => 'Active').where("list_agent_mls_id in (?)", ['118593705','118511951','118598750','SCHMANDTT','118599999','118509093','118518704','118515504']).order("original_entry_timestamp DESC").take(100)
|
199
214
|
else
|
200
|
-
@properties = CabooseRets::Property.where("list_agent_mls_id = ?", rc.agent_mls).order("original_entry_timestamp DESC").take(100)
|
215
|
+
@properties = CabooseRets::Property.where("list_agent_mls_id = ?", rc.agent_mls).where(:status => 'Active').order("original_entry_timestamp DESC").take(100)
|
201
216
|
end
|
202
217
|
elsif params[:fieldtype] == 'office' && rc && !rc.office_mls.blank?
|
203
|
-
@properties = CabooseRets::Property.where("list_office_mls_id = ?", rc.office_mls).order("original_entry_timestamp DESC").take(100)
|
218
|
+
@properties = CabooseRets::Property.where("list_office_mls_id = ?", rc.office_mls).where(:status => 'Active').order("original_entry_timestamp DESC").take(100)
|
219
|
+
elsif params[:fieldtype] == 'condo'
|
220
|
+
@properties = CabooseRets::Property.where("(style ILIKE '%condo%' OR res_style ILIKE '%condo%' OR property_subtype ILIKE '%condo%')").where(:status => 'Active').order("original_entry_timestamp DESC").take(100)
|
204
221
|
else
|
205
222
|
@properties = CabooseRets::Property.order("original_entry_timestamp DESC").take(100)
|
206
223
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
class CabooseRets::Property <ActiveRecord::Base
|
2
2
|
self.table_name = "rets_properties"
|
3
|
-
attr_accessible :id, :matrix_unique_id, :mls_number
|
3
|
+
attr_accessible :id, :matrix_unique_id, :mls_number, :alternate_link
|
4
4
|
|
5
5
|
def url() return "/properties/#{self.mls_number}/details" end
|
6
6
|
def images() return CabooseRets::Media.where(:media_mui => self.matrix_unique_id, :media_type => 'Photo').reorder(:media_order).all end
|
@@ -7,6 +7,12 @@ p = @property
|
|
7
7
|
<input type='button' class="caboose-btn" value='Back' onclick="window.location='/admin/properties';" />
|
8
8
|
<input type='button' class="caboose-btn" value='Manually Refresh from MLS' onclick="refresh_property_from_mls('<%= p.id %>');" />
|
9
9
|
</p>
|
10
|
+
|
11
|
+
<div style="margin:0 0 20px 0;min-height:36px;">
|
12
|
+
<div id="property_<%= @property.id %>_alternate_link"></div>
|
13
|
+
</div>
|
14
|
+
|
15
|
+
|
10
16
|
<div id='message'><%= raw flash[:message] ? flash[:message] : "" %></div>
|
11
17
|
|
12
18
|
<table class='data'>
|
@@ -177,5 +183,17 @@ function refresh_property_from_mls(mls)
|
|
177
183
|
}
|
178
184
|
});
|
179
185
|
}
|
186
|
+
|
187
|
+
$(document).ready(function() {
|
188
|
+
m = new ModelBinder({
|
189
|
+
name: 'Property',
|
190
|
+
id: <%= @property.id %>,
|
191
|
+
update_url: '/admin/properties/<%= @property.id %>',
|
192
|
+
authenticity_token: '<%= form_authenticity_token %>',
|
193
|
+
attributes: [
|
194
|
+
{ name: 'alternate_link', nice_name: 'Alternate Link', type: 'text', value: <%== Caboose.json(@property.alternate_link) %>, width: 500 }
|
195
|
+
]
|
196
|
+
});
|
197
|
+
});
|
180
198
|
</script>
|
181
199
|
<% end %>
|
@@ -34,7 +34,11 @@ xml.instruct! :xml, :version => "1.0"
|
|
34
34
|
xml.listing_type('for_sale_by_agent')
|
35
35
|
xml.num_baths(property.baths_total)
|
36
36
|
xml.num_beds(property.beds_total)
|
37
|
-
|
37
|
+
if !property.alternate_link.blank?
|
38
|
+
xml.url(property.alternate_link)
|
39
|
+
else
|
40
|
+
xml.url("https://" + domain + "/properties/#{property.mls_number}/details")
|
41
|
+
end
|
38
42
|
xml.year_built(property.year_built)
|
39
43
|
if !property.property_type.blank?
|
40
44
|
if kind.include?('Land')
|
data/lib/caboose_rets/version.rb
CHANGED