pwb 1.2.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +40 -25
- data/app/assets/fonts/fonts/FontAwesome.otf +0 -0
- data/app/assets/fonts/fonts/fontawesome-webfont.eot +0 -0
- data/app/assets/fonts/fonts/fontawesome-webfont.svg +2668 -637
- data/app/assets/fonts/fonts/fontawesome-webfont.ttf +0 -0
- data/app/assets/fonts/fonts/fontawesome-webfont.woff +0 -0
- data/app/assets/fonts/fonts/fontawesome-webfont.woff2 +0 -0
- data/app/assets/javascripts/pwb/shared/page-content.js +24 -0
- data/app/assets/javascripts/pwb/shared/squares-container.js +58 -0
- data/app/assets/javascripts/pwb/shared/vue-main.js +1 -1
- data/app/assets/javascripts/pwb/shared/vue-squares.js.erb +74 -0
- data/app/assets/javascripts/pwb/squares/tabable-section.js +47 -0
- data/app/assets/javascripts/pwb/themes/squares.js.erb +45 -0
- data/app/assets/javascripts/pwb/themes/vic.js.erb +152 -0
- data/app/assets/javascripts/pwb_admin_panel/application_legacy_1.js +5 -0
- data/app/assets/stylesheets/pwb/themes/berlin.scss +4 -0
- data/app/assets/stylesheets/pwb/themes/berlin/main.scss +1 -1
- data/app/assets/stylesheets/pwb/themes/default.scss +1 -0
- data/app/assets/stylesheets/pwb/themes/default/carousel.scss +2 -1
- data/app/assets/stylesheets/pwb/themes/default/landing_content_areas.scss +13 -13
- data/app/assets/stylesheets/pwb/themes/default/shame.scss +0 -16
- data/app/assets/stylesheets/pwb/themes/matt.scss +18 -0
- data/app/assets/stylesheets/pwb/themes/shared/liquid_templates.scss +37 -0
- data/app/assets/stylesheets/pwb/themes/shared/shame.scss +7 -0
- data/app/assets/stylesheets/pwb/themes/squares.scss +22 -0
- data/app/assets/stylesheets/pwb/themes/squares/vue-material-docs.scss +200 -0
- data/app/assets/stylesheets/pwb/themes/squares/vue-material-vars.scss +141 -0
- data/app/assets/stylesheets/pwb/themes/vic.scss +104 -0
- data/app/assets/stylesheets/pwb/themes/vic/general.scss +15 -0
- data/app/assets/stylesheets/pwb/themes/vic/landing.scss +189 -0
- data/app/assets/stylesheets/pwb/themes/vic/slider.scss +127 -0
- data/app/assets/stylesheets/pwb_admin_panel/application_legacy_1.scss +6 -0
- data/app/controllers/pwb/admin_panel_controller.rb +7 -1
- data/app/controllers/pwb/api/v1/clients_controller.rb +35 -0
- data/app/controllers/pwb/api/v1/contacts_controller.rb +41 -0
- data/app/controllers/pwb/api/v1/links_controller.rb +47 -0
- data/app/controllers/pwb/api/v1/page_controller.rb +117 -0
- data/app/controllers/pwb/api/v1/page_fragments_controller.rb +74 -0
- data/app/controllers/pwb/api/v1/properties_controller.rb +30 -9
- data/app/controllers/pwb/api/v1/sections_controller.rb +27 -26
- data/app/controllers/pwb/api/v1/website_controller.rb +11 -11
- data/app/controllers/pwb/application_controller.rb +22 -11
- data/app/controllers/pwb/{sections_controller.rb → contact_us_controller.rb} +24 -45
- data/app/controllers/pwb/css_controller.rb +5 -2
- data/app/controllers/pwb/pages_controller.rb +36 -0
- data/app/controllers/pwb/search_controller.rb +33 -11
- data/app/controllers/pwb/squares_controller.rb +48 -0
- data/app/controllers/pwb/welcome_controller.rb +30 -5
- data/app/helpers/pwb/application_helper.rb +50 -49
- data/app/helpers/pwb/css_helper.rb +14 -0
- data/app/helpers/pwb/navigation_helper.rb +82 -0
- data/app/models/pwb/contact.rb +25 -0
- data/app/models/pwb/content.rb +26 -8
- data/app/models/pwb/content_photo.rb +18 -0
- data/app/models/pwb/link.rb +41 -0
- data/app/models/pwb/message.rb +1 -1
- data/app/models/pwb/page.rb +227 -0
- data/app/models/pwb/page_content.rb +33 -0
- data/app/models/pwb/page_part.rb +17 -0
- data/app/models/pwb/preset_style.rb +37 -0
- data/app/models/pwb/prop.rb +4 -0
- data/app/models/pwb/website.rb +64 -9
- data/app/resources/pwb/api/v1/{section_resource.rb → client_resource.rb} +3 -4
- data/app/resources/pwb/api/v1/property_resource.rb +23 -4
- data/app/resources/pwb/api/v1/web_content_resource.rb +1 -1
- data/app/resources/pwb/api_public/v1/prop_resource.rb +9 -2
- data/{db/cms_fixtures/cms/layouts/about-us/content.html → app/themes/airbnb/views/layouts/pwb/_generic_modal.html.erb} +0 -0
- data/{db/cms_fixtures/cms/layouts/about-us/javascript.js → app/themes/airbnb/views/layouts/pwb/_login_modal.html.erb} +0 -0
- data/app/themes/airbnb/views/layouts/pwb/application.html.erb +82 -0
- data/app/themes/airbnb/views/pwb/_footer.html.erb +25 -0
- data/app/themes/airbnb/views/pwb/props/_images_section_carousel.html.erb +43 -0
- data/app/themes/airbnb/views/pwb/props/show.html.erb +69 -0
- data/app/themes/airbnb/views/pwb/search/_search_form_for_rent.html.erb +183 -0
- data/app/themes/airbnb/views/pwb/search/_search_results.html.erb +34 -0
- data/app/themes/airbnb/views/pwb/search/buy.html.erb +65 -0
- data/app/themes/airbnb/views/pwb/search/rent.html.erb +87 -0
- data/app/themes/airbnb/views/pwb/sections/_contact_us_form.html.erb +49 -0
- data/app/themes/airbnb/views/pwb/sections/contact_us.html.erb +56 -0
- data/app/themes/airbnb/views/pwb/welcome/_content_area_cols.html.erb +12 -0
- data/app/themes/airbnb/views/pwb/welcome/_single_property_row.html.erb +51 -0
- data/app/themes/airbnb/views/pwb/welcome/index.html.erb +66 -0
- data/app/themes/berlin/views/pwb/_footer.html.erb +15 -20
- data/app/themes/berlin/views/pwb/_header.html.erb +7 -9
- data/app/themes/berlin/views/pwb/pages/show.html.erb +50 -0
- data/app/themes/berlin/views/pwb/search/buy.html.erb +1 -1
- data/app/themes/berlin/views/pwb/search/rent.html.erb +1 -2
- data/app/themes/berlin/views/pwb/sections/contact_us.html.erb +1 -1
- data/app/themes/berlin/views/pwb/welcome/index.html.erb +51 -7
- data/app/themes/config.json +14 -0
- data/app/themes/default/views/pwb/{sections/cms.html.erb → pages/show.html.erb} +9 -8
- data/app/themes/default/views/pwb/search/buy.html.erb +1 -1
- data/app/themes/default/views/pwb/search/rent.html.erb +1 -1
- data/app/themes/default/views/pwb/sections/about_us.html.erb +8 -7
- data/app/themes/default/views/pwb/sections/contact_us.html.erb +40 -30
- data/app/themes/default/views/pwb/sections/static.html.erb +3 -20
- data/app/themes/default/views/pwb/welcome/_single_property_row.html.erb +1 -1
- data/app/themes/default/views/pwb/welcome/index.html.erb +7 -38
- data/app/themes/matt/views/layouts/pwb/application.html.erb +45 -0
- data/app/themes/matt/views/pwb/_footer.html.erb +60 -0
- data/app/themes/matt/views/pwb/_header.html.erb +105 -0
- data/app/themes/matt/views/pwb/search/buy.html.erb +65 -0
- data/app/themes/matt/views/pwb/welcome/index.html.erb +132 -0
- data/app/themes/vic/views/layouts/pwb/application.html.erb +94 -0
- data/app/themes/vic/views/pwb/_header.html.erb +100 -0
- data/app/themes/vic/views/pwb/props/_images_section_carousel.html.erb +43 -0
- data/app/themes/vic/views/pwb/props/show.html.erb +69 -0
- data/app/themes/vic/views/pwb/search/buy.html.erb +65 -0
- data/app/themes/vic/views/pwb/search/rent.html.erb +65 -0
- data/app/themes/vic/views/pwb/sections/_contact_us_form.html.erb +49 -0
- data/app/themes/vic/views/pwb/sections/contact_us.html.erb +56 -0
- data/app/themes/vic/views/pwb/welcome/_content_area_cols.html.erb +12 -0
- data/app/themes/vic/views/pwb/welcome/_single_property_row.html.erb +51 -0
- data/app/themes/vic/views/pwb/welcome/index.html.erb +27 -0
- data/app/views/devise/shared/_links.html.erb +1 -1
- data/app/views/layouts/pwb/admin_panel_error.html.erb +19 -0
- data/app/views/layouts/pwb/admin_panel_legacy_1.html.erb +21 -0
- data/app/views/layouts/pwb/squares.html.erb +72 -0
- data/app/views/pwb/_footer.html.erb +2 -6
- data/app/views/pwb/_header.html.erb +23 -25
- data/app/views/pwb/admin_panel/show_legacy_1.html.erb +3 -0
- data/app/views/pwb/custom_css/_berlin.css.erb +0 -67
- data/app/views/pwb/custom_css/_default.css.erb +0 -22
- data/app/views/pwb/custom_css/_shared.css.erb +4 -3
- data/app/views/pwb/custom_css/_vic.css.erb +10 -0
- data/app/views/pwb/props/_images_section_carousel.html.erb +1 -1
- data/app/views/pwb/search/_search_result_item.html.erb +1 -1
- data/app/views/pwb/squares/show_client.html.erb +26 -0
- data/app/views/pwb/squares/show_prop.html.erb +26 -0
- data/app/views/pwb/squares/vue.html.erb +1 -0
- data/config/client_setups/default.json +28 -27
- data/config/initializers/i18n_globalise.rb +4 -0
- data/config/locales/admin.en.yml +38 -7
- data/config/locales/admin.es.yml +60 -6
- data/config/locales/admin.pt.yml +474 -0
- data/config/locales/admin.ru.yml +49 -6
- data/config/locales/devise.it.yml +137 -0
- data/config/locales/en.yml +7 -7
- data/config/locales/it.yml +160 -0
- data/config/locales/pt.yml +2 -0
- data/config/locales/rails.it.yml +213 -0
- data/config/locales/tr.yml +36 -36
- data/config/locales/vi.yml +5 -5
- data/config/preset_styles/green_amber.json +23 -0
- data/config/preset_styles/purple_teal.json +23 -0
- data/config/preset_styles/red_light.json +18 -0
- data/config/routes.rb +35 -23
- data/db/example_images/carousel_villa_with_pool.jpg +0 -0
- data/db/example_images/flat_luxury_dining_area.jpg +0 -0
- data/db/example_images/flat_luxury_living_area.jpg +0 -0
- data/db/migrate/20161120103546_create_pwb_props.rb +3 -3
- data/db/migrate/20161122174847_create_pwb_sections.rb +9 -8
- data/db/migrate/20161128221919_create_pwb_clients.rb +1 -0
- data/db/migrate/20170315195413_add_extra_cols_to_pwb_sections.rb +7 -6
- data/db/migrate/20170716075456_create_pwb_pages.rb +23 -0
- data/db/migrate/20170716110121_translate_pages.rb +17 -0
- data/db/migrate/20170720183443_create_pwb_links.rb +29 -0
- data/db/migrate/20170720201601_translate_links.rb +13 -0
- data/db/migrate/20170915094326_create_pwb_page_contents.rb +17 -0
- data/db/migrate/20170917215533_add_page_part_key_to_pwb_contents.rb +7 -0
- data/db/migrate/20170919134945_add_block_key_to_pwb_content_photos.rb +5 -0
- data/db/migrate/20170923195321_create_pwb_contacts.rb +33 -0
- data/db/migrate/20171011212930_create_pwb_page_parts.rb +30 -0
- data/db/seeds/translations_es.rb +1 -87
- data/db/seeds/translations_it.rb +92 -0
- data/db/yml_seeds/agency_address.yml +8 -8
- data/db/yml_seeds/contacts.yml +13 -0
- data/db/yml_seeds/content_translations/en.yml +73 -0
- data/db/yml_seeds/content_translations/es.yml +74 -0
- data/db/yml_seeds/content_translations/it.yml +73 -0
- data/db/yml_seeds/content_translations/pt.yml +73 -0
- data/db/yml_seeds/{content/footer.yml → footer.yml} +0 -0
- data/db/yml_seeds/links.yml +389 -0
- data/db/yml_seeds/page_parts/ABOUT_PAGE_PARTS.md +5 -0
- data/db/yml_seeds/page_parts/about-us__content_html.yml +24 -0
- data/db/yml_seeds/page_parts/about-us__our_agency.yml +51 -0
- data/db/yml_seeds/page_parts/contact-us__content_html.yml +24 -0
- data/db/yml_seeds/page_parts/contact-us__form_and_map.yml +17 -0
- data/db/yml_seeds/page_parts/home__about_us_services.yml +85 -0
- data/db/yml_seeds/page_parts/home__content_html.yml +24 -0
- data/db/yml_seeds/page_parts/home__landing_hero.yml +51 -0
- data/db/yml_seeds/page_parts/legal__content_html.yml +24 -0
- data/db/yml_seeds/page_parts/privacy__content_html.yml +24 -0
- data/db/yml_seeds/page_parts/sell__content_html.yml +24 -0
- data/db/yml_seeds/pages/about.yml +11 -0
- data/db/yml_seeds/pages/buy.yml +23 -0
- data/db/yml_seeds/pages/contact.yml +12 -0
- data/db/yml_seeds/pages/home.yml +15 -0
- data/db/yml_seeds/pages/legal_notice.yml +11 -0
- data/db/yml_seeds/pages/privacy_policy.yml +11 -0
- data/db/yml_seeds/pages/rent.yml +15 -0
- data/db/yml_seeds/pages/sell.yml +13 -0
- data/db/yml_seeds/prop/flat_for_rent.yml +11 -11
- data/db/yml_seeds/prop/flat_for_rent_2.yml +57 -0
- data/db/yml_seeds/prop/flat_for_sale.yml +11 -12
- data/db/yml_seeds/prop/flat_for_sale_2.yml +56 -0
- data/db/yml_seeds/prop/villa_for_rent.yml +14 -14
- data/db/yml_seeds/prop/villa_for_sale.yml +15 -15
- data/db/yml_seeds/prop_spain/flat_for_rent.yml +58 -0
- data/db/yml_seeds/prop_spain/flat_for_sale.yml +58 -0
- data/db/yml_seeds/prop_spain/villa_for_rent.yml +58 -0
- data/db/yml_seeds/prop_spain/villa_for_sale.yml +59 -0
- data/db/yml_seeds/sections.yml +119 -119
- data/db/yml_seeds/{content → to_delete}/about_us.yml +0 -0
- data/db/yml_seeds/{content → to_delete}/carousel.yml +0 -0
- data/db/yml_seeds/{content → to_delete}/content_columns.yml +0 -0
- data/db/yml_seeds/to_delete/footer.yml +15 -0
- data/db/yml_seeds/{content → to_delete}/sell.yml +0 -0
- data/db/yml_seeds/{content → to_delete}/static.yml +0 -0
- data/db/yml_seeds/website.yml +2 -1
- data/lib/pwb/engine.rb +16 -2
- data/lib/pwb/pages_seeder.rb +190 -0
- data/lib/pwb/seeder.rb +56 -14
- data/lib/pwb/version.rb +1 -1
- data/lib/tasks/pwb_tasks.rake +19 -2
- data/spec/controllers/pwb/api/v1/propeties_controller_spec.rb +2 -2
- data/spec/controllers/pwb/welcome_controller_spec.rb +18 -5
- data/spec/dummy/config/initializers/assets.rb +9 -0
- data/spec/dummy/config/routes.rb +2 -0
- data/spec/dummy/config/secrets.yml +3 -0
- data/spec/dummy/db/migrate/20171201161323_create_property_web_scraper_import_hosts.property_web_scraper.rb +22 -0
- data/spec/dummy/db/migrate/20171201161324_create_property_web_scraper_listings.property_web_scraper.rb +84 -0
- data/spec/dummy/db/schema.rb +475 -398
- data/spec/factories/pwb_contacts.rb +5 -0
- data/spec/factories/pwb_contents.rb +3 -0
- data/spec/factories/pwb_links.rb +5 -0
- data/spec/factories/pwb_page_contents.rb +5 -0
- data/spec/factories/pwb_page_parts.rb +8 -0
- data/spec/factories/pwb_pages.rb +29 -0
- data/spec/factories/pwb_prop_photos.rb +11 -2
- data/spec/fixtures/mls/properties_interealty.json +1 -496
- data/spec/fixtures/params/bulk_create.json +3 -3
- data/spec/libraries/pwb/pages_seeder_spec.rb +56 -0
- data/spec/libraries/pwb/seeder_spec.rb +14 -10
- data/spec/models/pwb/contact_spec.rb +7 -0
- data/spec/models/pwb/link_spec.rb +7 -0
- data/spec/models/pwb/page_content_spec.rb +7 -0
- data/spec/models/pwb/page_part_spec.rb +7 -0
- data/spec/models/pwb/page_spec.rb +28 -0
- data/spec/models/pwb/website_spec.rb +10 -0
- data/spec/rails_helper.rb +1 -1
- data/spec/requests/pwb/themes_spec.rb +15 -10
- data/spec/views/pwb/application_layout.html.erb_spec.rb +28 -21
- data/spec/views/pwb/contact_us.html.erb_spec.rb +11 -0
- data/spec/views/pwb/welcome.html.erb_spec.rb +13 -9
- metadata +230 -244
- data/app/controllers/pwb/api/v1/cms_pages_controller.rb +0 -102
- data/app/controllers/pwb/comfy_controller.rb +0 -106
- data/app/models/pwb/cms_page_container.rb +0 -9
- data/app/models/pwb/section.rb +0 -35
- data/app/models/pwb/welcome.rb +0 -4
- data/app/resources/pwb/api/v1/cms_block_resource.rb +0 -11
- data/app/resources/pwb/api/v1/cms_page_resource.rb +0 -27
- data/app/themes/berlin/views/pwb/sections/about_us.html.erb +0 -59
- data/app/themes/berlin/views/pwb/sections/cms.html.erb +0 -34
- data/app/themes/berlin/views/pwb/sections/static.html.erb +0 -58
- data/app/views/pwb/search/_search_result_item_to_del.html.erb +0 -56
- data/config/cms_page_containers/about-us.json +0 -18
- data/config/cms_page_containers/about.json +0 -107
- data/config/cms_page_containers/landing.json +0 -19
- data/config/cms_page_containers/legal.json +0 -17
- data/config/cms_page_containers/sell.json +0 -96
- data/config/initializers/comfortable_mexican_sofa.rb +0 -142
- data/config/initializers/i18n.rb +0 -1
- data/db/cms_fixtures/cms/categories/pages.yml +0 -3
- data/db/cms_fixtures/cms/files/_rerenting-landing_framed.png.yml +0 -6
- data/db/cms_fixtures/cms/files/rerenting-landing_framed.png +0 -0
- data/db/cms_fixtures/cms/layouts/about-us/attributes.yml +0 -4
- data/db/cms_fixtures/cms/layouts/about-us/people/attributes.yml +0 -4
- data/db/cms_fixtures/cms/layouts/about-us/people/content.html +0 -55
- data/db/cms_fixtures/cms/layouts/about-us/services/attributes.yml +0 -4
- data/db/cms_fixtures/cms/layouts/about-us/services/content.html +0 -32
- 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 +0 -4
- data/db/cms_fixtures/cms/layouts/default-layout/content.html +0 -51
- 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 +0 -8
- data/db/cms_fixtures/cms/pages/index/about-us/people/attributes.yml +0 -8
- data/db/cms_fixtures/cms/pages/index/about-us/people/de/attributes.yml +0 -8
- data/db/cms_fixtures/cms/pages/index/about-us/people/de/person_details_a.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/de/person_details_b.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/de/person_details_c.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/de/person_details_d.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/de/person_img_url_a.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/de/person_img_url_b.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/de/person_img_url_c.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/de/person_img_url_d.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/de/person_name_a.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/de/person_name_b.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/de/person_name_c.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/de/person_name_d.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/de/person_title_a.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/de/person_title_b.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/de/person_title_c.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/de/person_title_d.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/en/attributes.yml +0 -8
- data/db/cms_fixtures/cms/pages/index/about-us/people/en/person_details_a.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/en/person_details_b.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/en/person_details_c.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/en/person_details_d.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/en/person_img_url_a.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/en/person_img_url_b.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/en/person_img_url_c.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/en/person_img_url_d.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/en/person_name_a.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/en/person_name_b.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/en/person_name_c.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/en/person_name_d.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/en/person_title_a.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/en/person_title_b.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/en/person_title_c.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/en/person_title_d.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/es/attributes.yml +0 -8
- data/db/cms_fixtures/cms/pages/index/about-us/people/es/person_details_a.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/es/person_details_b.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/es/person_details_c.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/es/person_details_d.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/es/person_img_url_a.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/es/person_img_url_b.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/es/person_img_url_c.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/es/person_img_url_d.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/es/person_name_a.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/es/person_name_b.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/es/person_name_c.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/es/person_name_d.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/es/person_title_a.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/es/person_title_b.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/es/person_title_c.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/es/person_title_d.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/pt/attributes.yml +0 -8
- data/db/cms_fixtures/cms/pages/index/about-us/people/pt/person_details_a.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/pt/person_details_b.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/pt/person_details_c.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/pt/person_details_d.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/pt/person_name_a.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/pt/person_name_b.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/pt/person_name_c.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/pt/person_name_d.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/pt/person_title_a.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/pt/person_title_b.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/pt/person_title_c.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/pt/person_title_d.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/ru/attributes.yml +0 -8
- data/db/cms_fixtures/cms/pages/index/about-us/people/ru/person_details_a.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/ru/person_details_b.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/ru/person_details_c.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/ru/person_details_d.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/ru/person_img_url_a.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/ru/person_img_url_b.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/ru/person_img_url_c.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/ru/person_img_url_d.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/ru/person_name_a.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/ru/person_name_b.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/ru/person_name_c.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/ru/person_name_d.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/ru/person_title_a.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/ru/person_title_b.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/ru/person_title_c.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/people/ru/person_title_d.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/services/attributes.yml +0 -8
- data/db/cms_fixtures/cms/pages/index/about-us/services/content_a.html +0 -1
- 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 +0 -8
- data/db/cms_fixtures/cms/pages/index/about-us/services/de/content_a.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/services/de/content_b.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/services/de/content_c.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/services/de/title_a.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/services/de/title_b.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/services/de/title_c.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/services/en/attributes.yml +0 -8
- data/db/cms_fixtures/cms/pages/index/about-us/services/en/content_a.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/services/en/content_b.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/services/en/content_c.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/services/en/title_a.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/services/en/title_b.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/services/en/title_c.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/services/es/attributes.yml +0 -8
- data/db/cms_fixtures/cms/pages/index/about-us/services/es/content_a.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/services/es/content_b.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/services/es/content_c.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/services/es/title_a.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/services/es/title_b.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/services/es/title_c.html +0 -1
- data/db/cms_fixtures/cms/pages/index/about-us/services/title_a.html +0 -1
- 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 +0 -8
- data/db/cms_fixtures/cms/pages/index/content.html +0 -1
- data/db/cms_fixtures/cms/pages/index/title.html +0 -0
- data/db/cms_fixtures/cms/snippets/snippet1/attributes.yml +0 -3
- data/db/cms_fixtures/cms/snippets/snippet1/content.html +0 -1
- data/db/cms_fixtures/sample-site/categories/files.yml +0 -1
- data/db/cms_fixtures/sample-site/categories/pages.yml +0 -1
- data/db/cms_fixtures/sample-site/categories/snippets.yml +0 -1
- data/db/cms_fixtures/sample-site/files/_sample.jpg.yml +0 -5
- data/db/cms_fixtures/sample-site/files/sample.jpg +0 -0
- data/db/cms_fixtures/sample-site/layouts/default/attributes.yml +0 -1
- data/db/cms_fixtures/sample-site/layouts/default/content.html +0 -5
- data/db/cms_fixtures/sample-site/layouts/default/javascript.js +0 -1
- data/db/cms_fixtures/sample-site/layouts/default/nested/attributes.yml +0 -2
- data/db/cms_fixtures/sample-site/layouts/default/nested/content.haml +0 -3
- data/db/cms_fixtures/sample-site/layouts/default/nested/javascript.js +0 -1
- data/db/cms_fixtures/sample-site/layouts/default/nested/stylesheet.css +0 -1
- data/db/cms_fixtures/sample-site/layouts/default/stylesheet.css +0 -1
- data/db/cms_fixtures/sample-site/pages/index/attributes.yml +0 -6
- data/db/cms_fixtures/sample-site/pages/index/child/attributes.yml +0 -3
- data/db/cms_fixtures/sample-site/pages/index/child/left.haml +0 -1
- data/db/cms_fixtures/sample-site/pages/index/child/right.html +0 -1
- data/db/cms_fixtures/sample-site/pages/index/child/thumbnail.png +0 -0
- data/db/cms_fixtures/sample-site/pages/index/content.html +0 -2
- data/db/cms_fixtures/sample-site/snippets/default/attributes.yml +0 -4
- data/db/cms_fixtures/sample-site/snippets/default/content.html +0 -1
- data/db/migrate/20170315212222_translate_sections.rb +0 -15
- data/db/migrate/20170513221300_create_cms.rb +0 -133
- data/lib/pwb/cms_data_loader.rb +0 -38
- data/spec/dummy/log/development.log +0 -0
- data/spec/dummy/log/test.log +0 -0
- data/spec/dummy/public/uploads/pwb/content_photo/image/1/carousel_windows.jpg +0 -0
- data/spec/dummy/public/uploads/pwb/content_photo/image/2/carousel_deck_chair.jpg +0 -0
- data/spec/dummy/public/uploads/pwb/content_photo/image/3/carousel_grass.jpg +0 -0
- data/spec/dummy/public/uploads/pwb/content_photo/image/4/carousel_grass.jpg +0 -0
- data/spec/dummy/public/uploads/pwb/prop_photo/image/1/flat_balcony.jpg +0 -0
- data/spec/dummy/public/uploads/pwb/prop_photo/image/1/gdaje3atcct1gx2ngv9u.jpg +0 -0
- data/spec/dummy/public/uploads/pwb/prop_photo/image/1/new_villa.jpg +0 -0
- data/spec/dummy/public/uploads/pwb/prop_photo/image/2/flat_balcony.jpg +0 -0
- data/spec/dummy/public/uploads/pwb/prop_photo/image/2/kitchen_modern.jpg +0 -0
- data/spec/dummy/public/uploads/pwb/prop_photo/image/2/rxo23syongfydjpoizrd.jpg +0 -0
- data/spec/dummy/public/uploads/pwb/prop_photo/image/3/mansion_front.jpg +0 -0
- data/spec/dummy/public/uploads/pwb/prop_photo/image/3/vzlptgtccsk2d2ewp4id.jpg +0 -0
- data/spec/dummy/public/uploads/pwb/prop_photo/image/4/mansion_bedroom.jpg +0 -0
- data/spec/dummy/public/uploads/pwb/prop_photo/image/4/xwayprwnmmmhrzrgwvch.jpg +0 -0
- data/spec/dummy/public/uploads/pwb/prop_photo/image/5/flat_window.jpg +0 -0
- data/spec/dummy/public/uploads/pwb/prop_photo/image/5/ilxn2u37bak0v60u6f8q.jpg +0 -0
- data/spec/dummy/public/uploads/pwb/prop_photo/image/6/kitchen_classic.jpg +0 -0
- data/spec/dummy/public/uploads/pwb/prop_photo/image/7/flat_balcony.jpg +0 -0
- data/spec/dummy/public/uploads/pwb/prop_photo/image/8/lounge_cosy.jpg +0 -0
- data/spec/factories/pwb_sections.rb +0 -4
- data/spec/models/pwb/section_spec.rb +0 -11
@@ -5,21 +5,21 @@ module Pwb
|
|
5
5
|
# protect_from_forgery with: :null_session
|
6
6
|
|
7
7
|
def update
|
8
|
-
|
9
|
-
if
|
10
|
-
|
8
|
+
website = Website.unique_instance
|
9
|
+
if website
|
10
|
+
website.update(website_params)
|
11
11
|
# http://patshaughnessy.net/2014/6/16/a-rule-of-thumb-for-strong-parameters
|
12
12
|
# adding :social_media to the list permitted by strong params does not work so doing below
|
13
13
|
# which is ugly but works
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
14
|
+
website.social_media = params[:website][:social_media]
|
15
|
+
website.style_variables = params[:website][:style_variables]
|
16
|
+
website.sale_price_options_from = params[:website][:sale_price_options_from]
|
17
|
+
website.sale_price_options_till = params[:website][:sale_price_options_till]
|
18
|
+
website.rent_price_options_from = params[:website][:rent_price_options_from]
|
19
|
+
website.rent_price_options_till = params[:website][:rent_price_options_till]
|
20
|
+
website.save!
|
21
21
|
end
|
22
|
-
render json:
|
22
|
+
render json: website
|
23
23
|
end
|
24
24
|
|
25
25
|
private
|
@@ -2,16 +2,17 @@ module Pwb
|
|
2
2
|
class ApplicationController < ActionController::Base
|
3
3
|
protect_from_forgery with: :exception
|
4
4
|
|
5
|
-
before_action :footer_content, :current_agency_and_website, :
|
6
|
-
|
5
|
+
before_action :footer_content, :current_agency_and_website, :nav_links,
|
6
|
+
:set_locale, :set_theme_path
|
7
7
|
|
8
8
|
def set_theme_path
|
9
9
|
theme_name = Website.unique_instance.theme_name
|
10
|
+
if params[:theme].present?
|
11
|
+
if %w( berlin default ).include? params[:theme]
|
12
|
+
theme_name = params[:theme]
|
13
|
+
end
|
14
|
+
end
|
10
15
|
theme_name = theme_name.present? ? theme_name : "default"
|
11
|
-
# || "default"
|
12
|
-
# if Agency.last && Agency.last.theme_name.present?
|
13
|
-
# theme_name = Agency.last.theme_name
|
14
|
-
# end
|
15
16
|
prepend_view_path "#{Pwb::Engine.root}/app/themes/#{theme_name}/views/"
|
16
17
|
# below allows themes installed in Rails app consuming Pwb to work
|
17
18
|
prepend_view_path "#{Rails.root}/app/themes/#{theme_name}/views/"
|
@@ -26,12 +27,13 @@ module Pwb
|
|
26
27
|
# if current_user
|
27
28
|
# locale = current_user.default_client_locale
|
28
29
|
# end
|
29
|
-
# byebug
|
30
30
|
if params[:locale] && (I18n.locale_available? params[:locale])
|
31
31
|
# passed in params override user's default
|
32
32
|
locale = params[:locale]
|
33
33
|
end
|
34
34
|
I18n.locale = locale.to_sym
|
35
|
+
|
36
|
+
# Globalize.fallbacks = {:de => [:en],:es => [:en], :ru => [:en]}
|
35
37
|
end
|
36
38
|
|
37
39
|
# http://www.rubydoc.info/github/plataformatec/devise/master/ActionDispatch/Routing/Mapper#devise_for-instance_method
|
@@ -44,7 +46,6 @@ module Pwb
|
|
44
46
|
|
45
47
|
def current_agency_and_website
|
46
48
|
@current_agency ||= Agency.unique_instance
|
47
|
-
# (Agency.last || Agency.create)
|
48
49
|
@current_website = Website.unique_instance
|
49
50
|
end
|
50
51
|
|
@@ -52,9 +53,19 @@ module Pwb
|
|
52
53
|
@footer_content = Content.find_by_key("footerInfo") || OpenStruct.new
|
53
54
|
end
|
54
55
|
|
55
|
-
def
|
56
|
-
@sections ||= Section.order("sort_order")
|
57
|
-
|
56
|
+
def nav_links
|
57
|
+
# @sections ||= Section.order("sort_order")
|
58
|
+
if current_user
|
59
|
+
# where user is signed in, special admin link is shown
|
60
|
+
# so no need to render standard one
|
61
|
+
@show_admin_link = false
|
62
|
+
else
|
63
|
+
@show_admin_link = false
|
64
|
+
top_nav_admin_link = Pwb::Link.find_by_slug("top_nav_admin")
|
65
|
+
if top_nav_admin_link && top_nav_admin_link.visible
|
66
|
+
@show_admin_link = true
|
67
|
+
end
|
68
|
+
end
|
58
69
|
end
|
59
70
|
end
|
60
71
|
end
|
@@ -1,55 +1,33 @@
|
|
1
1
|
require_dependency 'pwb/application_controller'
|
2
2
|
|
3
3
|
module Pwb
|
4
|
-
class
|
5
|
-
before_action :
|
6
|
-
|
7
|
-
def generic_page
|
8
|
-
page_slug = params[:page_slug]
|
9
|
-
section = Pwb::Section.find_by_link_path page_slug
|
10
|
-
@title_key = section.link_key
|
11
|
-
@page_title = I18n.t(section.link_key)
|
12
|
-
if section && section.contents.first
|
13
|
-
@content = section.contents.first
|
14
|
-
else
|
15
|
-
@content = OpenStruct.new
|
16
|
-
end
|
17
|
-
render "/pwb/sections/static"
|
18
|
-
end
|
19
|
-
|
20
|
-
def about_us
|
21
|
-
@content = Content.find_by_key("aboutUs")
|
22
|
-
@page_title = I18n.t("aboutUs")
|
23
|
-
@page_description = @content.present? ? @content.raw : ""
|
24
|
-
# @page_keywords = 'Site, Login, Members'
|
25
|
-
# @about_us_image_url = Content.get_photo_url_by_key("aboutUs")
|
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"
|
27
|
-
render "/pwb/sections/about_us"
|
28
|
-
end
|
4
|
+
class ContactUsController < ApplicationController
|
5
|
+
before_action :header_image_url
|
29
6
|
|
30
|
-
def privacy_policy
|
31
|
-
@title_key = "privacyPolicy"
|
32
|
-
@page_title = I18n.t("privacyPolicy")
|
33
|
-
@content = Content.find_by_key("privacyPolicy") || OpenStruct.new
|
34
|
-
render "/pwb/sections/static"
|
35
|
-
end
|
36
|
-
|
37
|
-
def legal
|
38
|
-
@title_key = "legalAdvice"
|
39
|
-
@page_title = I18n.t("legalAdvice")
|
40
|
-
@content = Content.find_by_key("legalAdvice") || OpenStruct.new
|
41
|
-
render "/pwb/sections/static"
|
42
|
-
end
|
43
7
|
|
44
|
-
def
|
8
|
+
def index
|
45
9
|
# below was for google map rendering via paloma:
|
46
10
|
# js current_agency_primary_address: @current_agency.primary_address
|
47
11
|
# js show_contact_map: @current_agency.show_contact_map
|
48
12
|
# could explicitly set function for Paloma to use like so:
|
49
13
|
# js "Pwb/Sections#contact_us"
|
50
14
|
# @enquiry = Message.new
|
51
|
-
@page_title = I18n.t("contactUs")
|
52
15
|
|
16
|
+
|
17
|
+
@content_to_show = []
|
18
|
+
@page = Pwb::Page.find_by_slug "contact-us"
|
19
|
+
@page_title = @current_agency.company_name
|
20
|
+
|
21
|
+
if @page.present?
|
22
|
+
if @page.page_title.present?
|
23
|
+
@page_title = @page.page_title + ' - ' + @current_agency.company_name.to_s
|
24
|
+
end
|
25
|
+
@page.ordered_visible_page_contents.each do |page_content|
|
26
|
+
@content_to_show.push page_content.get_html_or_page_part_key
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
# @page_title = I18n.t("contactUs")
|
53
31
|
@map_markers = []
|
54
32
|
if @current_agency.show_contact_map
|
55
33
|
@map_markers.push(
|
@@ -124,12 +102,13 @@ module Pwb
|
|
124
102
|
return render "pwb/ajax/contact_us_errors", layout: false
|
125
103
|
end
|
126
104
|
|
127
|
-
private
|
128
105
|
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
106
|
+
private
|
107
|
+
def header_image_url
|
108
|
+
# lc_content = Content.where(tag: 'landing-carousel')[0]
|
109
|
+
lc_photo = ContentPhoto.find_by_block_key "landing_img"
|
110
|
+
# used by berlin theme
|
111
|
+
@header_image_url = lc_photo.present? ? lc_photo.optimized_image_url : nil
|
133
112
|
end
|
134
113
|
|
135
114
|
end
|
@@ -1,10 +1,13 @@
|
|
1
1
|
module Pwb
|
2
2
|
class CssController < ActionController::Base
|
3
3
|
# renders a stylesheet with client configured variables
|
4
|
+
# - spt 2017 - currently only used by devise layout
|
5
|
+
# other layout directly render partial via helper method
|
4
6
|
def custom_css
|
7
|
+
@bg_style_vars = []
|
8
|
+
@text_color_style_vars = []
|
5
9
|
@current_website = Website.unique_instance
|
6
|
-
theme_name =
|
7
|
-
# @carousel_items = Content.where(tag: "landing-carousel").includes(:content_photos, :translations)
|
10
|
+
theme_name = params[:theme_name] || default
|
8
11
|
render "pwb/custom_css/#{theme_name}", formats: :css
|
9
12
|
end
|
10
13
|
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require_dependency 'pwb/application_controller'
|
2
|
+
|
3
|
+
module Pwb
|
4
|
+
class PagesController < ApplicationController
|
5
|
+
before_action :header_image_url
|
6
|
+
|
7
|
+
def show_page
|
8
|
+
default_page_slug = "home"
|
9
|
+
page_slug = params[:page_slug] || default_page_slug
|
10
|
+
@page = Pwb::Page.find_by_slug page_slug
|
11
|
+
if @page.blank?
|
12
|
+
@page = Pwb::Page.find_by_slug default_page_slug
|
13
|
+
end
|
14
|
+
@content_to_show = []
|
15
|
+
|
16
|
+
# @page.ordered_visible_contents.each do |page_content|
|
17
|
+
# above does not get ordered correctly
|
18
|
+
if @page.present?
|
19
|
+
@page.ordered_visible_page_contents.each do |page_content|
|
20
|
+
@content_to_show.push page_content.content.raw
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
render "/pwb/pages/show"
|
25
|
+
end
|
26
|
+
|
27
|
+
private
|
28
|
+
|
29
|
+
def header_image_url
|
30
|
+
# lc_content = Content.where(tag: 'landing-carousel')[0]
|
31
|
+
lc_photo = ContentPhoto.find_by_block_key "landing_img"
|
32
|
+
# used by berlin theme
|
33
|
+
@header_image_url = lc_photo.present? ? lc_photo.optimized_image_url : nil
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -2,7 +2,7 @@ require_dependency 'pwb/application_controller'
|
|
2
2
|
|
3
3
|
module Pwb
|
4
4
|
class SearchController < ApplicationController
|
5
|
-
before_action :
|
5
|
+
before_action :header_image_url
|
6
6
|
|
7
7
|
def search_ajax_for_sale
|
8
8
|
@operation_type = "for_sale"
|
@@ -31,7 +31,18 @@ module Pwb
|
|
31
31
|
|
32
32
|
# ordering of results happens client-side with paloma search.js
|
33
33
|
def buy
|
34
|
-
@
|
34
|
+
@page = Pwb::Page.find_by_slug "buy"
|
35
|
+
@page_title = @current_agency.company_name
|
36
|
+
# @content_to_show = []
|
37
|
+
if @page.present?
|
38
|
+
@page_title = @page.page_title + ' - ' + @current_agency.company_name
|
39
|
+
# TODO - allow addition of custom content
|
40
|
+
# @page.ordered_visible_page_contents.each do |page_content|
|
41
|
+
# @content_to_show.push page_content.content.raw
|
42
|
+
# end
|
43
|
+
end
|
44
|
+
|
45
|
+
# @page_title = I18n.t("searchForProperties")
|
35
46
|
# in erb template for this action, I have js that will render search_results template
|
36
47
|
# for properties - like search_ajax action does
|
37
48
|
@operation_type = "for_sale"
|
@@ -65,7 +76,17 @@ module Pwb
|
|
65
76
|
|
66
77
|
# TODO: - avoid duplication b/n rent and buy
|
67
78
|
def rent
|
68
|
-
@
|
79
|
+
@page = Pwb::Page.find_by_slug "rent"
|
80
|
+
@page_title = @current_agency.company_name
|
81
|
+
# @content_to_show = []
|
82
|
+
if @page.present?
|
83
|
+
@page_title = @page.page_title + ' - ' + @current_agency.company_name
|
84
|
+
# TODO - allow addition of custom content
|
85
|
+
# @page.ordered_visible_page_contents.each do |page_content|
|
86
|
+
# @content_to_show.push page_content.content.raw
|
87
|
+
# end
|
88
|
+
end
|
89
|
+
# @page_title = I18n.t("searchForProperties")
|
69
90
|
# in erb template for this action, I have js that will render search_results template
|
70
91
|
# for properties - like search_ajax action does
|
71
92
|
@operation_type = "for_rent"
|
@@ -212,16 +233,17 @@ module Pwb
|
|
212
233
|
# end
|
213
234
|
|
214
235
|
private
|
215
|
-
|
236
|
+
def header_image_url
|
237
|
+
# lc_content = Content.where(tag: 'landing-carousel')[0]
|
238
|
+
lc_photo = ContentPhoto.find_by_block_key "landing_img"
|
239
|
+
# used by berlin theme
|
240
|
+
@header_image_url = lc_photo.present? ? lc_photo.optimized_image_url : nil
|
241
|
+
end
|
242
|
+
|
243
|
+
# def header_image
|
216
244
|
# # used by berlin theme
|
217
245
|
# hi_content = Content.where(tag: 'landing-carousel')[0]
|
218
|
-
# @
|
246
|
+
# @header_image = hi_content.present? ? hi_content.default_photo : nil
|
219
247
|
# end
|
220
|
-
|
221
|
-
def header_image
|
222
|
-
# used by berlin theme
|
223
|
-
hi_content = Content.where(tag: 'landing-carousel')[0]
|
224
|
-
@header_image = hi_content.present? ? hi_content.default_photo : nil
|
225
|
-
end
|
226
248
|
end
|
227
249
|
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
require_dependency "pwb/application_controller"
|
2
|
+
|
3
|
+
module Pwb
|
4
|
+
class SquaresController < ActionController::Base
|
5
|
+
layout 'pwb/squares'
|
6
|
+
|
7
|
+
def show_prop
|
8
|
+
fb_instance_id = Rails.application.secrets.fb_instance_id
|
9
|
+
base_uri = "https://#{fb_instance_id}.firebaseio.com/"
|
10
|
+
firebase = Firebase::Client.new(base_uri)
|
11
|
+
@client_key = params["client_id"]
|
12
|
+
@prop_key = params["prop_id"]
|
13
|
+
response = firebase.get("props/" + @client_key + "/" + @prop_key )
|
14
|
+
|
15
|
+
@prop = response.body
|
16
|
+
# byebug
|
17
|
+
# push("todos", { :name => 'Pick the milk', :priority => 1 })
|
18
|
+
# response.success? # => true
|
19
|
+
# response.code # => 200
|
20
|
+
# response.body # => { 'name' => "-INOQPH-aV_psbk3ZXEX" }
|
21
|
+
# response.raw_body # => '{"name":"-INOQPH-aV_psbk3ZXEX"}'
|
22
|
+
|
23
|
+
render 'pwb/squares/show_prop'
|
24
|
+
end
|
25
|
+
|
26
|
+
def show_client
|
27
|
+
fb_instance_id = Rails.application.secrets.fb_instance_id
|
28
|
+
base_uri = "https://#{fb_instance_id}.firebaseio.com/"
|
29
|
+
firebase = Firebase::Client.new(base_uri)
|
30
|
+
@client_key = params["client_id"]
|
31
|
+
response = firebase.get("props/" + @client_key )
|
32
|
+
|
33
|
+
@props_hash = response.body
|
34
|
+
# byebug
|
35
|
+
# push("todos", { :name => 'Pick the milk', :priority => 1 })
|
36
|
+
# response.success? # => true
|
37
|
+
# response.code # => 200
|
38
|
+
# response.body # => { 'name' => "-INOQPH-aV_psbk3ZXEX" }
|
39
|
+
# response.raw_body # => '{"name":"-INOQPH-aV_psbk3ZXEX"}'
|
40
|
+
|
41
|
+
render 'pwb/squares/show_client'
|
42
|
+
end
|
43
|
+
|
44
|
+
private
|
45
|
+
|
46
|
+
|
47
|
+
end
|
48
|
+
end
|
@@ -2,12 +2,28 @@ require_dependency 'pwb/application_controller'
|
|
2
2
|
|
3
3
|
module Pwb
|
4
4
|
class WelcomeController < ApplicationController
|
5
|
+
before_action :header_image_url
|
6
|
+
|
5
7
|
def index
|
6
|
-
@
|
7
|
-
@
|
8
|
-
# .
|
9
|
-
@
|
10
|
-
|
8
|
+
@page = Pwb::Page.find_by_slug "home"
|
9
|
+
@page_title = @current_agency.company_name
|
10
|
+
# visible_page_fragment_names = @page.present? ? @page.details["visiblePageParts"] : []
|
11
|
+
@content_to_show = []
|
12
|
+
|
13
|
+
# @page.ordered_visible_contents.each do |page_content|
|
14
|
+
# above does not get ordered correctly
|
15
|
+
if @page.present?
|
16
|
+
if @page.page_title.present?
|
17
|
+
@page_title = @page.page_title + ' - ' + @current_agency.company_name.to_s
|
18
|
+
end
|
19
|
+
@page.ordered_visible_page_contents.each do |page_content|
|
20
|
+
@content_to_show.push page_content.content.raw
|
21
|
+
end
|
22
|
+
end
|
23
|
+
# @carousel_items = Content.where(tag: 'landing-carousel')
|
24
|
+
# @carousel_speed = 3000
|
25
|
+
# @content_area_cols = Content.where(tag: 'content-area-cols').order('sort_order')
|
26
|
+
|
11
27
|
@properties_for_sale = Prop.for_sale.visible.order('highlighted DESC').limit 9
|
12
28
|
@properties_for_rent = Prop.for_rent.visible.order('highlighted DESC').limit 9
|
13
29
|
|
@@ -15,5 +31,14 @@ module Pwb
|
|
15
31
|
|
16
32
|
render "pwb/welcome/index"
|
17
33
|
end
|
34
|
+
|
35
|
+
private
|
36
|
+
def header_image_url
|
37
|
+
# lc_content = Content.where(tag: 'landing-carousel')[0]
|
38
|
+
lc_photo = ContentPhoto.find_by_block_key "landing_img"
|
39
|
+
# used by berlin theme
|
40
|
+
@header_image_url = lc_photo.present? ? lc_photo.optimized_image_url : nil
|
41
|
+
end
|
42
|
+
|
18
43
|
end
|
19
44
|
end
|
@@ -56,57 +56,58 @@ module Pwb
|
|
56
56
|
end
|
57
57
|
end
|
58
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
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
end
|
59
|
+
# below replaced with methods in navigation_helper file (spt 2017)
|
60
|
+
# def top_nav_link(section_info)
|
61
|
+
# unless section_info.show_in_top_nav
|
62
|
+
# return
|
63
|
+
# end
|
64
|
+
# begin
|
65
|
+
# if section_info.is_page
|
66
|
+
# target_path = self.pwb.send("generic_page_path", section_info[:link_path], {locale: locale})
|
67
|
+
# else
|
68
|
+
|
69
|
+
# # link_path should be valid - below checks that
|
70
|
+
# target_path = self.pwb.send(section_info[:link_path], {locale: locale})
|
71
|
+
# # below works in most routes but had to change to above to support devise routes
|
72
|
+
# # target_path = send(section_info[:link_path], {locale: locale})
|
73
|
+
# end
|
74
|
+
# rescue NoMethodError
|
75
|
+
# # target_path = '/'
|
76
|
+
# # rescue Exception => e
|
77
|
+
# end
|
78
|
+
# # only show top_nav_link where link_path is valid
|
79
|
+
# if target_path
|
80
|
+
# style_class = 'selected active' if current_page?( target_path )
|
81
|
+
# html = <<-HTML
|
82
|
+
# <li class="#{style_class}">
|
83
|
+
# #{link_to I18n.t('navbar.'+section_info[:link_key]), target_path}
|
84
|
+
# </li>
|
85
|
+
# HTML
|
86
|
+
|
87
|
+
# html.html_safe
|
88
|
+
# end
|
89
|
+
# end
|
89
90
|
|
90
|
-
def footer_link(section_info)
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
91
|
+
# def footer_link(section_info, class_name="")
|
92
|
+
# unless section_info.show_in_footer
|
93
|
+
# return
|
94
|
+
# end
|
95
|
+
# begin
|
96
|
+
# if section_info.is_page
|
97
|
+
# target_path = self.pwb.send("generic_page_path", section_info[:link_path], {locale: locale})
|
98
|
+
# else
|
99
|
+
# target_path = self.pwb.send(section_info[:link_path], {locale: locale})
|
100
|
+
# end
|
101
|
+
# rescue NoMethodError
|
102
|
+
# end
|
102
103
|
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
end
|
104
|
+
# if target_path
|
105
|
+
# html = <<-HTML
|
106
|
+
# #{ link_to I18n.t('navbar.'+section_info[:link_key]), target_path, class: class_name}.
|
107
|
+
# HTML
|
108
|
+
# html.html_safe
|
109
|
+
# end
|
110
|
+
# end
|
110
111
|
|
111
112
|
# http://railscasts.com/episodes/75-complex-forms-part-3
|
112
113
|
def simple_inmo_input(f, field_key, placeholder_key, input_type, required)
|