pwb 1.0.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/app/assets/javascripts/comfy/admin/cms/custom.js.coffee +1 -0
- data/app/assets/stylesheets/comfy/admin/cms/custom.sass +1 -0
- data/app/assets/stylesheets/pwb/themes/berlin/inmo.scss +6 -1
- data/app/assets/stylesheets/pwb/themes/berlin/main.scss +12 -11
- data/app/assets/stylesheets/pwb/themes/default/shame.scss +1 -1
- data/app/controllers/pwb/admin_panel_controller.rb +2 -2
- data/app/controllers/pwb/api/v1/cms_pages_controller.rb +102 -0
- data/app/controllers/pwb/api/v1/website_controller.rb +7 -0
- data/app/controllers/pwb/api_public/v1/props_controller.rb +2 -2
- data/app/controllers/pwb/application_api_controller.rb +3 -7
- data/app/controllers/pwb/application_controller.rb +2 -3
- data/app/controllers/pwb/comfy_controller.rb +106 -0
- data/app/controllers/pwb/css_controller.rb +1 -2
- data/app/controllers/pwb/devise/registrations_controller.rb +2 -5
- data/app/controllers/pwb/devise_controller.rb +3 -8
- data/app/controllers/pwb/export/properties_controller.rb +5 -6
- data/app/controllers/pwb/export/translations_controller.rb +1 -5
- data/app/controllers/pwb/export/web_contents_controller.rb +1 -4
- data/app/controllers/pwb/export/website_controller.rb +0 -1
- data/app/controllers/pwb/import/mls_controller.rb +3 -6
- data/app/controllers/pwb/import/properties_controller.rb +2 -4
- data/app/controllers/pwb/import/scrapper_controller.rb +6 -9
- data/app/controllers/pwb/props_controller.rb +10 -13
- data/app/controllers/pwb/search_controller.rb +16 -16
- data/app/controllers/pwb/sections_controller.rb +21 -22
- data/app/controllers/pwb/welcome_controller.rb +1 -2
- data/app/helpers/pwb/application_helper.rb +37 -0
- data/app/helpers/pwb/css_helper.rb +9 -0
- data/app/models/pwb/cms_page_container.rb +9 -0
- data/app/models/pwb/content.rb +10 -6
- data/app/models/pwb/prop.rb +12 -4
- data/app/models/pwb/section.rb +1 -1
- data/app/models/pwb/website.rb +14 -1
- data/app/resources/pwb/api/v1/cms_block_resource.rb +11 -0
- data/app/resources/pwb/api/v1/cms_page_resource.rb +27 -0
- data/app/themes/berlin/views/layouts/pwb/application.html.erb +25 -9
- data/app/themes/berlin/views/pwb/props/show.html.erb +5 -5
- data/app/themes/berlin/views/pwb/search/_search_results.html.erb +2 -1
- data/app/themes/berlin/views/pwb/search/buy.html.erb +1 -1
- data/app/themes/berlin/views/pwb/search/rent.html.erb +2 -1
- data/app/themes/berlin/views/pwb/sections/about_us.html.erb +3 -2
- data/app/themes/berlin/views/pwb/sections/cms.html.erb +34 -0
- data/app/themes/berlin/views/pwb/sections/contact_us.html.erb +2 -1
- data/app/themes/berlin/views/pwb/welcome/_about_us_to_del.html.erb +35 -0
- data/app/themes/berlin/views/pwb/welcome/{_adv_search.html.erb → _adv_search_to_del.html.erb} +0 -0
- data/app/themes/berlin/views/pwb/welcome/_landing_carousel.html.erb +1 -1
- data/app/themes/berlin/views/pwb/welcome/_latest_properties.html.erb +2 -1
- data/app/themes/default/views/layouts/pwb/application.html.erb +24 -3
- data/app/themes/default/views/pwb/sections/about_us.html.erb +1 -2
- data/app/themes/default/views/pwb/sections/cms.html.erb +30 -0
- data/app/themes/default/views/pwb/welcome/_single_property_row.html.erb +2 -1
- data/app/themes/default/views/pwb/welcome/index.html.erb +3 -1
- data/app/views/layouts/pwb/devise.html.erb +1 -0
- data/app/views/pwb/_analytics.html.erb +15 -0
- data/app/views/pwb/_footer.html.erb +0 -12
- data/app/views/pwb/custom_css/{berlin.css.erb → _berlin.css.erb} +0 -1
- data/app/views/pwb/custom_css/{default.css.erb → _default.css.erb} +0 -1
- data/app/views/pwb/custom_css/_shared.css.erb +1 -0
- data/app/views/pwb/props/_images_section_carousel.html.erb +13 -27
- data/app/views/pwb/props/_prop_info_list.html.erb +1 -1
- data/app/views/pwb/search/_search_result_item.html.erb +62 -64
- data/app/views/pwb/search/_search_result_item_to_del.html.erb +3 -3
- data/config/client_setups/default.json +59 -21
- data/config/cms_page_containers/about-us.json +18 -0
- data/config/cms_page_containers/about.json +107 -0
- data/config/cms_page_containers/landing.json +19 -0
- data/config/cms_page_containers/legal.json +17 -0
- data/config/cms_page_containers/sell.json +96 -0
- data/config/initializers/cloudinary.rb +3 -0
- data/config/initializers/comfortable_mexican_sofa.rb +142 -0
- data/config/locales/admin.en.yml +213 -0
- data/config/locales/admin.es.yml +32 -17
- data/config/locales/admin.ru.yml +432 -0
- data/config/locales/admin.zh.yml.tmp +226 -0
- data/config/locales/de.yml +31 -32
- data/config/locales/devise.zh-HK.yml +119 -0
- data/config/locales/en.yml +3 -0
- data/config/locales/es.yml +3 -5
- data/config/locales/rails.zh-HK.yml +210 -0
- data/config/locales/ru.yml +11 -11
- data/config/locales/zh-HK.yml +154 -0
- data/config/routes.rb +17 -2
- data/db/cms_fixtures/cms/categories/pages.yml +3 -0
- data/db/cms_fixtures/cms/files/_rerenting-landing_framed.png.yml +6 -0
- data/{spec/dummy/public/system/comfy/cms/files/files/000/000/003/original → db/cms_fixtures/cms/files}/rerenting-landing_framed.png +0 -0
- data/db/cms_fixtures/cms/layouts/about-us/attributes.yml +4 -0
- data/db/cms_fixtures/cms/layouts/about-us/content.html +0 -0
- data/db/cms_fixtures/cms/layouts/about-us/javascript.js +0 -0
- data/db/cms_fixtures/cms/layouts/about-us/people/attributes.yml +4 -0
- data/db/cms_fixtures/cms/layouts/about-us/people/content.html +55 -0
- data/db/cms_fixtures/cms/layouts/about-us/services/attributes.yml +4 -0
- data/db/cms_fixtures/cms/layouts/about-us/services/content.html +32 -0
- data/db/cms_fixtures/cms/layouts/about-us/services/javascript.js +0 -0
- data/db/cms_fixtures/cms/layouts/about-us/services/stylesheet.css +0 -0
- data/db/cms_fixtures/cms/layouts/about-us/stylesheet.css +0 -0
- data/db/cms_fixtures/cms/layouts/default-layout/attributes.yml +4 -0
- data/db/cms_fixtures/cms/layouts/default-layout/content.html +51 -0
- data/db/cms_fixtures/cms/layouts/default-layout/javascript.js +0 -0
- data/db/cms_fixtures/cms/layouts/default-layout/stylesheet.css +0 -0
- data/db/cms_fixtures/cms/pages/index/about-us/attributes.yml +8 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/attributes.yml +8 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/de/attributes.yml +8 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/de/person_details_a.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/de/person_details_b.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/de/person_details_c.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/de/person_details_d.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/de/person_img_url_a.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/de/person_img_url_b.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/de/person_img_url_c.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/de/person_img_url_d.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/de/person_name_a.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/de/person_name_b.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/de/person_name_c.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/de/person_name_d.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/de/person_title_a.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/de/person_title_b.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/de/person_title_c.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/de/person_title_d.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/en/attributes.yml +8 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/en/person_details_a.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/en/person_details_b.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/en/person_details_c.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/en/person_details_d.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/en/person_img_url_a.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/en/person_img_url_b.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/en/person_img_url_c.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/en/person_img_url_d.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/en/person_name_a.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/en/person_name_b.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/en/person_name_c.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/en/person_name_d.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/en/person_title_a.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/en/person_title_b.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/en/person_title_c.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/en/person_title_d.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/es/attributes.yml +8 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/es/person_details_a.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/es/person_details_b.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/es/person_details_c.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/es/person_details_d.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/es/person_img_url_a.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/es/person_img_url_b.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/es/person_img_url_c.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/es/person_img_url_d.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/es/person_name_a.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/es/person_name_b.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/es/person_name_c.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/es/person_name_d.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/es/person_title_a.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/es/person_title_b.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/es/person_title_c.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/es/person_title_d.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/pt/attributes.yml +8 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/pt/person_details_a.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/pt/person_details_b.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/pt/person_details_c.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/pt/person_details_d.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/pt/person_name_a.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/pt/person_name_b.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/pt/person_name_c.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/pt/person_name_d.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/pt/person_title_a.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/pt/person_title_b.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/pt/person_title_c.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/pt/person_title_d.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/ru/attributes.yml +8 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/ru/person_details_a.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/ru/person_details_b.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/ru/person_details_c.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/ru/person_details_d.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/ru/person_img_url_a.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/ru/person_img_url_b.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/ru/person_img_url_c.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/ru/person_img_url_d.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/ru/person_name_a.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/ru/person_name_b.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/ru/person_name_c.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/ru/person_name_d.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/ru/person_title_a.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/ru/person_title_b.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/ru/person_title_c.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/people/ru/person_title_d.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/services/attributes.yml +8 -0
- data/db/cms_fixtures/cms/pages/index/about-us/services/content_a.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/services/content_b.html +0 -0
- data/db/cms_fixtures/cms/pages/index/about-us/services/content_c.html +0 -0
- data/db/cms_fixtures/cms/pages/index/about-us/services/de/attributes.yml +8 -0
- data/db/cms_fixtures/cms/pages/index/about-us/services/de/content_a.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/services/de/content_b.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/services/de/content_c.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/services/de/title_a.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/services/de/title_b.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/services/de/title_c.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/services/en/attributes.yml +8 -0
- data/db/cms_fixtures/cms/pages/index/about-us/services/en/content_a.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/services/en/content_b.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/services/en/content_c.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/services/en/title_a.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/services/en/title_b.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/services/en/title_c.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/services/es/attributes.yml +8 -0
- data/db/cms_fixtures/cms/pages/index/about-us/services/es/content_a.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/services/es/content_b.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/services/es/content_c.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/services/es/title_a.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/services/es/title_b.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/services/es/title_c.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/services/title_a.html +1 -0
- data/db/cms_fixtures/cms/pages/index/about-us/services/title_b.html +0 -0
- data/db/cms_fixtures/cms/pages/index/about-us/services/title_c.html +0 -0
- data/db/cms_fixtures/cms/pages/index/attributes.yml +8 -0
- data/db/cms_fixtures/cms/pages/index/content.html +1 -0
- data/db/cms_fixtures/cms/pages/index/title.html +0 -0
- data/db/cms_fixtures/cms/snippets/snippet1/attributes.yml +3 -0
- data/db/cms_fixtures/cms/snippets/snippet1/content.html +1 -0
- data/db/cms_fixtures/sample-site/categories/files.yml +1 -0
- data/db/cms_fixtures/sample-site/categories/pages.yml +1 -0
- data/db/cms_fixtures/sample-site/categories/snippets.yml +1 -0
- data/db/cms_fixtures/sample-site/files/_sample.jpg.yml +5 -0
- data/db/cms_fixtures/sample-site/files/sample.jpg +0 -0
- data/db/cms_fixtures/sample-site/layouts/default/attributes.yml +1 -0
- data/db/cms_fixtures/sample-site/layouts/default/content.html +5 -0
- data/db/cms_fixtures/sample-site/layouts/default/javascript.js +1 -0
- data/db/cms_fixtures/sample-site/layouts/default/nested/attributes.yml +2 -0
- data/db/cms_fixtures/sample-site/layouts/default/nested/content.haml +3 -0
- data/db/cms_fixtures/sample-site/layouts/default/nested/javascript.js +1 -0
- data/db/cms_fixtures/sample-site/layouts/default/nested/stylesheet.css +1 -0
- data/db/cms_fixtures/sample-site/layouts/default/stylesheet.css +1 -0
- data/db/cms_fixtures/sample-site/pages/index/attributes.yml +6 -0
- data/db/cms_fixtures/sample-site/pages/index/child/attributes.yml +3 -0
- data/db/cms_fixtures/sample-site/pages/index/child/left.haml +1 -0
- data/db/cms_fixtures/sample-site/pages/index/child/right.html +1 -0
- data/db/cms_fixtures/sample-site/pages/index/child/thumbnail.png +0 -0
- data/db/cms_fixtures/sample-site/pages/index/content.html +2 -0
- data/db/cms_fixtures/sample-site/snippets/default/attributes.yml +4 -0
- data/db/cms_fixtures/sample-site/snippets/default/content.html +1 -0
- data/db/migrate/20170513221300_create_cms.rb +133 -0
- data/db/seeds/spain/translations.rb +2 -2
- data/db/seeds/translations_ca.rb +92 -0
- data/db/seeds/translations_de.rb +86 -85
- data/db/seeds/translations_en.rb +73 -73
- data/db/seeds/translations_es.rb +79 -78
- data/db/seeds/translations_ru.rb +92 -0
- data/db/yml_seeds/prop/flat_for_rent.yml +4 -4
- data/db/yml_seeds/sections.yml +2 -2
- data/db/yml_seeds/website.yml +3 -1
- data/lib/pwb/cms_data_loader.rb +38 -0
- data/lib/pwb/engine.rb +1 -0
- data/lib/pwb/locale_loader.rb +47 -0
- data/lib/pwb/seeder.rb +8 -5
- data/lib/pwb/version.rb +1 -1
- data/lib/tasks/pwb_tasks.rake +1 -0
- data/spec/dummy/config/routes.rb +5 -0
- data/spec/dummy/config/secrets.yml +5 -0
- data/spec/dummy/db/schema.rb +111 -1
- data/spec/dummy/log/development.log +0 -0
- data/spec/features/pwb/admin_spec.rb +14 -40
- data/spec/features/pwb/admin_spec_tmp.rb +54 -0
- data/spec/fixtures/to_import/pwb-properties.csv +2 -2
- data/spec/views/pwb/application_layout.html.erb_spec.rb +1 -0
- metadata +207 -235
- data/app/themes/berlin/views/pwb/welcome/_about_us.html.erb +0 -36
- data/db/seeds/translations_others.rb +0 -215
- data/spec/dummy/public/assets/application-af04b226fd7202dfc532ce7aedb95a0128277937e90d3b3a3d35e1cce9e16886.css +0 -16
- data/spec/dummy/public/assets/application-af04b226fd7202dfc532ce7aedb95a0128277937e90d3b3a3d35e1cce9e16886.css.gz +0 -0
- data/spec/dummy/public/assets/application-ec8550e416fd8df1557ddb7f132ccd38baaafd36e4c5c9aff8420fbd47c0313f.js +0 -617
- data/spec/dummy/public/assets/application-ec8550e416fd8df1557ddb7f132ccd38baaafd36e4c5c9aff8420fbd47c0313f.js.gz +0 -0
- data/spec/dummy/public/assets/bootstrap/glyphicons-halflings-regular-13634da87d9e23f8c3ed9108ce1724d183a39ad072e73e1b3d8cbf646d2d0407.eot +0 -0
- data/spec/dummy/public/assets/bootstrap/glyphicons-halflings-regular-13634da87d9e23f8c3ed9108ce1724d183a39ad072e73e1b3d8cbf646d2d0407.eot.gz +0 -0
- data/spec/dummy/public/assets/bootstrap/glyphicons-halflings-regular-42f60659d265c1a3c30f9fa42abcbb56bd4a53af4d83d316d6dd7a36903c43e5.svg +0 -288
- data/spec/dummy/public/assets/bootstrap/glyphicons-halflings-regular-42f60659d265c1a3c30f9fa42abcbb56bd4a53af4d83d316d6dd7a36903c43e5.svg.gz +0 -0
- data/spec/dummy/public/assets/bootstrap/glyphicons-halflings-regular-a26394f7ede100ca118eff2eda08596275a9839b959c226e15439557a5a80742.woff +0 -0
- data/spec/dummy/public/assets/bootstrap/glyphicons-halflings-regular-e395044093757d82afcb138957d06a1ea9361bdcf0b442d06a18a8051af57456.ttf +0 -0
- data/spec/dummy/public/assets/bootstrap/glyphicons-halflings-regular-e395044093757d82afcb138957d06a1ea9361bdcf0b442d06a18a8051af57456.ttf.gz +0 -0
- data/spec/dummy/public/assets/bootstrap/glyphicons-halflings-regular-fe185d11a49676890d47bb783312a0cda5a44c4039214094e7957b4c040ef11c.woff2 +0 -0
- data/spec/dummy/public/assets/pwb/application-0dc6ff845cde8e032ed365593c17fe09c18a6966d44f551946bf1673d8d1ac51.css +0 -13
- data/spec/dummy/public/assets/pwb/application-0dc6ff845cde8e032ed365593c17fe09c18a6966d44f551946bf1673d8d1ac51.css.gz +0 -0
- data/spec/dummy/public/assets/pwb/application-b4df8e7ae7700a0d09d88175af77e7f457ca2fbe15ae08450551ebf3bfb0c4d1.js +0 -15656
- data/spec/dummy/public/assets/pwb/application-b4df8e7ae7700a0d09d88175af77e7f457ca2fbe15ae08450551ebf3bfb0c4d1.js.gz +0 -0
- data/spec/dummy/public/assets/pwb/themes/berlin-279c2e3a7fa11a902fdee83a6819dcc315ff8eb240cfad21b1322cedadb07ea7.js +0 -18690
- data/spec/dummy/public/assets/pwb/themes/berlin-279c2e3a7fa11a902fdee83a6819dcc315ff8eb240cfad21b1322cedadb07ea7.js.gz +0 -0
- data/spec/dummy/public/assets/pwb/themes/berlin-8038d5cfd670e73fbffb581f6bb8d8c00ac448957945622c5c34438c467d218b.css +0 -8582
- data/spec/dummy/public/assets/pwb/themes/berlin-8038d5cfd670e73fbffb581f6bb8d8c00ac448957945622c5c34438c467d218b.css.gz +0 -0
- data/spec/dummy/public/assets/pwb/themes/chic-facdff61de4827adfd797b6a36ffd6c8b432072df7190ed722d039f971caa539.css +0 -3500
- data/spec/dummy/public/assets/pwb/themes/chic-facdff61de4827adfd797b6a36ffd6c8b432072df7190ed722d039f971caa539.css.gz +0 -0
- data/spec/dummy/public/assets/pwb/themes/default-d697fb0c278f500986e614ddd7eb41fd7db502a54f3370b3e8166cc1714509d0.css +0 -8423
- data/spec/dummy/public/assets/pwb/themes/default-d697fb0c278f500986e614ddd7eb41fd7db502a54f3370b3e8166cc1714509d0.css.gz +0 -0
- data/spec/dummy/public/assets/pwb_admin_panel/application-2d624898965d7a347eb7f365feab34257032c25051633370811ed7dfd24d7c8c.js +0 -61
- data/spec/dummy/public/assets/pwb_admin_panel/application-2d624898965d7a347eb7f365feab34257032c25051633370811ed7dfd24d7c8c.js.gz +0 -0
- data/spec/dummy/public/assets/pwb_admin_panel/application-f0e38d58d1ce32501b22edd16697f45b561fa44b5be9265398a05e8dee169885.css +0 -17970
- data/spec/dummy/public/assets/pwb_admin_panel/application-f0e38d58d1ce32501b22edd16697f45b561fa44b5be9265398a05e8dee169885.css.gz +0 -0
- data/spec/dummy/public/img/about-us.png +0 -0
- data/spec/dummy/public/img/agents/agent-1.png +0 -0
- data/spec/dummy/public/img/agents/agent-3.png +0 -0
- data/spec/dummy/public/img/agents/agent-4.png +0 -0
- data/spec/dummy/public/img/agents/agent-5.png +0 -0
- data/spec/dummy/public/img/banner-ads.jpg +0 -0
- data/spec/dummy/public/img/blog-img-1.jpg +0 -0
- data/spec/dummy/public/img/blog-img-2.jpg +0 -0
- data/spec/dummy/public/img/blog-img-3.jpg +0 -0
- data/spec/dummy/public/img/client-brand-1.png +0 -0
- data/spec/dummy/public/img/client-brand-2.png +0 -0
- data/spec/dummy/public/img/client-brand-3.png +0 -0
- data/spec/dummy/public/img/client-brand-4.png +0 -0
- data/spec/dummy/public/img/client-brand-5.png +0 -0
- data/spec/dummy/public/img/favicon.ico +0 -0
- data/spec/dummy/public/img/gallery/big/1.jpg +0 -0
- data/spec/dummy/public/img/gallery/big/10.jpg +0 -0
- data/spec/dummy/public/img/gallery/big/11 - Copy.jpg +0 -0
- data/spec/dummy/public/img/gallery/big/12.jpg +0 -0
- data/spec/dummy/public/img/gallery/big/2.jpg +0 -0
- data/spec/dummy/public/img/gallery/big/3.jpg +0 -0
- data/spec/dummy/public/img/gallery/big/4.jpg +0 -0
- data/spec/dummy/public/img/gallery/big/5.jpg +0 -0
- data/spec/dummy/public/img/gallery/big/6.jpg +0 -0
- data/spec/dummy/public/img/gallery/big/7.jpg +0 -0
- data/spec/dummy/public/img/gallery/big/8.jpg +0 -0
- data/spec/dummy/public/img/gallery/big/9.jpg +0 -0
- data/spec/dummy/public/img/gallery/fancybox_buttons.png +0 -0
- data/spec/dummy/public/img/gallery/fancybox_loading.gif +0 -0
- data/spec/dummy/public/img/gallery/fancybox_loading@2x.gif +0 -0
- data/spec/dummy/public/img/gallery/fancybox_overlay.png +0 -0
- data/spec/dummy/public/img/gallery/fancybox_sprite.png +0 -0
- data/spec/dummy/public/img/gallery/fancybox_sprite@2x.png +0 -0
- data/spec/dummy/public/img/gallery/small/1.jpg +0 -0
- data/spec/dummy/public/img/gallery/small/10.jpg +0 -0
- data/spec/dummy/public/img/gallery/small/11.jpg +0 -0
- data/spec/dummy/public/img/gallery/small/12.jpg +0 -0
- data/spec/dummy/public/img/gallery/small/2.jpg +0 -0
- data/spec/dummy/public/img/gallery/small/3.jpg +0 -0
- data/spec/dummy/public/img/gallery/small/4.jpg +0 -0
- data/spec/dummy/public/img/gallery/small/5.jpg +0 -0
- data/spec/dummy/public/img/gallery/small/6.jpg +0 -0
- data/spec/dummy/public/img/gallery/small/7.jpg +0 -0
- data/spec/dummy/public/img/gallery/small/8.jpg +0 -0
- data/spec/dummy/public/img/gallery/small/9.jpg +0 -0
- data/spec/dummy/public/img/item/1.jpg +0 -0
- data/spec/dummy/public/img/item/2.jpg +0 -0
- data/spec/dummy/public/img/item/3.jpg +0 -0
- data/spec/dummy/public/img/item/4.jpg +0 -0
- data/spec/dummy/public/img/item/5.jpg +0 -0
- data/spec/dummy/public/img/item/6.jpg +0 -0
- data/spec/dummy/public/img/logo.png +0 -0
- data/spec/dummy/public/img/promo-banner.jpg +0 -0
- data/spec/dummy/public/img/property-header-bg.jpg +0 -0
- data/spec/dummy/public/img/property-view-2.jpg +0 -0
- data/spec/dummy/public/img/signin-bg.jpg +0 -0
- data/spec/dummy/public/img/slider/1.jpg +0 -0
- data/spec/dummy/public/img/slider/2.jpg +0 -0
- data/spec/dummy/public/img/slider/3.jpg +0 -0
- data/spec/dummy/public/img/slider/4.jpg +0 -0
- data/spec/dummy/public/img/slider/5.jpg +0 -0
- data/spec/dummy/public/img/slider/6.jpg +0 -0
- data/spec/dummy/public/img/testimonial-1.png +0 -0
- data/spec/dummy/public/img/testimonial-2.png +0 -0
- data/spec/dummy/public/img/testimonial-3.png +0 -0
- data/spec/dummy/public/img/testimonial-bg.jpg +0 -0
- data/spec/dummy/public/js/bootstrap.js +0 -2363
- data/spec/dummy/public/js/custom.js +0 -355
- data/spec/dummy/public/js/jquery.fancybox.pack.js +0 -46
- data/spec/dummy/public/js/jquery.min.js +0 -5
- data/spec/dummy/public/js/jquery.mixitup.js +0 -2098
- data/spec/dummy/public/js/nouislider.js +0 -1899
- data/spec/dummy/public/js/slick.js +0 -2670
- data/spec/dummy/public/system/comfy/cms/files/files/000/000/003/cms_thumb/rerenting-landing_framed.png +0 -0
@@ -5,8 +5,7 @@ module Pwb
|
|
5
5
|
@current_website = Website.unique_instance
|
6
6
|
theme_name = @current_website.theme_name.present? ? @current_website.theme_name : "default"
|
7
7
|
# @carousel_items = Content.where(tag: "landing-carousel").includes(:content_photos, :translations)
|
8
|
-
|
8
|
+
render "pwb/custom_css/#{theme_name}", formats: :css
|
9
9
|
end
|
10
10
|
end
|
11
|
-
|
12
11
|
end
|
@@ -1,15 +1,12 @@
|
|
1
1
|
class Pwb::Devise::RegistrationsController < Devise::RegistrationsController
|
2
|
-
|
3
2
|
def edit_success
|
4
|
-
|
3
|
+
render "/devise/registrations/edit_success"
|
5
4
|
end
|
6
5
|
|
7
6
|
# The default url to be used after updating a resource. You need to overwrite
|
8
7
|
# this method in your own RegistrationsController.
|
9
|
-
def after_update_path_for(
|
8
|
+
def after_update_path_for(_resource)
|
10
9
|
# signed_in_root_path(resource)
|
11
10
|
pwb.user_edit_success_path
|
12
11
|
end
|
13
|
-
|
14
|
-
|
15
12
|
end
|
@@ -1,19 +1,16 @@
|
|
1
1
|
module Pwb
|
2
2
|
class DeviseController < ApplicationController
|
3
|
-
|
4
3
|
# This controller is registered in
|
5
4
|
# pwb/config/initializers/devise.rb
|
6
5
|
# with:
|
7
6
|
# config.parent_controller = 'Pwb::DeviseController'
|
8
7
|
|
9
|
-
|
10
8
|
# # ActionController::Base
|
11
9
|
# protect_from_forgery with: :exception
|
12
10
|
|
13
11
|
# # before_action :current_agency, :sections, :set_locale, :set_theme_path
|
14
12
|
# # before_action :configure_permitted_parameters, if: :devise_controller?
|
15
13
|
|
16
|
-
|
17
14
|
# def set_theme_path
|
18
15
|
# @is_devise = true
|
19
16
|
# theme_name = "default"
|
@@ -27,7 +24,6 @@ module Pwb
|
|
27
24
|
# self.class.layout "#{Pwb::Engine.root}/app/themes/#{theme_name}/views/layouts/pwb/application"
|
28
25
|
# end
|
29
26
|
|
30
|
-
|
31
27
|
# def set_locale
|
32
28
|
# agency = current_agency
|
33
29
|
# locale = agency.default_client_locale_to_use
|
@@ -71,7 +67,7 @@ module Pwb
|
|
71
67
|
#
|
72
68
|
# Overwriting the sign_out redirect path method
|
73
69
|
# By default it is the root_path.
|
74
|
-
def after_sign_out_path_for(
|
70
|
+
def after_sign_out_path_for(_resource_or_scope)
|
75
71
|
# scope = Devise::Mapping.find_scope!(resource_or_scope)
|
76
72
|
# router_name = Devise.mappings[scope].router_name
|
77
73
|
# context = router_name ? send(router_name) : self
|
@@ -79,9 +75,8 @@ module Pwb
|
|
79
75
|
pwb.home_path
|
80
76
|
end
|
81
77
|
|
82
|
-
|
83
|
-
|
84
|
-
# TODO - check for admin v standard users
|
78
|
+
def after_sign_in_path_for(_resource_or_scope)
|
79
|
+
# TODO: - check for admin v standard users
|
85
80
|
pwb.admin_path
|
86
81
|
# stored_location_for(resource_or_scope) || signed_in_root_path(resource_or_scope)
|
87
82
|
end
|
@@ -10,11 +10,11 @@ module Pwb
|
|
10
10
|
# "Street Address", "Street Number", "Postal Code",
|
11
11
|
# "City", "Country", "Longitude", "Latitude"]
|
12
12
|
@prop_fields = [:id, :title_en, :title_es,
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
13
|
+
:description_en, :description_es,
|
14
|
+
:price_sale_current_cents, :price_rental_monthly_current_cents,
|
15
|
+
:count_bedrooms, :count_bathrooms, :count_toilets, :count_garages,
|
16
|
+
:street_address, :street_number, :postal_code,
|
17
|
+
:city, :country, :longitude, :latitude]
|
18
18
|
@props_array = []
|
19
19
|
properties.each do |prop|
|
20
20
|
prop_field_values = []
|
@@ -31,6 +31,5 @@ module Pwb
|
|
31
31
|
headers['Content-Type'] ||= 'text/csv'
|
32
32
|
render "all.csv"
|
33
33
|
end
|
34
|
-
|
35
34
|
end
|
36
35
|
end
|
@@ -1,6 +1,5 @@
|
|
1
1
|
module Pwb
|
2
2
|
class Export::TranslationsController < ApplicationApiController
|
3
|
-
|
4
3
|
# http://localhost:3000/export/translations/all
|
5
4
|
def all
|
6
5
|
# render plain: I18n::Backend::ActiveRecord::Translation.to_csv
|
@@ -8,8 +7,7 @@ module Pwb
|
|
8
7
|
# above results in below message in chrome:
|
9
8
|
# Resource interpreted as Document but transferred with MIME type application/octet-stream
|
10
9
|
|
11
|
-
|
12
|
-
translations = I18n::Backend::ActiveRecord::Translation.where(id: [1,2,3])
|
10
|
+
translations = I18n::Backend::ActiveRecord::Translation.where(id: [1, 2, 3])
|
13
11
|
@header_cols = ["translation-id", "key", "value", "locale"]
|
14
12
|
@translation_fields = [:id, :key, :value, :locale]
|
15
13
|
@translations_array = []
|
@@ -27,8 +25,6 @@ module Pwb
|
|
27
25
|
headers['Content-Disposition'] = "attachment; filename=\"pwb-translations.csv\""
|
28
26
|
headers['Content-Type'] ||= 'text/csv'
|
29
27
|
render "all.csv"
|
30
|
-
|
31
28
|
end
|
32
|
-
|
33
29
|
end
|
34
30
|
end
|
@@ -1,9 +1,8 @@
|
|
1
1
|
module Pwb
|
2
2
|
class Export::WebContentsController < ApplicationApiController
|
3
|
-
|
4
3
|
# http://localhost:3000/export/web_contents/all
|
5
4
|
def all
|
6
|
-
# TODO - figure out how to get associated cols like raw_en
|
5
|
+
# TODO: - figure out how to get associated cols like raw_en
|
7
6
|
|
8
7
|
headers['Content-Disposition'] = "attachment; filename=\"pwb-web-contents.csv\""
|
9
8
|
headers['Content-Type'] ||= 'text/csv'
|
@@ -11,8 +10,6 @@ module Pwb
|
|
11
10
|
# above results in below message in chrome:
|
12
11
|
# Resource interpreted as Document but transferred with MIME type application/octet-stream
|
13
12
|
render plain: (Content.to_csv ["key", "tag", "status", "sort_order", "raw"])
|
14
|
-
|
15
13
|
end
|
16
|
-
|
17
14
|
end
|
18
15
|
end
|
@@ -1,13 +1,12 @@
|
|
1
1
|
module Pwb
|
2
2
|
class Import::MlsController < ApplicationApiController
|
3
|
-
|
4
3
|
def retrieve
|
5
4
|
[:username, :password, :login_url, :mls_unique_name].each do |param_name|
|
6
5
|
unless params[param_name].present?
|
7
|
-
return render json: { :
|
6
|
+
return render json: { error: "Please provide #{param_name}."}, status: 422
|
8
7
|
end
|
9
8
|
end
|
10
|
-
mls_name = params[:mls_unique_name]
|
9
|
+
mls_name = params[:mls_unique_name]
|
11
10
|
# || "mris"
|
12
11
|
import_source = Pwb::ImportSource.find_by_unique_name mls_name
|
13
12
|
|
@@ -29,8 +28,7 @@ module Pwb
|
|
29
28
|
count += 1
|
30
29
|
end
|
31
30
|
|
32
|
-
|
33
|
-
|
31
|
+
render json: retrieved_properties
|
34
32
|
end
|
35
33
|
|
36
34
|
# def retrieve2
|
@@ -46,6 +44,5 @@ module Pwb
|
|
46
44
|
# end
|
47
45
|
# return render json: retrieved_properties
|
48
46
|
# end
|
49
|
-
|
50
47
|
end
|
51
48
|
end
|
@@ -1,10 +1,9 @@
|
|
1
1
|
module Pwb
|
2
2
|
class Import::PropertiesController < ApplicationApiController
|
3
|
-
|
4
3
|
# http://localhost:3000/import/Properties/retrieve_from_pwb
|
5
4
|
def retrieve_from_pwb
|
6
5
|
imported_properties = Pwb::ImportProperties.new(params[:file]).import_csv
|
7
|
-
|
6
|
+
render json: {
|
8
7
|
retrieved_items: imported_properties
|
9
8
|
}
|
10
9
|
# return render json: { "success": true }, status: :ok, head: :no_content
|
@@ -13,10 +12,9 @@ module Pwb
|
|
13
12
|
def retrieve_from_mls
|
14
13
|
imported_properties = Pwb::ImportProperties.new(params[:file]).import_mls_tsv
|
15
14
|
# Pwb::Prop.import(params[:file])
|
16
|
-
|
15
|
+
render json: {
|
17
16
|
retrieved_items: imported_properties
|
18
17
|
}
|
19
18
|
end
|
20
|
-
|
21
19
|
end
|
22
20
|
end
|
@@ -2,32 +2,29 @@ require 'faraday'
|
|
2
2
|
|
3
3
|
module Pwb
|
4
4
|
class Import::ScrapperController < ApplicationApiController
|
5
|
-
|
6
5
|
def from_webpage
|
7
6
|
# just a proof of concept at this stage
|
8
7
|
unless params[:url].present?
|
9
|
-
return render json: { :
|
8
|
+
return render json: { error: "Please provide url."}, status: 422
|
10
9
|
end
|
11
10
|
|
12
11
|
target_url = params[:url]
|
13
12
|
|
14
|
-
retrieved_properties = Pwb::SiteScrapper.new(target_url).retrieve_from_webpage
|
13
|
+
retrieved_properties = Pwb::SiteScrapper.new(target_url).retrieve_from_webpage
|
15
14
|
|
16
|
-
|
15
|
+
render json: retrieved_properties
|
17
16
|
end
|
18
17
|
|
19
18
|
def from_api
|
20
19
|
unless params[:url].present?
|
21
|
-
return render json: { :
|
20
|
+
return render json: { error: "Please provide url."}, status: 422
|
22
21
|
end
|
23
22
|
target_url = params[:url]
|
24
23
|
# "https://propertywebbuilder.herokuapp.com"
|
25
24
|
|
26
|
-
retrieved_properties = Pwb::SiteScrapper.new(target_url).retrieve_from_api
|
25
|
+
retrieved_properties = Pwb::SiteScrapper.new(target_url).retrieve_from_api
|
27
26
|
|
28
|
-
|
27
|
+
render json: retrieved_properties
|
29
28
|
end
|
30
|
-
|
31
|
-
|
32
29
|
end
|
33
30
|
end
|
@@ -2,18 +2,18 @@ require_dependency "pwb/application_controller"
|
|
2
2
|
|
3
3
|
module Pwb
|
4
4
|
class PropsController < ApplicationController
|
5
|
-
|
6
5
|
def show_for_rent
|
7
6
|
@carousel_speed = 3000
|
8
7
|
# @inmo_template = "broad"
|
9
8
|
@property_details = Prop.find_by_id(params[:id])
|
10
9
|
# gon.property_details =@property_details
|
11
10
|
@operation_type = "for_rent"
|
11
|
+
@operation_type_key = @operation_type.camelize(:lower)
|
12
12
|
if @property_details && @property_details.visible && @property_details.for_rent
|
13
13
|
# below lets me know what prices to display
|
14
14
|
@show_vacational_rental = @property_details.for_rent_short_term
|
15
15
|
|
16
|
-
js :
|
16
|
+
js property_details: @property_details
|
17
17
|
js 'Pwb/Props#show'
|
18
18
|
# page_title gets picked up automatically by meta-tags gem
|
19
19
|
@page_title = @property_details.title
|
@@ -29,12 +29,13 @@ module Pwb
|
|
29
29
|
@carousel_speed = 3000
|
30
30
|
# @inmo_template = "broad"
|
31
31
|
@operation_type = "for_sale"
|
32
|
+
@operation_type_key = @operation_type.camelize(:lower)
|
32
33
|
@property_details = Prop.find_by_id(params[:id])
|
33
34
|
|
34
35
|
if @property_details && @property_details.visible && @property_details.for_sale
|
35
36
|
# gon.property_details =@property_details
|
36
37
|
|
37
|
-
js :
|
38
|
+
js property_details: @property_details
|
38
39
|
js 'Pwb/Props#show'
|
39
40
|
@page_title = @property_details.title
|
40
41
|
@page_description = @property_details.description
|
@@ -45,9 +46,7 @@ module Pwb
|
|
45
46
|
end
|
46
47
|
end
|
47
48
|
|
48
|
-
|
49
49
|
def request_property_info_ajax
|
50
|
-
|
51
50
|
@error_messages = []
|
52
51
|
I18n.locale = params["contact"]["locale"] || I18n.default_locale
|
53
52
|
# have a hidden field in form to pass in above
|
@@ -57,7 +56,7 @@ module Pwb
|
|
57
56
|
@client = Client.find_or_initialize_by(email: params[:contact][:email])
|
58
57
|
@client.attributes = {
|
59
58
|
phone_number_primary: params[:contact][:tel],
|
60
|
-
first_names: params[:contact][:name]
|
59
|
+
first_names: params[:contact][:name]
|
61
60
|
}
|
62
61
|
|
63
62
|
title = I18n.t "mailers.property_enquiry_targeting_agency.title"
|
@@ -70,12 +69,12 @@ module Pwb
|
|
70
69
|
origin_ip: request.ip,
|
71
70
|
user_agent: request.user_agent,
|
72
71
|
delivery_email: @current_agency.email_for_property_contact_form
|
73
|
-
|
72
|
+
# origin_email: params[:contact][:email]
|
74
73
|
})
|
75
74
|
|
76
75
|
unless @enquiry.save && @client.save
|
77
|
-
@error_messages
|
78
|
-
@error_messages
|
76
|
+
@error_messages += @client.errors.full_messages
|
77
|
+
@error_messages += @enquiry.errors.full_messages
|
79
78
|
return render "pwb/ajax/request_info_errors"
|
80
79
|
end
|
81
80
|
|
@@ -94,11 +93,9 @@ module Pwb
|
|
94
93
|
return render "pwb/ajax/request_info_success", layout: false
|
95
94
|
rescue => e
|
96
95
|
|
97
|
-
# TODO - log error to logger....
|
98
|
-
@error_messages = [
|
96
|
+
# TODO: - log error to logger....
|
97
|
+
@error_messages = [I18n.t("contact.error"), e]
|
99
98
|
return render "pwb/ajax/request_info_errors", layout: false
|
100
|
-
|
101
99
|
end
|
102
|
-
|
103
100
|
end
|
104
101
|
end
|
@@ -2,8 +2,7 @@ require_dependency 'pwb/application_controller'
|
|
2
2
|
|
3
3
|
module Pwb
|
4
4
|
class SearchController < ApplicationController
|
5
|
-
|
6
|
-
before_action :header_image_url
|
5
|
+
before_action :header_image
|
7
6
|
|
8
7
|
def search_ajax_for_sale
|
9
8
|
@operation_type = "for_sale"
|
@@ -43,7 +42,7 @@ module Pwb
|
|
43
42
|
@prices_till_collection = @current_website.sale_price_options_till
|
44
43
|
# @prices_collection = @current_website.sale_price_options_from
|
45
44
|
|
46
|
-
|
45
|
+
# %W(#{''} 25,000 50,000 75,000 100,000 150,000 250,000 500,000 1,000,000 2,000,000 5,000,000 )
|
47
46
|
# ..
|
48
47
|
|
49
48
|
set_common_search_inputs
|
@@ -58,10 +57,10 @@ module Pwb
|
|
58
57
|
# initial client sort called by INMOAPP.sortSearchResults();
|
59
58
|
js 'Main/Search#sort' # trigger client-side paloma script
|
60
59
|
|
61
|
-
|
60
|
+
render "/pwb/search/buy"
|
62
61
|
end
|
63
62
|
|
64
|
-
# TODO - avoid duplication b/n rent and buy
|
63
|
+
# TODO: - avoid duplication b/n rent and buy
|
65
64
|
def rent
|
66
65
|
@page_title = I18n.t("searchForProperties")
|
67
66
|
# in erb template for this action, I have js that will render search_results template
|
@@ -84,7 +83,7 @@ module Pwb
|
|
84
83
|
@search_defaults = params[:search].present? ? params[:search] : {}
|
85
84
|
|
86
85
|
js 'Main/Search#sort' # trigger client-side paloma script
|
87
|
-
|
86
|
+
render "/pwb/search/rent"
|
88
87
|
end
|
89
88
|
|
90
89
|
private
|
@@ -124,17 +123,17 @@ module Pwb
|
|
124
123
|
@property_states = FieldKey.get_options_by_tag("property-states")
|
125
124
|
end
|
126
125
|
|
127
|
-
def apply_search_filter
|
126
|
+
def apply_search_filter(search_filtering_params)
|
128
127
|
search_filtering_params.each do |key, value|
|
129
128
|
empty_values = ["propertyTypes."]
|
130
|
-
if (empty_values.include? value) ||
|
129
|
+
if (empty_values.include? value) || value.empty?
|
131
130
|
next
|
132
131
|
end
|
133
132
|
price_fields = ["for_sale_price_from", "for_sale_price_till", "for_rent_price_from", "for_rent_price_till"]
|
134
133
|
if price_fields.include? key
|
135
134
|
currency_string = @current_website.default_currency || "usd"
|
136
|
-
currency =
|
137
|
-
# above needed as some currencies like Chilean peso
|
135
|
+
currency = Money::Currency.find currency_string
|
136
|
+
# above needed as some currencies like Chilean peso
|
138
137
|
# don't have the cents field multiplied by 100
|
139
138
|
value = value.gsub(/\D/, '').to_i * currency.subunit_to_unit
|
140
139
|
# @properties = @properties.public_send(key, value) if value.present?
|
@@ -144,7 +143,6 @@ module Pwb
|
|
144
143
|
# end
|
145
144
|
end
|
146
145
|
|
147
|
-
|
148
146
|
# def search_redirect
|
149
147
|
# # todo - allow choosing between buying or renting
|
150
148
|
# return redirect_to buy_url, locale: I18n.locale
|
@@ -182,14 +180,16 @@ module Pwb
|
|
182
180
|
# end
|
183
181
|
|
184
182
|
private
|
183
|
+
# def header_image_url
|
184
|
+
# # used by berlin theme
|
185
|
+
# hi_content = Content.where(tag: 'landing-carousel')[0]
|
186
|
+
# @header_image_url = hi_content.present? ? hi_content.default_photo_url : ""
|
187
|
+
# end
|
185
188
|
|
186
|
-
def
|
189
|
+
def header_image
|
187
190
|
# used by berlin theme
|
188
191
|
hi_content = Content.where(tag: 'landing-carousel')[0]
|
189
|
-
@
|
192
|
+
@header_image = hi_content.present? ? hi_content.default_photo : nil
|
190
193
|
end
|
191
|
-
|
192
|
-
|
193
194
|
end
|
194
|
-
|
195
195
|
end
|
@@ -2,8 +2,7 @@ require_dependency 'pwb/application_controller'
|
|
2
2
|
|
3
3
|
module Pwb
|
4
4
|
class SectionsController < ApplicationController
|
5
|
-
|
6
|
-
before_action :header_image_url
|
5
|
+
before_action :header_image
|
7
6
|
|
8
7
|
def generic_page
|
9
8
|
page_slug = params[:page_slug]
|
@@ -11,11 +10,11 @@ module Pwb
|
|
11
10
|
@title_key = section.link_key
|
12
11
|
@page_title = I18n.t(section.link_key)
|
13
12
|
if section && section.contents.first
|
14
|
-
@content = section.contents.first
|
13
|
+
@content = section.contents.first
|
15
14
|
else
|
16
|
-
@content = OpenStruct.new
|
15
|
+
@content = OpenStruct.new
|
17
16
|
end
|
18
|
-
|
17
|
+
render "/pwb/sections/static"
|
19
18
|
end
|
20
19
|
|
21
20
|
def about_us
|
@@ -25,34 +24,33 @@ module Pwb
|
|
25
24
|
# @page_keywords = 'Site, Login, Members'
|
26
25
|
# @about_us_image_url = Content.get_photo_url_by_key("aboutUs")
|
27
26
|
# @about_us_image_url = Content.find_by_key("aboutUs").content_photos.first.image_url || "http://moodleboard.com/images/prv/estate/estate-slider-bg-1.jpg"
|
28
|
-
|
27
|
+
render "/pwb/sections/about_us"
|
29
28
|
end
|
30
29
|
|
31
30
|
def privacy_policy
|
32
31
|
@title_key = "privacyPolicy"
|
33
32
|
@page_title = I18n.t("privacyPolicy")
|
34
33
|
@content = Content.find_by_key("privacyPolicy") || OpenStruct.new
|
35
|
-
|
34
|
+
render "/pwb/sections/static"
|
36
35
|
end
|
37
36
|
|
38
37
|
def legal
|
39
38
|
@title_key = "legalAdvice"
|
40
39
|
@page_title = I18n.t("legalAdvice")
|
41
40
|
@content = Content.find_by_key("legalAdvice") || OpenStruct.new
|
42
|
-
|
41
|
+
render "/pwb/sections/static"
|
43
42
|
end
|
44
43
|
|
45
|
-
|
46
44
|
def contact_us
|
47
45
|
# below for google map rendering via paloma:
|
48
|
-
js :
|
49
|
-
js :
|
46
|
+
js current_agency_primary_address: @current_agency.primary_address
|
47
|
+
js show_contact_map: @current_agency.show_contact_map
|
50
48
|
# could explicitly set function for Paloma to use like so:
|
51
49
|
# js "Pwb/Sections#contact_us"
|
52
50
|
# @enquiry = Message.new
|
53
51
|
@page_title = I18n.t("contactUs")
|
54
52
|
|
55
|
-
|
53
|
+
render "/pwb/sections/contact_us"
|
56
54
|
end
|
57
55
|
|
58
56
|
def contact_us_ajax
|
@@ -64,7 +62,7 @@ module Pwb
|
|
64
62
|
@client = Client.find_or_initialize_by(email: params[:contact][:email])
|
65
63
|
@client.attributes = {
|
66
64
|
phone_number_primary: params[:contact][:tel],
|
67
|
-
first_names: params[:contact][:name]
|
65
|
+
first_names: params[:contact][:name]
|
68
66
|
}
|
69
67
|
|
70
68
|
@enquiry = Message.new(
|
@@ -77,11 +75,12 @@ module Pwb
|
|
77
75
|
origin_ip: request.ip,
|
78
76
|
user_agent: request.user_agent,
|
79
77
|
delivery_email: @current_agency.email_for_general_contact_form
|
80
|
-
|
81
|
-
}
|
78
|
+
# origin_email: params[:contact][:email]
|
79
|
+
}
|
80
|
+
)
|
82
81
|
unless @enquiry.save && @client.save
|
83
|
-
@error_messages
|
84
|
-
@error_messages
|
82
|
+
@error_messages += @client.errors.full_messages
|
83
|
+
@error_messages += @enquiry.errors.full_messages
|
85
84
|
return render "pwb/ajax/contact_us_errors"
|
86
85
|
end
|
87
86
|
|
@@ -102,19 +101,19 @@ module Pwb
|
|
102
101
|
@flash = I18n.t "contact.success"
|
103
102
|
return render "pwb/ajax/contact_us_success", layout: false
|
104
103
|
rescue => e
|
105
|
-
# TODO - log error to logger....
|
104
|
+
# TODO: - log error to logger....
|
106
105
|
# flash.now[:error] = 'Cannot send message.'
|
107
|
-
@error_messages = [
|
106
|
+
@error_messages = [I18n.t("contact.error"), e]
|
108
107
|
return render "pwb/ajax/contact_us_errors", layout: false
|
109
108
|
end
|
110
109
|
|
111
110
|
private
|
112
111
|
|
113
|
-
def
|
112
|
+
def header_image
|
114
113
|
# used by berlin theme
|
115
|
-
|
114
|
+
hi_content = Content.where(tag: 'landing-carousel')[0]
|
115
|
+
@header_image = hi_content.present? ? hi_content.default_photo : nil
|
116
116
|
end
|
117
|
-
|
118
117
|
|
119
118
|
end
|
120
119
|
end
|