Class: CabooseRets::LandController
- Inherits:
-
ApplicationController
- Object
- Caboose::ApplicationController
- ApplicationController
- CabooseRets::LandController
- Defined in:
- app/controllers/caboose_rets/land_controller.rb
Instance Method Summary collapse
-
#admin_edit ⇒ Object
GET /admin/land/:mls_acct/edit.
-
#admin_index ⇒ Object
GET /admin/land.
-
#admin_refresh ⇒ Object
GET /admin/land/:mls_acct/refresh.
-
#details ⇒ Object
GET /land/:mls_acct/details.
-
#index ⇒ Object
GET /land.
Instance Method Details
#admin_edit ⇒ Object
GET /admin/land/:mls_acct/edit
125 126 127 128 129 |
# File 'app/controllers/caboose_rets/land_controller.rb', line 125 def admin_edit return if !user_is_allowed('properties', 'edit') @property = LandProperty.where(:mls_acct => params[:mls_acct]).first render :layout => 'caboose/admin' end |
#admin_index ⇒ Object
GET /admin/land
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
# File 'app/controllers/caboose_rets/land_controller.rb', line 108 def admin_index return if !user_is_allowed('properties', 'view') @gen = Caboose::PageBarGenerator.new(params, { 'mls_acct' => '' },{ 'model' => 'CabooseRets::LandProperty', 'sort' => 'mls_acct', 'desc' => false, 'base_url' => '/admin/land', 'use_url_params' => false }) @properties = @gen.items render :layout => 'caboose/admin' end |
#admin_refresh ⇒ Object
GET /admin/land/:mls_acct/refresh
132 133 134 135 136 137 138 139 140 141 |
# File 'app/controllers/caboose_rets/land_controller.rb', line 132 def admin_refresh return if !user_is_allowed('properties', 'edit') p = LandProperty.find(params[:mls_acct]) p.delay(:queue => 'rets').refresh_from_mls resp = Caboose::StdClass.new resp.success = "The property's info is being updated from MLS. This may take a few minutes depending on how many images it has." render :json => resp end |
#details ⇒ Object
GET /land/:mls_acct/details
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'app/controllers/caboose_rets/land_controller.rb', line 85 def details @property = CabooseRets::LandProperty.where(:mls_acct => params[:mls_acct]).first @saved = logged_in? && SavedProperty.where(:user_id => logged_in_user.id, :mls_acct => params[:mls_acct]).exists? if @property.nil? @mls_acct = params[:mls_acct] CabooseRets::RetsImporter.delay(:queue => 'rets').import_property(@mls_acct.to_i) render 'land/not_exists' return end @block_options = { :mls_acct => params[:mls_acct], :property => @property, :saved => @saved, :agent => @property ? Agent.where(:la_code => @property.la_code).first : nil, :form_authenticity_token => form_authenticity_token } end |
#index ⇒ Object
GET /land
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'app/controllers/caboose_rets/land_controller.rb', line 6 def index @gen = Caboose::PageBarGenerator.new(params, { 'acreage' => '', 'acreage_gte' => '', 'acreage_lte' => '', 'acreage_source' => '', 'adjoining_land_use' => '', 'agent_notes_like' => '', 'area' => '', 'bom_date' => '', 'city' => '', 'city_code' => '', 'co_la_code' => '', 'co_lo_code' => '', 'co_sa_code' => '', 'co_so_code' => '', 'converted' => '', 'county' => '', 'current_price_gte' => '', 'current_price_lte' => '', 'date_created_gte' => '', 'date_created_lte' => '', 'date_modified_gte' => '', 'date_modified_lte' => '', 'elem_school' => '', 'ftr_access_like' => '', 'ftr_lotdesc_like' => '', 'ftr_mineralrights' => '', 'ftr_zoning' => '', 'high_school' => '', 'internet_yn' => '', 'la_code' => '', 'list_date_gte' => '', 'list_date_lte' => '', 'list_price_gte' => '', 'list_price_lte' => '', 'lo_code' => '', 'middle_school' => '', 'mls_acct' => '', 'municipality' => '', 'parcel_id' => '', 'prop_type' => '', 'remarks_like' => '', 'sa_code' => '', 'so_code' => '', 'state' => '', 'status' => 'Active', 'address_like' => '', 'street_name_like' => '', 'street_num_like' => '', 'subdivision' => '', 'unit_num' => '', 'waterfront' => '', 'waterfront_yn' => '', 'zip' => '' },{ 'model' => 'CabooseRets::LandProperty', 'sort' => CabooseRets::default_property_sort, 'desc' => false, 'skip' => ['status'], 'abbreviations' => { 'address_like' => 'street_num_concat_street_name_like' }, 'base_url' => '/land/search', 'items_per_page' => 10 }) @properties = @gen.items if params[:waterfront].present? then @properties.reject!{|p| p.waterfront.blank?} end @block_options = { :properties => @properties, :saved_search => nil, :pager => @gen } end |