Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - content_for :head do
- %link{:rel => "canonical", :href => property_url(:parcel_id => @home.parcel_id, :slug => @home.slug)}
- = render(:partial=>'shared/geo_overlap', :locals=> {:target => @home })
- - content_for :extra_javascript do
- = javascript_include_tag 'jquery.property-gallery'
- :javascript
- var map_lat = #{@home.coordinates[:lat]};
- var map_lon = #{@home.coordinates[:lon]};
- var mlabel = '#{to_map_infowindow(@home.address) rescue ""}';
- var city_name = '#{ @home.city.try(:name) || ""}';
- jQuery(function($){
- $('a.show_rel').click(function(){
- // Hide all
- $(this).parents('ul').find('a.show_rel').each(function(){
- $(this).parents('li').removeClass('active');
- $('#'+$(this).attr('rel')).hide();
- });
- // Change Title
- if ($(this).attr('rel_title')){
- var rel_title = $(this).attr('rel_title');
- var id = rel_title.match(/#[^:]+/i)[0];
- var text = rel_title.replace(/#[^:]+:/i, '');
- $(id).html(text)
- }
- // Display More link
- if ($(this).attr('rel_more')){
- var ids = $(this).parents('ul').find('a[rel_more]').map(function(){return $(this).attr('rel_more') }).get().join(',');
- $(ids).hide();
- var id = $(this).attr('rel_more');
- $(id).css('display', 'inline-block');
- }
- // Display current
- $(this).parents('li').addClass('active');
- $('#'+$(this).attr('rel')).show();
- return false;
- });
- // Gallery
- $('#carousel').propertyGallery();
- });
- - content_for :popup do
- = lc_popup(:title => "Realtor", :selector => ".withPopup") do
- = render :partial => 'shared/realtor_popup'
- - if logged_in? && can_user_change_photos?(@home)
- = lc_popup(:title => "Add Photos", :selector => "a#addPhotos") do
- = render :partial => "shared/add_photos", :locals => {:target => @home}
- - if @listing.try(:agent).try(:user).try(:is_active_agent?)
- - agent = @listing.agent
- = lc_popup(:title => "Contact Agent", :selector => "a#ask-agent-question") do
- .clearfix.mrgb_10
- .img_standard_size.s72x96.block_left.mrgr_10
- %a.wrp{:href => show_agent_path(agent)}
- = user_img_tag(agent.user, {}, {:w => 72, :h => 96})
- %h3
- = link_to agent.name, show_agent_path(agent)
- %p.gray.mrg_0
- = agent.brokerage
- %br/
- %span.phone-icon= agent.phone
- = form_for Message.new, :url => {:controller => "sent", :action => "create"}, :html => {:class=>'contact-listing-agent'} do |f|
- = f.hidden_field :subject, :value => 'Blockshopper for sale inquiry'
- = f.hidden_field :to, :value => agent.id
- = f.hidden_field :group, :value => 'agent'
- = f.hidden_field :property_url, :value => @home.path
- = f.hidden_field :for_agent_id, :value => agent.id
- = f.hidden_field :home_id, :value => @home.id
- = f.hidden_field :zone_id, :value => (@home.zone ? @home.zone.id : 0)
- %p
- = f.label :name, 'Name'
- = f.text_field :name, :value => (current_user.full_name if logged_in?)
- %p
- = f.label :phone, 'Phone'
- = f.text_field :phone
- %p
- = f.label :email, 'Email'
- = f.text_field :email, :value => (current_user.email if logged_in?)
- %p
- = f.label :body, 'Message'
- - textarea_value = "Blockshopper for sale inquiry - #{@home.name}"
- = f.text_area :body, :value => textarea_value, :onkeyup => 'jQuery("#count-characters").html(1000-jQuery(this).val().length);'
- %span.gray_button.block_left.mrgl_5
- = f.submit 'Contact Agent', :style=> 'width:130px'
- %small.block_right.mrgr_10{:style => 'line-height:40px;'}
- %strong
- Characters left:
- %span#count-characters= "#{1000-textarea_value.size}"
- .clr
- - content_for :content_wide do
- - if flash[:popup]
- #bs_popup
- #bs_popup_inner{ :class => "box article" }
- %div{ :style => "padding:5px 15px;" }
- %h3
- = flash[:popup]
- %p{ :style => "text-align:center;" }
- = link_to 'Go to My Blockshopper', dashboard_path
- |
- %a{ :href => '#n', :onclick => "jQuery('#bs_popup').hide();return false;" } Close
- - elsif flash[:popup_signup_active_agent]
- #bs_popup
- #bs_popup_inner{ :class => "box article" }
- %div{ :style => "padding:5px 15px;" }
- %h3
- = flash[:popup_signup_active_agent]
- %p{ :style => "text-align:center;" }
- = link_to 'Continue', signup_active_agent_path
- - if current_user and current_user.has_role?('admin') and @home.is_a?(Property)
- = link_to("Add To Search Index", add_to_search_index_path(:group => 'properties', :id => @home.id))
- %h1.title{:class => property_label(@home)}= property_address_links(@home)
- .clearfix
- %ul.rtabs.white.block_left
- %li.roundtop.active
- %a{:href => "#"} Home Details
- - case property_refinance_or_purchase(@home)
- - when :purchase
- %li.roundtop.light-gray.mortgage-tab-item
- %a{:href => mortgage_property_path(@home.parcel_id, @home.slug)} Mortgage
- - when :refinance
- %li.roundtop.light-gray.mortgage-tab-item
- %a{:href => refinance_property_path(@home.parcel_id, @home.slug)} Refinance
- - if Configuration.ad_slot_property_mortgage_text
- .block_right.mrgt_5
- %span.icon_link
- %script{:type => "text/javascript"}
- = Configuration.ad_slot_property_mortgage_text
- .forsale_top.clearfix
- .image_viewer
- - case @photos.size
- - when 0
- .border.full
- - map_url = url_for(:controller=>'maps', :action=>'map_and_street', :width => '320', :height => '317', :lat => @home.lat, :lon => @home.lon)
- %iframe{:src => map_url, :width => '320', :height => '317', :frameborder => '0', :scrolling => 'no'}
- - when 1
- - photo = @photos.first
- .border.full
- .img_standard_size.s320x240.block_left
- .wrp
- = image_tag(photo.image.url, :alt => photo.caption, :id=> 'theImage')
- - else
- - photo = @photos.first
- .border
- .img_standard_size.s320x240.block_left
- .wrp
- = image_tag(photo.image.url, :alt => photo.caption, :id=> 'theImage')
- .clr
- #carousel.carousel
- %ul
- - @photos.each_with_index do |pht, index|
- %li{:class => (index.zero? ? 'active' : nil)}
- %span.top-arrow
- %a{:href => "#", :rel => pht.image.url}
- = image_tag(pht.image.thumb.url, :alt => pht.caption)
- #nav_links
- %h3
- Picture
- %span#num_current_photo 1
- of #{@photos.size}
- .prevnext
- %a#previmg{:href => "#ng"} « Prev
- |
- %a#nextimg{:href => "#ng"} Next »
- - if !@listing and !(@listing and !@listing.fsbo_listing?) and current_user != @home.user
- = link_to_remote_jredbox("Send a message to the owner of #{@home.address}", {:controller => 'sent', :action => 'new', :id => @home.id , :group => 'property', :property_url => "http://#{DOMAIN}#{request.request_uri}" }, {:class => 'small_link'})
- %br/
- - if Configuration.features.include?('users') && logged_in? && (current_user.id == @home.user_id or (@home.user_listing_claim and @home.user_listing_claim.user == current_user and @home.user_listing_claim.featured))
- %strong
- You've claimed this home.
- - if ([email protected]) > 0
- %br/
- = "You have #{nmsg} #{pluralize(nmsg, 'message','messages')} regarding #{@home.address}."
- %a.small_link{:href => messages_path(:folder => 'property')} Read them now
- - elsif @home.user_listing_claim or @home.user
- %em
- This home has been claimed.
- - elsif ([email protected]) > 0
- %a.small_link{:href => signup_homeowner_path}
- There
- = nmsg.eql?(1) ? 'is 1 message' : "are #{nmsg} messages"
- = "waiting for the owner of #{@home.address}."
- Register and claim this property to see your messages now.
- - else
- %a.small_link{:href => claim_my_home_path(:parcel_id => @home.parcel_id)}
- = "Own #{@home.address}? Claim your home and add details!"
- - if logged_in? && can_user_change_photos?(@home)
- %a#addPhotos.small_link{:href => '#'} Add Photos
- .pdetails
- - if @listing
- %dl
- %dt Price:
- %dd
- - if @listing.price.to_i.zero?
- —
- - else
- = number_to_currency(@listing.price, :precision => 0)
- %dt Bedrooms:
- %dd
- - if @listing.beds.to_i.zero?
- —
- - else
- = @listing.beds
- %dt Bathrooms:
- %dd
- - if @listing.baths.to_i.zero?
- —
- - else
- = @listing.baths
- %dt Sqft:
- %dd
- - if @listing.living_sf.to_i.zero?
- —
- - else
- = @listing.living_sf
- .hrule7
- %hr/
- %dl
- %dt
- Owner
- - if @home.as_of_date
- (as of #{ @home.as_of_date.year }):
- %dd
- = raw link_to_search(:homeowners, @home.safe_owner(logged_in?))
- - if Configuration.features.include?('taxes') and @home.property_tax > 0 and Configuration.formatted_market_state == "TX"
- %dt Assessed Value:
- %dd
- = number_to_currency(@home.aprbldg, :precision => 0)
- %dt City:
- %dd
- = link_to(@home.city.name, city_path(@home.city)) rescue '—'.html_safe
- %dt Zip:
- %dd
- = link_to(@home.zip.name, zip_path(@home.zip)) rescue '—'.html_safe
- %dt County:
- %dd
- = link_to(@home.county.name, county_path(@home.county)) rescue '—'.html_safe
- %dt Region:
- %dd
- = link_to(@home.region.name, region_path(@home.region)) rescue '—'.html_safe
- %dt Neighborhood:
- %dd
- - if @home.neighborhood.nil? and [email protected]('-').nil?
- = link_to(@home.city.name[@home.city.name.index('-') + 1..-1], city_path(@home.city)) rescue '—'.html_safe
- - else
- = link_to(@home.neighborhood.name, neighborhood_path(@home.neighborhood)) rescue '—'.html_safe
- %dt Subdivision:
- %dd
- = link_to(@home.subdivision.name, subdivision_path(@home.subdivision)) rescue '—'.html_safe
- - if @home.complex and @home.complex.development
- %dt Condo Development:
- %dd
- = link_to( @home.complex.development.name , development_path( :id => @home.complex.development.slug))
- %dt Street:
- %dd
- = link_to(@home.street.formal_street, city_street_path(@home.city, @home.street)) rescue '—'.html_safe
- - if Configuration.features.include?('users') && logged_in? && (current_user.id == @home.user_id or (@home.user_listing_claim and @home.user_listing_claim.user == current_user and @home.user_listing_claim.featured))
- %span.icon_link= link_to "Get a free custom property tax analysis for #{@home.name}", tax_analysis_home_club_url(current_user.to_param), :class => "green"
- - elsif [email protected]_listing_claim && [email protected]
- %span.icon_link
- - if Configuration.ad_slot_property_text_left
- %script{:type => "text/javascript"}
- = Configuration.ad_slot_property_text_left
- - else
- = link_to("Claim this property and get a free custom property tax analysis for #{@home.name}",claim_my_home_path(:parcel_id => @home.parcel_id))
- %dl
- %dt Yr. Built:
- %dd
- - if @home.year_built.to_i.zero?
- —
- - else
- = @home.year_built
- %dt Builder:
- %dd
- = @home.home_builder.name rescue '—'.html_safe
- %dt Sqft (land | living):
- %dd
- = "#{@home.land_sf} land | #{@home.living_sf} living"
- %dt Bedrooms:
- %dd
- = @home.beds.to_i.zero? ? 'N/A' : @home.beds.to_i
- %dt Bathrooms:
- %dd
- = @home.baths.to_i.zero? ? 'N/A' : @home.baths
- %dt Property Taxes:
- %dd
- - if @home.use_code == 'CP'
- —
- - else
- = "#{number_to_currency(@home.property_tax)}"
- = " (#{@home.county.tax_date.year})" if @home.county && @home.county.tax_date.present?
- %dt Stories:
- %dd
- - if @home.stories.to_i.zero?
- —
- - else
- = @home.stories.to_i
- - if @listing.try(:agent).try(:user).try(:is_active_agent?)
- .clear
- .more_details
- %span.gray_button
- %a#ask-agent-question{:href => "#"} Contact Agent
- - if @listing
- .blue-title.shadow-line.clearfix.mrgb_5
- %h2
- %span.blue-title-text Listing Information
- %span.blue-title-right
- - if @listing.description.present?
- %p.mrgt_0.mrgb_20
- = @listing.description
- - else
- %h1.not-found= "No listing information for #{@home.name}"
- .blue-title.clearfix.mrgb_0
- %h2
- %span.blue-title-text
- Sales History
- %span.blue-title-right
- - if Configuration.ad_slot_textlink_search_home_for_sale
- .block_right.mrgt_5
- %span.icon_link
- %script{:type => "text/javascript"}
- = Configuration.ad_slot_textlink_search_home_for_sale
- %table.forsale.sales_history
- %thead
- %tr
- %th.sale_price
- Price
- %th.sale_type
- Type
- %th.sale_date
- Date
- %th.buyer_seller
- B-Buyer/S-Seller
- - if FEATURES.include?('agents')
- %th.sale_agent
- Agent
- %tbody
- - if @sales.blank?
- %tr
- %td.tcenter{:colspan => (FEATURES.include?('agents') ? 5 : 4)} No sales history available
- - else
- - @sales.each_with_index do |sale, index|
- %tr.first-row
- %td
- %strong= (sale.zeroprice == 1 ? "N/A" : "$#{number_with_delimiter(sale.sale_price.to_i)}")
- %td
- = sale_type_label(sale)
- %td
- - if sale.sale_date
- = sale.sale_date.strftime("%m/%d/%Y")
- - else
- N/A
- %td
- %strong B:
- = link_to_search(:buyer, sale.safe_buyer(logged_in?))
- - if FEATURES.include?('agents')
- %td
- %strong BA:
- - unless FEATURES.include?('premium_sales') && sale.featured_buyer?
- = agent_link(sale, 'buyer') || 'N/A'
- - else
- N/A
- %tr.second-row{:class => (display_claim_buttons?(sale) ? 'noborder' : nil)}
- %td
- %td{:colspan => 2}
- - if index.zero? && sale.foreclosure?
- %span.icon_link
- %script{:type => 'text/javascript'}
- = Configuration.ad_slot_textlink_more_foreclosures_property_page
- - elsif index.zero? && sale.bank_sale?
- %span.icon_link
- %script{:type => 'text/javascript'}
- = Configuration.ad_slot_textlink_bank_sales_property_page
- - else
-
- %td
- %strong S:
- = link_to_search(:seller, sale.safe_seller(logged_in?))
- - if FEATURES.include?('agents')
- %td
- %strong SA:
- - unless FEATURES.include?('premium_sales') && sale.featured_seller?
- = agent_link(sale, 'seller') || 'N/A'
- - else
- N/A
- - if display_claim_buttons?(sale)
- %tr.third-row
- %td
- %td
- %td
- %td{:colspan => 2}
- = claim_buttons(sale)
- .blue-title.clearfix.mrgb_0
- %h2
- %span.blue-title-text Info & Demographics
- %span.blue-title-right
- %table.forsale.narrow
- %thead
- %tr
- %th Information
- %th
- Demographics
- %tbody
- %tr
- %td
- %table
- %tbody
- %tr.noborder
- %td.w120= SCHOOL_3 + ":"
- %td
- %strong
- - if ([email protected])
- = link_to s.name.titleize, school_path(s)
- - else
- N/A
- %tr.noborder
- %td.w120= SCHOOL_2 + ":"
- %td
- %strong
- - if ([email protected])
- = link_to s.name.titleize, school_path(s)
- - else
- N/A
- %tr.noborder
- %td.w120= SCHOOL_1 + ":"
- %td
- %strong
- - if ([email protected])
- = link_to s.name.titleize, school_path(s)
- - else
- N/A
- - @home.politicals.sort_by(&:political_type).each do |political|
- %tr.noborder
- %td.w120
- - case political.political_type
- - when "uscongr"
- U.S. Representative:
- - when "rep"
- State Representative:
- - when "senate"
- State Senator:
- - else
- Political District:
- %td
- %strong= link_to political.name, political_path(political.political_type, political)
- %td
- %table
- %tbody
- - if (demographics = area_demographics(@home)).any?
- - city = @home.tract.try(:city)
- - demographics.each do |slug, name, value|
- %tr
- %td.w245
- = name
- %td
- %strong
- - if city
- = link_to(value, by_city_demographics_path(:city_id => city, :order => slug, :order_dir => 'desc'))
- - else
- = value
- - else
- %tr
- %td
- No Demographic information available
- %table
- %tbody
- %tr.noborder
- %td.w120 Census Tract:
- %td.w190.tright
- %strong
- = link_to(@home.tract.name, tract_path(@home.tract)) rescue 'N/A'
- %table
- %tbody
- %tr.noborder.footnote
- %td.w155
- %i
- *Alone or in combination
- %td.w155.tright
- %i
- Source: U.S. Census
- .adspace_468.tcenter
- %script{:type => "text/javascript"}
- = Configuration.ad_slot_property_728_90
- .blue-title.clearfix.mrgb_0
- %h2
- %span.blue-title-text
- Neighbors
- %span.blue-title-right
- %table.forsale.with_tabs.neighbors
- %thead
- %tr
- %th Owner
- %th Address
- %th.details Bed | Bath | Living Sqft.
- %tbody
- - if @neighbors.blank?
- %tr
- %td{:colspan => 3} Not found.
- - else
- - @neighbors.each do |property|
- %tr{:onclick => "Redirect(event,'#{property.path}', false);"}
- %td= property.owner
- %td= address_link(property)
- %td= "#{'%0.0f' % property.beds} bd | #{property.baths} ba | #{property.living_sf} sqft"
- - content_for :right_column do
- %div{:style=> 'height:68px'}
- - if @listing.try(:agent).try(:user).try(:is_active_agent?)
- = render :partial => 'shared/contact_listing_agent', :locals => {:agent => @listing.agent, :target => @home}
- - else
- = market_expert_widget
- .clr
- = display_ad('rect', Configuration.market_slug, @home)
- = render :partial => 'shared/homeowners_favorites', :locals => {:property => @home}
- - unless @agents_disabled
- = top_agents(@home)
- = render :partial => 'shared/home_resource_center', :locals => {:target => @target}
- %script{:type => "text/javascript"}
- = Configuration.ad_slot_property_300_250_right_sidebar
Add Comment
Please, Sign In to add comment