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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1bce9df7d067c2323400487592f9c04e4c6207d5
4
- data.tar.gz: fa4ca53b793b11ee9a1f66742f3e4f0f1526a259
3
+ metadata.gz: 700436dd74e52a8160f7d9ab02aa32d48eb55605
4
+ data.tar.gz: 6399370255db68e317a58a7f63d0c0ebed440c68
5
5
  SHA512:
6
- metadata.gz: 4f87db61d715251650549a9f13ef0c280871e79fd4f675491a5fe29cf8e08e33afecb57a65da8d8baf56dbd2e190574dc2a788fad02aa8a8e811f2fabf0d9f10
7
- data.tar.gz: baaaf36b7584999b37b155445b88c4fdd6d18ee0f335e94a0eecc687427114d40a7e3567a4515471b36b71708575a2aa8aa6e6fe65fe7da2fda5682198e06bbc
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
@@ -99,6 +99,7 @@ class CabooseRets::Schema < Caboose::Utilities::Schema
99
99
  [ :hide, :boolean , { :default => false }]
100
100
  ],
101
101
  CabooseRets::Property => [
102
+ [ :alternate_link , :string],
102
103
  [ :access , :text],
103
104
  [ :acreage , :decimal],
104
105
  [ :acreage_source , :text],
@@ -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
- xml.url("https://" + domain + "/properties/#{property.mls_number}/details")
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')
@@ -1,3 +1,3 @@
1
1
  module CabooseRets
2
- VERSION = '0.1.62'
2
+ VERSION = '0.1.63'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caboose-rets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.62
4
+ version: 0.1.63
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Barry