Guest User

Untitled

a guest
May 11th, 2012
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 20.64 KB | None | 0 0
  1. - content_for :head do
  2.   %link{:rel => "canonical", :href => property_url(:parcel_id => @home.parcel_id, :slug => @home.slug)}
  3.   = render(:partial=>'shared/geo_overlap', :locals=> {:target => @home })
  4.  
  5. - content_for :extra_javascript do
  6.   = javascript_include_tag 'jquery.property-gallery'
  7.   :javascript
  8.     var map_lat = #{@home.coordinates[:lat]};
  9.     var map_lon = #{@home.coordinates[:lon]};
  10.     var mlabel = '#{to_map_infowindow(@home.address) rescue ""}';
  11.     var city_name = '#{ @home.city.try(:name) || ""}';
  12.  
  13.     jQuery(function($){
  14.       $('a.show_rel').click(function(){
  15.         // Hide all
  16.         $(this).parents('ul').find('a.show_rel').each(function(){
  17.           $(this).parents('li').removeClass('active');
  18.           $('#'+$(this).attr('rel')).hide();
  19.         });
  20.         // Change Title
  21.         if ($(this).attr('rel_title')){
  22.           var rel_title = $(this).attr('rel_title');
  23.           var id   = rel_title.match(/#[^:]+/i)[0];
  24.           var text = rel_title.replace(/#[^:]+:/i, '');
  25.           $(id).html(text)
  26.         }
  27.         // Display More link
  28.         if ($(this).attr('rel_more')){
  29.           var ids = $(this).parents('ul').find('a[rel_more]').map(function(){return $(this).attr('rel_more') }).get().join(',');
  30.           $(ids).hide();
  31.           var id = $(this).attr('rel_more');
  32.           $(id).css('display', 'inline-block');
  33.         }
  34.         // Display current
  35.         $(this).parents('li').addClass('active');
  36.         $('#'+$(this).attr('rel')).show();
  37.         return false;
  38.       });
  39.       // Gallery
  40.       $('#carousel').propertyGallery();
  41.     });
  42.  
  43.  
  44. - content_for :popup do
  45.   = lc_popup(:title => "Realtor", :selector => ".withPopup") do
  46.     = render :partial => 'shared/realtor_popup'
  47.  
  48.   - if logged_in? && can_user_change_photos?(@home)
  49.     = lc_popup(:title => "Add Photos", :selector => "a#addPhotos") do
  50.       = render :partial => "shared/add_photos", :locals => {:target => @home}
  51.  
  52.   - if @listing.try(:agent).try(:user).try(:is_active_agent?)
  53.     - agent = @listing.agent
  54.     = lc_popup(:title => "Contact Agent", :selector => "a#ask-agent-question") do
  55.       .clearfix.mrgb_10
  56.         .img_standard_size.s72x96.block_left.mrgr_10
  57.           %a.wrp{:href => show_agent_path(agent)}
  58.             = user_img_tag(agent.user, {}, {:w => 72, :h => 96})
  59.         %h3
  60.           = link_to agent.name, show_agent_path(agent)
  61.         %p.gray.mrg_0
  62.           = agent.brokerage
  63.           %br/
  64.           %span.phone-icon= agent.phone
  65.  
  66.       = form_for Message.new, :url => {:controller => "sent", :action => "create"}, :html => {:class=>'contact-listing-agent'} do |f|
  67.         = f.hidden_field :subject, :value => 'Blockshopper for sale inquiry'
  68.         = f.hidden_field :to, :value => agent.id
  69.         = f.hidden_field :group, :value => 'agent'
  70.         = f.hidden_field :property_url, :value => @home.path
  71.         = f.hidden_field :for_agent_id, :value => agent.id
  72.         = f.hidden_field :home_id, :value => @home.id
  73.         = f.hidden_field :zone_id, :value => (@home.zone ? @home.zone.id : 0)
  74.         %p
  75.           = f.label :name, 'Name'
  76.           = f.text_field :name, :value => (current_user.full_name if logged_in?)
  77.         %p
  78.           = f.label :phone, 'Phone'
  79.           = f.text_field :phone
  80.         %p
  81.           = f.label :email, 'Email'
  82.           = f.text_field :email, :value => (current_user.email if logged_in?)
  83.         %p
  84.           = f.label :body, 'Message'
  85.           - textarea_value = "Blockshopper for sale inquiry -  #{@home.name}"
  86.           = f.text_area :body, :value => textarea_value, :onkeyup => 'jQuery("#count-characters").html(1000-jQuery(this).val().length);'
  87.         %span.gray_button.block_left.mrgl_5
  88.           = f.submit 'Contact Agent', :style=> 'width:130px'
  89.         %small.block_right.mrgr_10{:style => 'line-height:40px;'}
  90.           %strong
  91.             Characters left:
  92.           %span#count-characters= "#{1000-textarea_value.size}"
  93.         .clr
  94.  
  95.  
  96. - content_for :content_wide do
  97.   - if flash[:popup]
  98.     #bs_popup
  99.       #bs_popup_inner{ :class => "box article" }
  100.         %div{ :style => "padding:5px 15px;" }
  101.           %h3
  102.             = flash[:popup]
  103.           %p{ :style => "text-align:center;" }
  104.             = link_to 'Go to My Blockshopper', dashboard_path
  105.             |
  106.             %a{ :href => '#n', :onclick => "jQuery('#bs_popup').hide();return false;" } Close
  107.   - elsif flash[:popup_signup_active_agent]
  108.     #bs_popup
  109.       #bs_popup_inner{ :class => "box article" }
  110.         %div{ :style => "padding:5px 15px;" }
  111.           %h3
  112.             = flash[:popup_signup_active_agent]
  113.           %p{ :style => "text-align:center;" }
  114.             = link_to 'Continue', signup_active_agent_path
  115.  
  116.   - if current_user and current_user.has_role?('admin') and @home.is_a?(Property)
  117.     = link_to("Add To Search Index", add_to_search_index_path(:group => 'properties', :id => @home.id))
  118.   %h1.title{:class => property_label(@home)}= property_address_links(@home)
  119.  
  120.   .clearfix
  121.     %ul.rtabs.white.block_left
  122.       %li.roundtop.active
  123.         %a{:href => "#"} Home Details
  124.       - case property_refinance_or_purchase(@home)
  125.       - when :purchase
  126.         %li.roundtop.light-gray.mortgage-tab-item
  127.           %a{:href => mortgage_property_path(@home.parcel_id, @home.slug)} Mortgage
  128.       - when :refinance
  129.         %li.roundtop.light-gray.mortgage-tab-item
  130.           %a{:href => refinance_property_path(@home.parcel_id, @home.slug)} Refinance
  131.  
  132.     - if Configuration.ad_slot_property_mortgage_text
  133.       .block_right.mrgt_5
  134.         %span.icon_link
  135.           %script{:type => "text/javascript"}
  136.             = Configuration.ad_slot_property_mortgage_text
  137.  
  138.   .forsale_top.clearfix
  139.     .image_viewer
  140.       - case @photos.size
  141.       - when 0
  142.         .border.full
  143.           - map_url = url_for(:controller=>'maps', :action=>'map_and_street', :width => '320', :height => '317', :lat => @home.lat, :lon => @home.lon)
  144.           %iframe{:src => map_url, :width => '320', :height => '317', :frameborder => '0', :scrolling => 'no'}
  145.       - when 1
  146.         - photo = @photos.first
  147.         .border.full
  148.           .img_standard_size.s320x240.block_left
  149.             .wrp
  150.               = image_tag(photo.image.url, :alt =>  photo.caption, :id=> 'theImage')
  151.       - else
  152.         - photo = @photos.first
  153.         .border
  154.           .img_standard_size.s320x240.block_left
  155.             .wrp
  156.               = image_tag(photo.image.url, :alt =>  photo.caption, :id=> 'theImage')
  157.           .clr
  158.           #carousel.carousel
  159.             %ul
  160.               - @photos.each_with_index do |pht, index|
  161.                 %li{:class => (index.zero? ? 'active' : nil)}
  162.                   %span.top-arrow
  163.                   %a{:href => "#", :rel => pht.image.url}
  164.                     = image_tag(pht.image.thumb.url, :alt => pht.caption)
  165.         #nav_links
  166.           %h3
  167.             Picture
  168.             %span#num_current_photo 1
  169.             of #{@photos.size}
  170.           .prevnext
  171.             %a#previmg{:href => "#ng"} « Prev
  172.             |
  173.             %a#nextimg{:href => "#ng"} Next »
  174.  
  175.  
  176.  
  177.       - if !@listing and !(@listing and !@listing.fsbo_listing?) and current_user != @home.user
  178.         = 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'})
  179.         %br/
  180.  
  181.       - 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))
  182.         %strong
  183.           You've claimed this home.
  184.        - if ([email protected]) > 0
  185.          %br/
  186.          = "You have #{nmsg} #{pluralize(nmsg, 'message','messages')} regarding #{@home.address}."
  187.          %a.small_link{:href => messages_path(:folder => 'property')} Read them now
  188.      - elsif @home.user_listing_claim or @home.user
  189.        %em
  190.          This home has been claimed.
  191.      - elsif ([email protected]) > 0
  192.        %a.small_link{:href => signup_homeowner_path}
  193.          There
  194.          = nmsg.eql?(1) ? 'is 1 message' : "are #{nmsg} messages"
  195.          = "waiting for the owner of #{@home.address}."
  196.          Register and claim this property to see your messages now.
  197.      - else
  198.        %a.small_link{:href => claim_my_home_path(:parcel_id => @home.parcel_id)}
  199.          = "Own #{@home.address}? Claim your home and add details!"
  200.      - if logged_in? && can_user_change_photos?(@home)
  201.        %a#addPhotos.small_link{:href => '#'} Add Photos
  202.  
  203.    .pdetails
  204.      - if @listing
  205.        %dl
  206.          %dt Price:
  207.          %dd
  208.            - if @listing.price.to_i.zero?
  209.              —
  210.            - else
  211.              = number_to_currency(@listing.price, :precision => 0)
  212.          %dt Bedrooms:
  213.          %dd
  214.            - if @listing.beds.to_i.zero?
  215.              —
  216.            - else
  217.              = @listing.beds
  218.          %dt Bathrooms:
  219.          %dd
  220.            - if @listing.baths.to_i.zero?
  221.              —
  222.            - else
  223.              = @listing.baths
  224.          %dt Sqft:
  225.          %dd
  226.            - if @listing.living_sf.to_i.zero?
  227.              —
  228.            - else
  229.              = @listing.living_sf
  230.        .hrule7
  231.          %hr/
  232.      %dl
  233.        %dt
  234.          Owner
  235.          - if @home.as_of_date
  236.            (as of #{ @home.as_of_date.year }):
  237.        %dd
  238.          = raw link_to_search(:homeowners, @home.safe_owner(logged_in?))
  239.        - if Configuration.features.include?('taxes') and @home.property_tax > 0 and Configuration.formatted_market_state == "TX"
  240.          %dt Assessed Value:
  241.          %dd
  242.            = number_to_currency(@home.aprbldg, :precision => 0)
  243.        %dt City:
  244.        %dd
  245.          = link_to(@home.city.name, city_path(@home.city)) rescue '—'.html_safe
  246.        %dt Zip:
  247.        %dd
  248.          = link_to(@home.zip.name, zip_path(@home.zip)) rescue '—'.html_safe
  249.        %dt County:
  250.        %dd
  251.          = link_to(@home.county.name, county_path(@home.county)) rescue '—'.html_safe
  252.        %dt Region:
  253.        %dd
  254.          = link_to(@home.region.name, region_path(@home.region)) rescue '—'.html_safe
  255.        %dt Neighborhood:
  256.        %dd
  257.          - if @home.neighborhood.nil? and [email protected]('-').nil?
  258.            = link_to(@home.city.name[@home.city.name.index('-') + 1..-1], city_path(@home.city)) rescue '—'.html_safe
  259.          - else
  260.            = link_to(@home.neighborhood.name, neighborhood_path(@home.neighborhood)) rescue '—'.html_safe
  261.        %dt Subdivision:
  262.        %dd
  263.          = link_to(@home.subdivision.name, subdivision_path(@home.subdivision)) rescue '—'.html_safe
  264.        - if @home.complex and @home.complex.development
  265.          %dt Condo Development:
  266.          %dd
  267.            = link_to( @home.complex.development.name , development_path( :id => @home.complex.development.slug))
  268.        %dt Street:
  269.        %dd
  270.          = link_to(@home.street.formal_street, city_street_path(@home.city, @home.street)) rescue '—'.html_safe
  271.  
  272.      - 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))
  273.        %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"
  274.      - elsif [email protected]_listing_claim && [email protected]
  275.        %span.icon_link
  276.          - if Configuration.ad_slot_property_text_left
  277.            %script{:type => "text/javascript"}
  278.              = Configuration.ad_slot_property_text_left
  279.          - else
  280.            = 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))
  281.  
  282.      %dl
  283.        %dt Yr. Built:
  284.        %dd
  285.          - if @home.year_built.to_i.zero?
  286.            —
  287.          - else
  288.            = @home.year_built
  289.        %dt Builder:
  290.        %dd
  291.          = @home.home_builder.name rescue '—'.html_safe
  292.        %dt Sqft (land | living):
  293.        %dd
  294.          = "#{@home.land_sf} land | #{@home.living_sf} living"
  295.        %dt Bedrooms:
  296.        %dd
  297.          = @home.beds.to_i.zero? ? 'N/A' : @home.beds.to_i
  298.        %dt Bathrooms:
  299.        %dd
  300.          = @home.baths.to_i.zero? ? 'N/A' : @home.baths
  301.        %dt Property Taxes:
  302.        %dd
  303.          - if @home.use_code == 'CP'
  304.            —
  305.          - else
  306.            = "#{number_to_currency(@home.property_tax)}"
  307.            = " (#{@home.county.tax_date.year})" if @home.county && @home.county.tax_date.present?
  308.        %dt Stories:
  309.        %dd
  310.          - if @home.stories.to_i.zero?
  311.            —
  312.          - else
  313.            = @home.stories.to_i
  314.      - if @listing.try(:agent).try(:user).try(:is_active_agent?)
  315.        .clear
  316.        .more_details
  317.          %span.gray_button
  318.            %a#ask-agent-question{:href => "#"} Contact Agent
  319.  
  320.  - if @listing
  321.    .blue-title.shadow-line.clearfix.mrgb_5
  322.      %h2
  323.        %span.blue-title-text Listing Information
  324.        %span.blue-title-right
  325.  
  326.    - if @listing.description.present?
  327.      %p.mrgt_0.mrgb_20
  328.        = @listing.description
  329.    - else
  330.      %h1.not-found= "No listing information for #{@home.name}"
  331.  
  332.  
  333.  .blue-title.clearfix.mrgb_0
  334.    %h2
  335.      %span.blue-title-text
  336.        Sales History
  337.      %span.blue-title-right
  338.    - if Configuration.ad_slot_textlink_search_home_for_sale
  339.      .block_right.mrgt_5
  340.        %span.icon_link
  341.          %script{:type => "text/javascript"}
  342.            = Configuration.ad_slot_textlink_search_home_for_sale
  343.  %table.forsale.sales_history
  344.    %thead
  345.      %tr
  346.        %th.sale_price
  347.          Price
  348.        %th.sale_type
  349.          Type
  350.        %th.sale_date
  351.          Date
  352.        %th.buyer_seller
  353.          B-Buyer/S-Seller
  354.        - if FEATURES.include?('agents')
  355.          %th.sale_agent
  356.            Agent
  357.    %tbody
  358.      - if @sales.blank?
  359.        %tr
  360.          %td.tcenter{:colspan => (FEATURES.include?('agents') ? 5 : 4)} No sales history available
  361.      - else
  362.        - @sales.each_with_index do |sale, index|
  363.          %tr.first-row
  364.            %td
  365.              %strong= (sale.zeroprice == 1 ? "N/A" : "$#{number_with_delimiter(sale.sale_price.to_i)}")
  366.            %td
  367.              = sale_type_label(sale)
  368.            %td
  369.              - if sale.sale_date
  370.                = sale.sale_date.strftime("%m/%d/%Y")
  371.              - else
  372.                N/A
  373.            %td
  374.              %strong B:
  375.              = link_to_search(:buyer, sale.safe_buyer(logged_in?))
  376.            - if FEATURES.include?('agents')
  377.              %td
  378.                %strong BA:
  379.                - unless FEATURES.include?('premium_sales') && sale.featured_buyer?
  380.                  = agent_link(sale, 'buyer')  || 'N/A'
  381.                - else
  382.                  N/A
  383.          %tr.second-row{:class => (display_claim_buttons?(sale) ? 'noborder' : nil)}
  384.            %td  
  385.            %td{:colspan => 2}
  386.              - if index.zero? && sale.foreclosure?
  387.                %span.icon_link
  388.                  %script{:type => 'text/javascript'}
  389.                    = Configuration.ad_slot_textlink_more_foreclosures_property_page
  390.              - elsif index.zero? && sale.bank_sale?
  391.                %span.icon_link
  392.                  %script{:type => 'text/javascript'}
  393.                    = Configuration.ad_slot_textlink_bank_sales_property_page
  394.              - else
  395.                 
  396.            %td
  397.              %strong S:
  398.              = link_to_search(:seller, sale.safe_seller(logged_in?))
  399.            - if FEATURES.include?('agents')
  400.              %td
  401.                %strong SA:
  402.                - unless FEATURES.include?('premium_sales') && sale.featured_seller?
  403.                  = agent_link(sale, 'seller') || 'N/A'
  404.                - else
  405.                  N/A
  406.          - if display_claim_buttons?(sale)
  407.            %tr.third-row
  408.              %td
  409.              %td
  410.              %td
  411.              %td{:colspan => 2}
  412.                = claim_buttons(sale)
  413.  
  414.  
  415.  
  416.  .blue-title.clearfix.mrgb_0
  417.    %h2
  418.      %span.blue-title-text Info & Demographics
  419.      %span.blue-title-right
  420.  %table.forsale.narrow
  421.    %thead
  422.      %tr
  423.        %th Information
  424.        %th
  425.          Demographics
  426.          
  427.    %tbody
  428.      %tr
  429.        %td
  430.          %table
  431.            %tbody
  432.              %tr.noborder
  433.                %td.w120= SCHOOL_3 + ":"
  434.                %td
  435.                  %strong
  436.                    - if ([email protected])
  437.                      = link_to s.name.titleize, school_path(s)
  438.                    - else
  439.                      N/A
  440.              %tr.noborder
  441.                %td.w120= SCHOOL_2 + ":"
  442.                %td
  443.                  %strong
  444.                    - if ([email protected])
  445.                      = link_to s.name.titleize, school_path(s)
  446.                    - else
  447.                      N/A
  448.              %tr.noborder
  449.                %td.w120= SCHOOL_1 + ":"
  450.                %td
  451.                  %strong
  452.                    - if ([email protected])
  453.                      = link_to s.name.titleize, school_path(s)
  454.                    - else
  455.                      N/A
  456.              - @home.politicals.sort_by(&:political_type).each do |political|
  457.                %tr.noborder
  458.                  %td.w120
  459.                    - case political.political_type
  460.                    - when "uscongr"
  461.                      U.S. Representative:
  462.                    - when "rep"
  463.                      State Representative:
  464.                    - when "senate"
  465.                      State Senator:
  466.                    - else
  467.                      Political District:
  468.                  %td
  469.                    %strong= link_to political.name, political_path(political.political_type, political)
  470.        %td
  471.          %table
  472.            %tbody
  473.              - if (demographics = area_demographics(@home)).any?
  474.                - city = @home.tract.try(:city)
  475.                - demographics.each do |slug, name, value|
  476.                  %tr
  477.                    %td.w245
  478.                      = name
  479.                    %td
  480.                      %strong
  481.                        - if city
  482.                          = link_to(value, by_city_demographics_path(:city_id => city, :order => slug, :order_dir => 'desc'))
  483.                        - else
  484.                          = value
  485.              - else
  486.                %tr
  487.                  %td
  488.                    No Demographic information available
  489.                    
  490.          %table
  491.            %tbody
  492.              %tr.noborder
  493.                %td.w120 Census Tract:
  494.                %td.w190.tright
  495.                  %strong
  496.                    = link_to(@home.tract.name, tract_path(@home.tract)) rescue 'N/A'
  497.                    
  498.          %table
  499.            %tbody
  500.              %tr.noborder.footnote
  501.                %td.w155
  502.                  %i
  503.                    *Alone or in combination
  504.                %td.w155.tright
  505.                  %i
  506.                    Source: U.S. Census
  507.  
  508.  .adspace_468.tcenter
  509.    %script{:type => "text/javascript"}
  510.      = Configuration.ad_slot_property_728_90
  511.  
  512.  
  513.  .blue-title.clearfix.mrgb_0
  514.    %h2
  515.      %span.blue-title-text
  516.        Neighbors
  517.      %span.blue-title-right
  518.  %table.forsale.with_tabs.neighbors
  519.    %thead
  520.      %tr
  521.        %th Owner
  522.        %th Address
  523.        %th.details Bed | Bath | Living Sqft.
  524.    %tbody
  525.      - if @neighbors.blank?
  526.        %tr
  527.          %td{:colspan => 3} Not found.
  528.      - else
  529.        - @neighbors.each do |property|
  530.          %tr{:onclick => "Redirect(event,'#{property.path}', false);"}
  531.            %td= property.owner
  532.            %td= address_link(property)
  533.            %td= "#{'%0.0f' % property.beds} bd | #{property.baths} ba | #{property.living_sf} sqft"
  534.  
  535. - content_for :right_column do
  536.  %div{:style=> 'height:68px'}
  537.  - if @listing.try(:agent).try(:user).try(:is_active_agent?)
  538.    = render :partial => 'shared/contact_listing_agent', :locals => {:agent => @listing.agent, :target => @home}
  539.  - else
  540.    = market_expert_widget
  541.  .clr
  542.  = display_ad('rect', Configuration.market_slug, @home)
  543.  
  544.  = render :partial => 'shared/homeowners_favorites', :locals => {:property => @home}
  545.  
  546.  - unless @agents_disabled
  547.    = top_agents(@home)
  548.  
  549.  = render :partial => 'shared/home_resource_center', :locals => {:target => @target}
  550.  
  551.  %script{:type => "text/javascript"}
  552.    = Configuration.ad_slot_property_300_250_right_sidebar
Add Comment
Please, Sign In to add comment