caboose-rets 0.1.5 → 0.1.6

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.
Files changed (33) hide show
  1. checksums.yaml +5 -13
  2. data/app/controllers/caboose_rets/residential_controller.rb +24 -5
  3. data/app/models/caboose_rets/agent.rb +5 -1
  4. data/app/models/caboose_rets/rets_importer.rb +4 -3
  5. data/app/models/caboose_rets/schema.rb +41 -1
  6. data/app/views/caboose/blocks/_layout_rets.html.erb +56 -0
  7. data/app/views/caboose/blocks/_rets_agent_details.html.erb +88 -0
  8. data/app/views/caboose/blocks/_rets_agent_listings.html.erb +122 -0
  9. data/app/views/caboose/blocks/_rets_agents_index.html.erb +51 -0
  10. data/app/views/caboose/blocks/_rets_commercial_details.html.erb +192 -0
  11. data/app/views/caboose/blocks/_rets_commercial_headers.html.erb +17 -0
  12. data/app/views/caboose/blocks/_rets_commercial_index.html.erb +71 -0
  13. data/app/views/caboose/blocks/_rets_commercial_row.html.erb +39 -0
  14. data/app/views/caboose/blocks/_rets_commercial_search_form.html.erb +201 -0
  15. data/app/views/caboose/blocks/_rets_land_details.html.erb +165 -0
  16. data/app/views/caboose/blocks/_rets_land_index.html.erb +63 -0
  17. data/app/views/caboose/blocks/_rets_land_row.html.erb +58 -0
  18. data/app/views/caboose/blocks/_rets_land_search_form.html.erb +194 -0
  19. data/app/views/caboose/blocks/_rets_multifamily_details.html.erb +161 -0
  20. data/app/views/caboose/blocks/_rets_multifamily_index.html.erb +63 -0
  21. data/app/views/caboose/blocks/_rets_multifamily_row.html.erb +56 -0
  22. data/app/views/caboose/blocks/_rets_multifamily_search_form.html.erb +273 -0
  23. data/app/views/caboose/blocks/_rets_openhouse_details.html.erb +12 -0
  24. data/app/views/caboose/blocks/_rets_openhouses_index.html.erb +79 -0
  25. data/app/views/caboose/blocks/_rets_residential_details.html.erb +243 -0
  26. data/app/views/caboose/blocks/_rets_residential_index.html.erb +65 -0
  27. data/app/views/caboose/blocks/_rets_residential_row.html.erb +59 -0
  28. data/app/views/caboose/blocks/_rets_residential_search_form.html.erb +304 -0
  29. data/app/views/caboose/blocks/_rets_savedproperties_index.html.erb +28 -0
  30. data/app/views/caboose_rets/residential/details.html.erb +0 -139
  31. data/app/views/caboose_rets/residential/index.html.erb +0 -49
  32. data/lib/caboose_rets/version.rb +1 -1
  33. metadata +33 -9
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- MWE1ZjAwYTQ5Y2YwYWIxZGVhODc3NzFhZmM5MzA5ODVkYWQwZDBjOQ==
5
- data.tar.gz: !binary |-
6
- ZjE2OGQyOTFiMzhiNzJkMGMyODFlZDBkMDU4ODZjM2E1OWI0ZmU2Yg==
2
+ SHA1:
3
+ metadata.gz: e116a6f2290ccb75eda4afbb4790dc63132ee15c
4
+ data.tar.gz: 3dbd6c9f9371bed4530cec8711b556519d2b2a20
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- N2U2YzI2N2FiZjc5OTk5ZmE1NTVlMThmNmQwNDVlNjRhNTlmNDhjNzQxY2Nl
10
- YjhmY2ZlMTUyNmJkYjE1OTVjNzZmYjRlYWIyZWZlNjdhNDc3Zjg3ZjY0YTgy
11
- ZGRmNjM4NGQ0MDRmZWI0MTZmNWIxY2RiYmIxN2RlOTFkZTEyZWU=
12
- data.tar.gz: !binary |-
13
- MmI2NzYzOWY3MmE3ZTdkZTMzMGZiNjJhNTQ2MDFjYzY5ZjA4NGFiYjMyYzEy
14
- OWI3Yzk5YzdlOGNkYzZlY2NiNTAwODhhOTUzNjFmOWVlNDNlMGU3YTdkZjEw
15
- Zjg5ZmJmNzdlYzU1Mzk5ZWMxMzg5ODliOGJiYjY0NGRmYTc4YmQ=
6
+ metadata.gz: 378db10bcbb941a866726d048e5a24c5d669ead6ba4c93d8d1a69b29afc771b7ba2a329ca4ef2143501c86a3725a5aad30037260fcbdb5782f77032e20060099
7
+ data.tar.gz: 6aa70ed083f88932c6050af491811f48f181099d8ca5348e437b068231d6d1c4ee5eb75b8e275965c504327618730bf35aeb3849eefac8e7b72d41240793d49f
@@ -12,7 +12,7 @@ module CabooseRets
12
12
  end
13
13
  end
14
14
 
15
- @gen = Caboose::PageBarGenerator.new(params, {
15
+ @pager = Caboose::PageBarGenerator.new(params, {
16
16
  'name' => '',
17
17
  'acreage_gte' => '',
18
18
  'acreage_lte' => '',
@@ -54,9 +54,8 @@ module CabooseRets
54
54
  'items_per_page' => 10
55
55
  })
56
56
 
57
- @properties = @gen.items
58
-
59
- if params[:waterfront].present? then @properties.reject!{|p| p.waterfront.blank?} end
57
+ @properties = @pager.items
58
+ if params[:waterfront].present? then @properties.reject!{|p| p.waterfront.blank?} end
60
59
  if params[:ftr_lotdesc] == 'golf' then @properties.reject!{|p| p.ftr_lotdesc != 'golf'} end
61
60
  #if params[:foreclosure] then @properties.reject!{|p| p.foreclosure_yn != "Y"} end
62
61
 
@@ -64,6 +63,12 @@ module CabooseRets
64
63
  if CabooseRets::SavedSearch.exists?(:uri => request.fullpath)
65
64
  @saved_search = CabooseRets::SavedSearch.where(:uri => request.fullpath).first
66
65
  end
66
+
67
+ @block_options = {
68
+ :properties => @properties,
69
+ :saved_search => @saved_search,
70
+ :pager => @pager
71
+ }
67
72
  end
68
73
 
69
74
  # GET /residential/:mls_acct/details
@@ -79,7 +84,21 @@ module CabooseRets
79
84
  render 'residential/residential_not_exists'
80
85
  return
81
86
  end
82
- #@message = Message.new
87
+
88
+ @block_options = {
89
+ :mls_acct => params[:mls_acct],
90
+ :property => @property,
91
+ :saved => @saved,
92
+ :agent => @property ? Agent.where(:la_code => @property.la_code).first : nil,
93
+ :form_authenticity_token => form_authenticity_token
94
+ }
95
+
96
+ #if @property.nil?
97
+ # @mls_acct = params[:mls_acct]
98
+ # CabooseRets::RetsImporter.delay.import_property(@mls_acct.to_i)
99
+ # render 'residential/residential_not_exists'
100
+ # return
101
+ #end
83
102
  end
84
103
 
85
104
  #=============================================================================
@@ -77,10 +77,14 @@ class CabooseRets::Agent < ActiveRecord::Base
77
77
  #self.photo_url = ""
78
78
  end
79
79
 
80
+ def verify_meta_exists
81
+ self.meta = CabooseRets::AgentMeta.create(:la_code => self.la_code) if self.meta.nil?
82
+ end
83
+
80
84
  def image_url(style)
81
85
  if CabooseRets::use_hosted_images == true
82
86
  #return "#{CabooseRets::agents_base_url}/#{self.image_location}"
83
- self.meta = CabooseRets::AgentMeta.create(:la_code => self.la_code) if self.meta.nil?
87
+ self.verify_meta_exists
84
88
  return self.meta.image_location
85
89
  end
86
90
  return "" if self.image.nil?
@@ -272,9 +272,10 @@ class CabooseRets::RetsImporter # < ActiveRecord::Base
272
272
  def self.download_agent_image(agent)
273
273
  self.log "Saving image for #{agent.first_name} #{agent.last_name}..."
274
274
  begin
275
- self.client.get_object(:resource => :Agent, :type => :Photo, :location => true, :id => agent.la_code) do |headers, content|
276
- agent.image_location = headers['location']
277
- agent.save
275
+ self.client.get_object(:resource => :Agent, :type => :Photo, :location => true, :id => agent.la_code) do |headers, content|
276
+ agent.verify_meta_exists
277
+ agent.meta.image_location = headers['location']
278
+ agent.meta.save
278
279
  end
279
280
  rescue RETS::APIError => err
280
281
  self.log "No image for #{agent.first_name} #{agent.last_name}."
@@ -850,7 +850,47 @@ class CabooseRets::Schema < Caboose::Utilities::Schema
850
850
  }
851
851
  end
852
852
 
853
- def self.load_data
853
+ def self.load_data
854
+
855
+ bt = Caboose::BlockType.where(:name => 'layout_rets').first
856
+ if bt.nil?
857
+ cat = Caboose::BlockTypeCategory.where(:name => 'Layouts').first
858
+ bt = Caboose::BlockType.create(:name => 'layout_rets', :description => 'RETS Layout', :block_type_category_id => cat.id, :allow_child_blocks => false, :field_type => 'block')
859
+ end
860
+
861
+ Caboose::Site.where(:use_rets => true).reorder(:id).all.each do |site|
862
+
863
+ home_page = Caboose::Page.index_page(site.id)
864
+
865
+ # Check that the rets layout is applied to the site
866
+ bt.add_to_site(site.id)
867
+
868
+ # Verify that the site has all the rets pages created and each page has the rets layout
869
+ rets_page = Caboose::Page.where(:site_id => site.id, :alias => 'rets').first
870
+ rets_page = Caboose::Page.create(:site_id => site.id, :alias => 'rets', :slug => 'rets', :uri => 'rets', :title => 'RETS', :parent_id => home_page.id) if rets_page.nil?
871
+
872
+ pages = []
873
+ if !Caboose::Page.where(:site_id => site.id, :alias => 'residential' ).exists? then pages << Caboose::Page.create(:site_id => site.id, :slug => 'residential' , :alias => 'residential' , :uri => 'residential' , :title => 'Residential Properties' , :parent_id => rets_page.id) end
874
+ if !Caboose::Page.where(:site_id => site.id, :alias => 'commercia' ).exists? then pages << Caboose::Page.create(:site_id => site.id, :slug => 'commercial' , :alias => 'commercial' , :uri => 'commercial' , :title => 'Commercial Properties' , :parent_id => rets_page.id) end
875
+ if !Caboose::Page.where(:site_id => site.id, :alias => 'land' ).exists? then pages << Caboose::Page.create(:site_id => site.id, :slug => 'land' , :alias => 'land' , :uri => 'land' , :title => 'Land' , :parent_id => rets_page.id) end
876
+ if !Caboose::Page.where(:site_id => site.id, :alias => 'multi-family' ).exists? then pages << Caboose::Page.create(:site_id => site.id, :slug => 'multi-family' , :alias => 'multi-family' , :uri => 'multi-family' , :title => 'Multi-family Properties' , :parent_id => rets_page.id) end
877
+ if !Caboose::Page.where(:site_id => site.id, :alias => 'open-houses' ).exists? then pages << Caboose::Page.create(:site_id => site.id, :slug => 'open-houses' , :alias => 'open-houses' , :uri => 'open-houses' , :title => 'Open Houses' , :parent_id => rets_page.id) end
878
+ if !Caboose::Page.where(:site_id => site.id, :alias => 'agents' ).exists? then pages << Caboose::Page.create(:site_id => site.id, :slug => 'agents' , :alias => 'agents' , :uri => 'agents' , :title => 'Agents' , :parent_id => rets_page.id) end
879
+ if !Caboose::Page.where(:site_id => site.id, :alias => 'saved-searches' ).exists? then pages << Caboose::Page.create(:site_id => site.id, :slug => 'saved-searches' , :alias => 'saved-searches' , :uri => 'saved-searches' , :title => 'Saved Searches' , :parent_id => rets_page.id) end
880
+ if !Caboose::Page.where(:site_id => site.id, :alias => 'saved-properties' ).exists? then pages << Caboose::Page.create(:site_id => site.id, :slug => 'saved-properties' , :alias => 'saved-properties' , :uri => 'saved-properties' , :title => 'Saved Properties' , :parent_id => rets_page.id) end
881
+
882
+ pages.each do |p|
883
+ Caboose::Block.where(:page_id => p.id).destroy_all
884
+ Caboose::Block.create(:page_id => p.id, :block_type_id => bt.id, :name => bt.name)
885
+
886
+ viewers = Caboose::PagePermission.where(:page_id => home_page.id, :action => 'view').pluck(:role_id)
887
+ editors = Caboose::PagePermission.where(:page_id => home_page.id, :action => 'edit').pluck(:role_id)
888
+ Caboose::Page.update_authorized_for_action(p.id, 'view', viewers)
889
+ Caboose::Page.update_authorized_for_action(p.id, 'edit', editors)
890
+ end
891
+
892
+ end
893
+
854
894
  end
855
895
 
856
896
  end
@@ -0,0 +1,56 @@
1
+ <!DOCTYPE html>
2
+ <!--[if lt IE 7]><html class="no-js ie lt-ie9 lt-ie8 lt-ie7" lang="en"><![endif]-->
3
+ <!--[if IE 7]><html class="no-js ie ie7 lt-ie9 lt-ie8" lang="en"><![endif]-->
4
+ <!--[if IE 8]><html class="no-js ie ie8 lt-ie9" lang="en"><![endif]-->
5
+ <!--[if IE 9]><html class="no-js ie ie9" lang="en"><![endif]-->
6
+ <!--[if !IE]><!--> <html class="no-js" lang="en"><!--<![endif]-->
7
+ <!--[if lt IE 9]><script src="/html5shiv.js"></script><![endif]-->
8
+ <head>
9
+ <meta charset="utf-8" />
10
+ <meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1" />
11
+ <meta http-equiv="content-type" content="text/html;charset=utf-8">
12
+ <meta http-equiv="content-language" content="en">
13
+ <meta name="viewport" content="width=device-width, initial-scale=1">
14
+ <title><%= raw page.head_title %></title>
15
+ <% desc = page.meta_description ? page.meta_description : page.head_title %>
16
+ <% domain = site.primary_domain.domain %>
17
+ <meta name="description" content="<%= desc %>" />
18
+ <meta property="og:title" content="<%= page.title %>" />
19
+ <meta property="og:site_name" content="<%= site.description %>"/>
20
+ <meta property="og:description" content="<%= desc %>" />
21
+ <%= raw css %>
22
+ <%= raw csrf_meta_tags %>
23
+ </head>
24
+ <body>
25
+ <div class="container" id='block_<%= block.id %>'>
26
+ <!--[if lt IE 7]>
27
+ <p class="chromeframe">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">activate Google Chrome Frame</a> to improve your experience.</p>
28
+ <![endif]-->
29
+ <%
30
+ # Select which block to show
31
+ url = request.original_fullpath
32
+ if url =~ /^\/residential\/\d(.*?)$/ %><% Caboose.log("Rendering rets_residential_details" ) %><%= block.partial('rets_residential_details' , local_assigns) %><%
33
+ elsif url =~ /^\/residential\/search(.*?)$/ %><% Caboose.log("Rendering rets_residential_index" ) %><%= block.partial('rets_residential_index' , local_assigns) %><%
34
+ elsif url =~ /^\/residential(.*?)$/ %><% Caboose.log("Rendering rets_residential_index" ) %><%= block.partial('rets_residential_index' , local_assigns) %><%
35
+ elsif url =~ /^\/commercial\/\d(.*?)$/ %><% Caboose.log("Rendering rets_commercial_details" ) %><%= block.partial('rets_commercial_details' , local_assigns) %><%
36
+ elsif url =~ /^\/commercial\/search(.*?)$/ %><% Caboose.log("Rendering rets_commercial_index" ) %><%= block.partial('rets_commercial_index' , local_assigns) %><%
37
+ elsif url =~ /^\/commercial(.*?)$/ %><% Caboose.log("Rendering rets_commercial_index" ) %><%= block.partial('rets_commercial_index' , local_assigns) %><%
38
+ elsif url =~ /^\/land\/\d(.*?)$/ %><% Caboose.log("Rendering rets_land_details" ) %><%= block.partial('rets_land_details' , local_assigns) %><%
39
+ elsif url =~ /^\/land\/search(.*?)$/ %><% Caboose.log("Rendering rets_land_index" ) %><%= block.partial('rets_land_index' , local_assigns) %><%
40
+ elsif url =~ /^\/land(.*?)$/ %><% Caboose.log("Rendering rets_land_index" ) %><%= block.partial('rets_land_index' , local_assigns) %><%
41
+ elsif url =~ /^\/multi-family\/\d(.*?)$/ %><% Caboose.log("Rendering rets_multifamily_details" ) %><%= block.partial('rets_multifamily_details' , local_assigns) %><%
42
+ elsif url =~ /^\/multi-family\/search(.*?)$/ %><% Caboose.log("Rendering rets_multifamily_index" ) %><%= block.partial('rets_multifamily_index' , local_assigns) %><%
43
+ elsif url =~ /^\/multi-family(.*?)$/ %><% Caboose.log("Rendering rets_multifamily_index" ) %><%= block.partial('rets_multifamily_index' , local_assigns) %><%
44
+ elsif url =~ /^\/open-houses\/\d(.*?)$/ %><% Caboose.log("Rendering rets_openhouses_details" ) %><%= block.partial('rets_openhouses_details' , local_assigns) %><%
45
+ elsif url =~ /^\/open-houses(.*?)$/ %><% Caboose.log("Rendering rets_openhouses_index" ) %><%= block.partial('rets_openhouses_index' , local_assigns) %><%
46
+ elsif url =~ /^\/agents\/\d(.*?)\/listings$/ %><% Caboose.log("Rendering rets_agent_listings" ) %><%= block.partial('rets_agent_listings' , local_assigns) %><%
47
+ elsif url =~ /^\/agents\/\d(.*?)$/ %><% Caboose.log("Rendering rets_agent_details" ) %><%= block.partial('rets_agent_details' , local_assigns) %><%
48
+ elsif url =~ /^\/agents(.*?)$/ %><% Caboose.log("Rendering rets_agents_index" ) %><%= block.partial('rets_agents_index' , local_assigns) %><%
49
+ elsif url =~ /^\/saved-searches(.*?)$/ %><% Caboose.log("Rendering rets_savedsearches" ) %><%= block.partial('rets_savedsearches' , local_assigns) %><%
50
+ elsif url =~ /^\/saved-properties(.*?)$/ %><% Caboose.log("Rendering rets_savedproperties" ) %><%= block.partial('rets_savedproperties' , local_assigns) %><%
51
+ end
52
+ %>
53
+ </div>
54
+ <%= raw js %>
55
+ </body>
56
+ </html>
@@ -0,0 +1,88 @@
1
+ <%
2
+ if @agent
3
+ @page.title = "#{@agent.first_name} #{@agent.last_name}"
4
+ end
5
+ @agents = CabooseRets::Agent.where("lo_code = ? and hide = false", '46').reorder("last_name, first_name").all
6
+ %>
7
+ <style>
8
+ .assistant_name { font-size: 0.9em; margin-left: 10px; }
9
+ .sidebar-body p { margin-bottom: 10px !important; }
10
+ </style>
11
+
12
+ <div class="l-wrapper">
13
+ <div class="l-sidebar-border inflate-tenor-baritone h-space-pvm">
14
+ <div class="sidebar-aside">
15
+ <h3>Meet Our Agents</h3>
16
+
17
+ <select class="h-conceal-tenor-baritone h-space-mbm" onchange="location=this.options[this.selectedIndex].value;">
18
+ <% @agents.each do |a| %>
19
+ <% next if !a.assistant_to.nil? && a.assistant_to.length > 0 %>
20
+ <option class="agent_name" value="/agents/<%= a.la_code %>/listings">
21
+ <%= a.designation if a.designation? %> <%= a.first_name %> <%= a.last_name %>
22
+ </option>
23
+ <% end %>
24
+ </select>
25
+
26
+ <ul class="h-reveal-tenor-baritone">
27
+ <li><a href="/agents/048540000">Richard Ellis, Jr.</a>
28
+ </li>
29
+ <% @agents.each do |a| %>
30
+ <% next if !a.assistant_to.nil? && a.assistant_to.length > 0 %>
31
+ <% next if a.la_code == '048540000' %>
32
+ <li class="agent_name"><a class="agent_name" href="/agents/<%= a.la_code %>"><%= a.first_name %> <%= a.last_name %></a>
33
+ <% if a.assistants %><ul class='assistants'><% a.assistants.each do |a2| %><li><%= a2.first_name %> <%= a2.last_name %></li><% end %></ul><% end %>
34
+ </li>
35
+ <% end %>
36
+ </ul>
37
+ </div> <!-- .sidebar-aside -->
38
+
39
+ <div class="sidebar-body">
40
+ <% if !@agent.hide && (@agent.lo_code == '46' || @agent.lo_code == 'SPACES') %>
41
+ <div class="l-media">
42
+ <figure class="media-aside"><img src="<%= @agent.image_url(:thumb) %>?<%= DateTime.now.strftime('%F') %>" width="150" /></figure>
43
+ <div class="media-body">
44
+ <h4 class="agent_name"><%= @agent.first_name %> <%= @agent.last_name %></h4>
45
+ <% if @agent.contact_info.nil? || @agent.contact_info.strip.length == 0 %>
46
+ <ul>
47
+ <% if @agent.office_phone.strip.length > 0 %><li>Work Phone: <a href="tel:<%= @agent.office_phone %>"><%= @agent.office_phone %></a></li><% end %>
48
+ <% if @agent.car_phone.strip.length > 0 %><li>Cell Phone: <a href="tel:<%= @agent.car_phone %>"><%= @agent.car_phone %></a></li><% end %>
49
+ <% if @agent.home_phone.strip.length > 0 %><li>Home Phone: <a href="tel:<%= @agent.home_phone %>"><%= @agent.home_phone %></a></li><% end %>
50
+ <% if @agent.member_email.strip.length > 0 %><li>Email: <a href="mailto:<%= @agent.member_email %>"><%= @agent.member_email %></a></li><% end %>
51
+ </ul>
52
+ <% else %><%= raw @agent.contact_info %><% end %>
53
+ <p class="h-space-mvs"><a class="m-btn-red" href="/agents/<%= @agent.la_code %>/listings">See My Listings</a></p>
54
+ </div>
55
+ </div> <!-- .l-media -->
56
+ <article class="h-space-mtm"><%= raw @agent.bio %></article>
57
+ <% if @agent.assistants %>
58
+ <% @agent.assistants.each do |a| %>
59
+ <hr style='height: 1px; border: 0; background: #ccc;' />
60
+ <img src="<%= a.image_url(:thumb) %>?<%= DateTime.now.strftime('%F') %>" width="150" style='float: right; margin-left: 10px;' />
61
+ <h4 class="agent_name"><%= a.first_name %> <%= a.last_name %></h4>
62
+
63
+ <% if a.contact_info.nil? || a.contact_info.strip.length == 0 %>
64
+ <ul>
65
+ <% if a.office_phone.strip.length > 0 %><li>Work Phone: <a href="tel:<%= a.office_phone %>"><%= a.office_phone %></a></li><% end %>
66
+ <% if a.car_phone.strip.length > 0 %><li>Cell Phone: <a href="tel:<%= a.car_phone %>"><%= a.car_phone %></a></li><% end %>
67
+ <% if a.home_phone.strip.length > 0 %><li>Home Phone: <a href="tel:<%= a.home_phone %>"><%= a.home_phone %></a></li><% end %>
68
+ <% if a.member_email.strip.length > 0 %><li>Email: <a href="mailto:<%= a.member_email %>"><%= a.member_email %></a></li><% end %>
69
+ </ul>
70
+ <% else %><%= raw a.contact_info %><% end %>
71
+ <% if a.bio && a.bio.length > 0 %><article class="h-space-mtm"><%= raw a.bio %></article><% end %>
72
+ <br style="clear: left;" />
73
+ <% end %>
74
+ <% end %>
75
+ <% else %>
76
+ <p class='note error'>No Advantage Realty agent with that agent code exists.</p>
77
+ <% end %>
78
+ </div> <!-- .sidebar-body -->
79
+ </div>
80
+ </div> <!-- .l-wrapper -->
81
+
82
+ <%= content_for :css do %>
83
+ <style type='text/css'>
84
+
85
+ ul.assistants li { margin-left: 10px; }
86
+
87
+ </style>
88
+ <% end %>
@@ -0,0 +1,122 @@
1
+ <style type="text/css">
2
+ #recaptcha_area, #recaptcha_table {width: auto !important;}
3
+ #recaptcha_image {width: 175px !important;}
4
+ #recaptcha_image img{width:100% !important;padding: 0px;}
5
+ fieldset.captcha{width:157px !important;}
6
+ #recaptcha_image {width:157px !important;}
7
+ #recaptcha_container {margin: 0px;padding: 0px;width: 157px !important;}
8
+ input#recaptcha_response_field{padding:0px;}
9
+ </style>
10
+
11
+ <div class="l-wrapper">
12
+ <div class="l-sidebar inflate-bass h-space-ptm">
13
+ <div class="sidebar-aside"><a class="m-btn btn-red" href="/agents">Back to Agents</a></div>
14
+ <div class="sidebar-body">
15
+ <% if !@agent.hide && (@agent.lo_code == '46' || @agent.lo_code == 'SPACES') %>
16
+ <h3><%= @agent.first_name %> <%= @agent.last_name %></h3>
17
+ <% else %>
18
+ <p class='note error'>No Advantage Realty agent with that agent code exists.</p>
19
+ <p>&nbsp;</p>
20
+ <p>&nbsp;</p>
21
+ <% end %>
22
+ </div>
23
+ </div> <!-- .l-sidebar -->
24
+ </div> <!-- .l-wrapper -->
25
+
26
+ <% if !@agent.hide && (@agent.lo_code == '46' || @agent.lo_code == 'SPACES') %>
27
+ <div class="l-wrapper">
28
+ <div class="body-section">
29
+ <div class="l-sidebar inflate-bass sidebar-border h-space-pbm">
30
+ <div class="sidebar-aside">
31
+ <figure class="h-space-mvm"><img src="<%= @agent.image_url(:large) %>?<%= DateTime.now.strftime('%F') %>" width="150" class="h-border" /></figure>
32
+ <% if @agent.contact_info.nil? || @agent.contact_info.strip.length == 0 %>
33
+ <% if @agent.office_phone.strip.length > 0 %><p><small><strong>Work Phone: </strong></small> <a href="tel:<%= @agent.office_phone %>"><%= @agent.office_phone %></a></p><% end %>
34
+ <% if @agent.car_phone.strip.length > 0 %><p><small><strong>Cell Phone: </strong></small> <a href="tel:<%= @agent.car_phone %>"><%= @agent.car_phone %></a></p><% end %>
35
+ <% if @agent.home_phone.strip.length > 0 %><p><small><strong>Home Phone: </strong> </small><a href="tel:<%= @agent.home_phone %>"><%= @agent.home_phone %></a></p><% end %>
36
+ <% if @agent.member_email.strip.length > 0 %><p><small><strong>Email: </strong> </small><a href="mailto:<%= @agent.member_email %>"><%= @agent.member_email %></a></p><% end %>
37
+ <% else %>
38
+ <%= raw @agent.contact_info %>
39
+ <% end %>
40
+ <hr />
41
+ <h4><i class="m-icon-contact"></i> Contact Agent</h4>
42
+ <form action="/contact/create" method="post" class="m-form h-space-pbm">
43
+ <input type='hidden' name='la_code' value="<%= @agent.la_code %>" />
44
+ <input type='text' placeholder="Full Name" name='contact_name' id="contact_name" maxlength="150" />
45
+ <input type='text' placeholder="Email" name='contact_address' id="contact_address" maxlength="150" />
46
+ <textarea name="contact_message" id="contact_message" placeholder="Message" cols="50" rows="4" class="contact_message"></textarea>
47
+ <%= recaptcha_tags :noscript => false %>
48
+ <input class="m-btn btn-right btn-red h-space-mts" type="submit" value="submit">
49
+ </form>
50
+ </div> <!-- .sidebar-aside -->
51
+ <div class="sidebar-body">
52
+ <article><%= raw @agent.bio %></article>
53
+ <hr />
54
+
55
+ <% @property_groups.select{ |pg| !pg[:properties].empty? }.each do |pg| %>
56
+ <h4><%= pg[:title] %></h4>
57
+ <ul class="m-list-border">
58
+ <% pg[:properties].each do |l| %>
59
+ <li class="l-media inflate-bass center-on-mobile">
60
+ <figure class="media-aside">
61
+ <a href="/<%= pg[:url_prefix] %>/<%= l.mls_acct %>/details"><img src='<%= l.images && l.images.count > 0 ? l.images[0].image_url(:thumb) : "" %>'class="h-border" width="150" /></a>
62
+ </figure>
63
+ <div class="media-body h-pos">
64
+ <p class="pos-top-right h-type-highlight"><strong>MLS#<%=l.mls_acct%></strong></p>
65
+
66
+ <% if l.street_num != '0' && l.street_name != "" %>
67
+
68
+ <h5>
69
+ <% if l.unit_num != "" %>
70
+ Unit <%= l.unit_num %>,
71
+ <% end %>
72
+ <%=l.street_num%> <%=l.street_name.titleize %>
73
+ </h5>
74
+ <% end %>
75
+
76
+ <p><small><%=l.city.titleize %>, <%=l.state%> <%=l.zip%></small></p>
77
+
78
+ <div class="l-grid grid-row inflate-tenor">
79
+ <div class="grid-unit-1of4">
80
+ <% if pg[:type] == 'RES' || pg[:type] == 'COM' %>
81
+ <a class="m-btn btn-red" href="/<%= pg[:url_prefix] %>/<%= l.mls_acct %>/details">See More</a>
82
+ <% else %>
83
+ <p>&nbsp;</p>
84
+ <% end %>
85
+ </div>
86
+ <% if pg[:type] == 'RES' %>
87
+ <div class="grid-unit-1of4">Beds<br /><%= l.bedrooms %></div>
88
+ <div class="grid-unit-1of4">Baths<br />
89
+ <%= l.baths_full %> full <% if l.baths_half != "" && l.baths_half != "0" %> &amp; <%= l.baths_half %> half<% end %>
90
+ </div>
91
+ <% end %>
92
+ <div class="grid-unit-1of4">Price<br />
93
+ <% if l.current_price.nil? || l.current_price == '0' || l.current_price == 0 %>
94
+ Available Upon Inquiry<% else %><%= h number_to_currency(l.current_price, :precision => 0) %>
95
+ <% end %>
96
+ </div>
97
+ </div> <!-- .l-grid -->
98
+ </div> <!-- .media-body -->
99
+ </li>
100
+ <% end %>
101
+ </ul>
102
+ <% end %>
103
+
104
+ </div> <!-- .sidebar-body -->
105
+ </div> <!-- .l-sidebar -->
106
+
107
+ <hr />
108
+
109
+ <footer class="section-foot"><%= raw Caboose::Setting.value_for('footer_text') %></footer>
110
+ </div> <!-- .body-section -->
111
+ </div> <!-- .l-wrapper -->
112
+ <% end %>
113
+
114
+ <div class="body-sink"></div>
115
+
116
+
117
+
118
+ <% unless flash[:notice].blank? %>
119
+ <script type="text/javascript">
120
+ alert('<%= flash[:notice] %>');
121
+ </script>
122
+ <% end %>
@@ -0,0 +1,51 @@
1
+ <%
2
+ @page.title = "Agents"
3
+ @agents = CabooseRets::Agent.where("(lo_code = ? or lo_code = ?) and hide = false", '46', 'SPACES').reorder("last_name, first_name").all
4
+ %>
5
+ <style>
6
+ .assistant_name { font-size: 0.9em; margin-left: 10px; }
7
+ </style>
8
+
9
+ <div class="l-wrapper">
10
+ <div class="l-sidebar-border inflate-tenor-baritone h-space-pvm">
11
+ <div class="sidebar-body">
12
+ <h3>Meet Our Agents</h3>
13
+ <ul class="agent_thumbs">
14
+ <% a = CabooseRets::Agent.where(:la_code => '048540000').first %>
15
+ <% if a %>
16
+ <li><a href="/agents/<%= a.la_code %>">
17
+ <img src='<%= a.image_url(:thumb) %>' />
18
+ <span><%= a.first_name %> <%= a.last_name %><% if a.designation %>, <%= a.designation %><% end %></span>
19
+ </a></li>
20
+ <% end %>
21
+ <% @agents.each do |a| %>
22
+ <% next if !a.assistant_to.nil? && a.assistant_to.length > 0 %>
23
+ <% next if a.la_code == '048540000' %>
24
+ <li><a href="/agents/<%= a.la_code %>">
25
+ <img src='<%= a.image_url(:thumb) %>' />
26
+ <span><%= a.first_name %> <%= a.last_name %><% if a.designation %>, <%= a.designation %><% end %></span>
27
+ </a></li>
28
+ <% end %>
29
+ </ul>
30
+ <br style="clear: left;" />
31
+ </div> <!-- .sidebar-body -->
32
+ </div>
33
+ </div> <!-- .l-wrapper -->
34
+
35
+ <%= content_for :css do %>
36
+ <style type='text/css'>
37
+
38
+ ul.agent_thumbs { margin: 0; padding: 0; list-style: none; }
39
+ ul.agent_thumbs li { margin: 1px; padding: 0px; list-style: none; float: left; }
40
+ ul.agent_thumbs li a { display: block; margin: 0; padding: 8px; width: 140px; height: 240px; background: #fff; line-height: 1em; text-align: center; border: transparent 1px solid; overflow: hidden; }
41
+ ul.agent_thumbs li a:hover { background: #efefef; border: #ccc 1px solid; }
42
+ ul.agent_thumbs li img { display: block; margin: 0 auto 4px auto; border: transparent 1px solid; min-height: 150px; }
43
+ ul.agent_thumbs li a:hover img { border: #ccc 1px solid; }
44
+
45
+ </style>
46
+ <% end %>
47
+ <%= content_for :js do %>
48
+ <script type="text/javascript">
49
+
50
+ </script>
51
+ <% end %>