pwb 1.0.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (367) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/app/assets/javascripts/comfy/admin/cms/custom.js.coffee +1 -0
  4. data/app/assets/stylesheets/comfy/admin/cms/custom.sass +1 -0
  5. data/app/assets/stylesheets/pwb/themes/berlin/inmo.scss +6 -1
  6. data/app/assets/stylesheets/pwb/themes/berlin/main.scss +12 -11
  7. data/app/assets/stylesheets/pwb/themes/default/shame.scss +1 -1
  8. data/app/controllers/pwb/admin_panel_controller.rb +2 -2
  9. data/app/controllers/pwb/api/v1/cms_pages_controller.rb +102 -0
  10. data/app/controllers/pwb/api/v1/website_controller.rb +7 -0
  11. data/app/controllers/pwb/api_public/v1/props_controller.rb +2 -2
  12. data/app/controllers/pwb/application_api_controller.rb +3 -7
  13. data/app/controllers/pwb/application_controller.rb +2 -3
  14. data/app/controllers/pwb/comfy_controller.rb +106 -0
  15. data/app/controllers/pwb/css_controller.rb +1 -2
  16. data/app/controllers/pwb/devise/registrations_controller.rb +2 -5
  17. data/app/controllers/pwb/devise_controller.rb +3 -8
  18. data/app/controllers/pwb/export/properties_controller.rb +5 -6
  19. data/app/controllers/pwb/export/translations_controller.rb +1 -5
  20. data/app/controllers/pwb/export/web_contents_controller.rb +1 -4
  21. data/app/controllers/pwb/export/website_controller.rb +0 -1
  22. data/app/controllers/pwb/import/mls_controller.rb +3 -6
  23. data/app/controllers/pwb/import/properties_controller.rb +2 -4
  24. data/app/controllers/pwb/import/scrapper_controller.rb +6 -9
  25. data/app/controllers/pwb/props_controller.rb +10 -13
  26. data/app/controllers/pwb/search_controller.rb +16 -16
  27. data/app/controllers/pwb/sections_controller.rb +21 -22
  28. data/app/controllers/pwb/welcome_controller.rb +1 -2
  29. data/app/helpers/pwb/application_helper.rb +37 -0
  30. data/app/helpers/pwb/css_helper.rb +9 -0
  31. data/app/models/pwb/cms_page_container.rb +9 -0
  32. data/app/models/pwb/content.rb +10 -6
  33. data/app/models/pwb/prop.rb +12 -4
  34. data/app/models/pwb/section.rb +1 -1
  35. data/app/models/pwb/website.rb +14 -1
  36. data/app/resources/pwb/api/v1/cms_block_resource.rb +11 -0
  37. data/app/resources/pwb/api/v1/cms_page_resource.rb +27 -0
  38. data/app/themes/berlin/views/layouts/pwb/application.html.erb +25 -9
  39. data/app/themes/berlin/views/pwb/props/show.html.erb +5 -5
  40. data/app/themes/berlin/views/pwb/search/_search_results.html.erb +2 -1
  41. data/app/themes/berlin/views/pwb/search/buy.html.erb +1 -1
  42. data/app/themes/berlin/views/pwb/search/rent.html.erb +2 -1
  43. data/app/themes/berlin/views/pwb/sections/about_us.html.erb +3 -2
  44. data/app/themes/berlin/views/pwb/sections/cms.html.erb +34 -0
  45. data/app/themes/berlin/views/pwb/sections/contact_us.html.erb +2 -1
  46. data/app/themes/berlin/views/pwb/welcome/_about_us_to_del.html.erb +35 -0
  47. data/app/themes/berlin/views/pwb/welcome/{_adv_search.html.erb → _adv_search_to_del.html.erb} +0 -0
  48. data/app/themes/berlin/views/pwb/welcome/_landing_carousel.html.erb +1 -1
  49. data/app/themes/berlin/views/pwb/welcome/_latest_properties.html.erb +2 -1
  50. data/app/themes/default/views/layouts/pwb/application.html.erb +24 -3
  51. data/app/themes/default/views/pwb/sections/about_us.html.erb +1 -2
  52. data/app/themes/default/views/pwb/sections/cms.html.erb +30 -0
  53. data/app/themes/default/views/pwb/welcome/_single_property_row.html.erb +2 -1
  54. data/app/themes/default/views/pwb/welcome/index.html.erb +3 -1
  55. data/app/views/layouts/pwb/devise.html.erb +1 -0
  56. data/app/views/pwb/_analytics.html.erb +15 -0
  57. data/app/views/pwb/_footer.html.erb +0 -12
  58. data/app/views/pwb/custom_css/{berlin.css.erb → _berlin.css.erb} +0 -1
  59. data/app/views/pwb/custom_css/{default.css.erb → _default.css.erb} +0 -1
  60. data/app/views/pwb/custom_css/_shared.css.erb +1 -0
  61. data/app/views/pwb/props/_images_section_carousel.html.erb +13 -27
  62. data/app/views/pwb/props/_prop_info_list.html.erb +1 -1
  63. data/app/views/pwb/search/_search_result_item.html.erb +62 -64
  64. data/app/views/pwb/search/_search_result_item_to_del.html.erb +3 -3
  65. data/config/client_setups/default.json +59 -21
  66. data/config/cms_page_containers/about-us.json +18 -0
  67. data/config/cms_page_containers/about.json +107 -0
  68. data/config/cms_page_containers/landing.json +19 -0
  69. data/config/cms_page_containers/legal.json +17 -0
  70. data/config/cms_page_containers/sell.json +96 -0
  71. data/config/initializers/cloudinary.rb +3 -0
  72. data/config/initializers/comfortable_mexican_sofa.rb +142 -0
  73. data/config/locales/admin.en.yml +213 -0
  74. data/config/locales/admin.es.yml +32 -17
  75. data/config/locales/admin.ru.yml +432 -0
  76. data/config/locales/admin.zh.yml.tmp +226 -0
  77. data/config/locales/de.yml +31 -32
  78. data/config/locales/devise.zh-HK.yml +119 -0
  79. data/config/locales/en.yml +3 -0
  80. data/config/locales/es.yml +3 -5
  81. data/config/locales/rails.zh-HK.yml +210 -0
  82. data/config/locales/ru.yml +11 -11
  83. data/config/locales/zh-HK.yml +154 -0
  84. data/config/routes.rb +17 -2
  85. data/db/cms_fixtures/cms/categories/pages.yml +3 -0
  86. data/db/cms_fixtures/cms/files/_rerenting-landing_framed.png.yml +6 -0
  87. data/{spec/dummy/public/system/comfy/cms/files/files/000/000/003/original → db/cms_fixtures/cms/files}/rerenting-landing_framed.png +0 -0
  88. data/db/cms_fixtures/cms/layouts/about-us/attributes.yml +4 -0
  89. data/db/cms_fixtures/cms/layouts/about-us/content.html +0 -0
  90. data/db/cms_fixtures/cms/layouts/about-us/javascript.js +0 -0
  91. data/db/cms_fixtures/cms/layouts/about-us/people/attributes.yml +4 -0
  92. data/db/cms_fixtures/cms/layouts/about-us/people/content.html +55 -0
  93. data/db/cms_fixtures/cms/layouts/about-us/services/attributes.yml +4 -0
  94. data/db/cms_fixtures/cms/layouts/about-us/services/content.html +32 -0
  95. data/db/cms_fixtures/cms/layouts/about-us/services/javascript.js +0 -0
  96. data/db/cms_fixtures/cms/layouts/about-us/services/stylesheet.css +0 -0
  97. data/db/cms_fixtures/cms/layouts/about-us/stylesheet.css +0 -0
  98. data/db/cms_fixtures/cms/layouts/default-layout/attributes.yml +4 -0
  99. data/db/cms_fixtures/cms/layouts/default-layout/content.html +51 -0
  100. data/db/cms_fixtures/cms/layouts/default-layout/javascript.js +0 -0
  101. data/db/cms_fixtures/cms/layouts/default-layout/stylesheet.css +0 -0
  102. data/db/cms_fixtures/cms/pages/index/about-us/attributes.yml +8 -0
  103. data/db/cms_fixtures/cms/pages/index/about-us/people/attributes.yml +8 -0
  104. data/db/cms_fixtures/cms/pages/index/about-us/people/de/attributes.yml +8 -0
  105. data/db/cms_fixtures/cms/pages/index/about-us/people/de/person_details_a.html +1 -0
  106. data/db/cms_fixtures/cms/pages/index/about-us/people/de/person_details_b.html +1 -0
  107. data/db/cms_fixtures/cms/pages/index/about-us/people/de/person_details_c.html +1 -0
  108. data/db/cms_fixtures/cms/pages/index/about-us/people/de/person_details_d.html +1 -0
  109. data/db/cms_fixtures/cms/pages/index/about-us/people/de/person_img_url_a.html +1 -0
  110. data/db/cms_fixtures/cms/pages/index/about-us/people/de/person_img_url_b.html +1 -0
  111. data/db/cms_fixtures/cms/pages/index/about-us/people/de/person_img_url_c.html +1 -0
  112. data/db/cms_fixtures/cms/pages/index/about-us/people/de/person_img_url_d.html +1 -0
  113. data/db/cms_fixtures/cms/pages/index/about-us/people/de/person_name_a.html +1 -0
  114. data/db/cms_fixtures/cms/pages/index/about-us/people/de/person_name_b.html +1 -0
  115. data/db/cms_fixtures/cms/pages/index/about-us/people/de/person_name_c.html +1 -0
  116. data/db/cms_fixtures/cms/pages/index/about-us/people/de/person_name_d.html +1 -0
  117. data/db/cms_fixtures/cms/pages/index/about-us/people/de/person_title_a.html +1 -0
  118. data/db/cms_fixtures/cms/pages/index/about-us/people/de/person_title_b.html +1 -0
  119. data/db/cms_fixtures/cms/pages/index/about-us/people/de/person_title_c.html +1 -0
  120. data/db/cms_fixtures/cms/pages/index/about-us/people/de/person_title_d.html +1 -0
  121. data/db/cms_fixtures/cms/pages/index/about-us/people/en/attributes.yml +8 -0
  122. data/db/cms_fixtures/cms/pages/index/about-us/people/en/person_details_a.html +1 -0
  123. data/db/cms_fixtures/cms/pages/index/about-us/people/en/person_details_b.html +1 -0
  124. data/db/cms_fixtures/cms/pages/index/about-us/people/en/person_details_c.html +1 -0
  125. data/db/cms_fixtures/cms/pages/index/about-us/people/en/person_details_d.html +1 -0
  126. data/db/cms_fixtures/cms/pages/index/about-us/people/en/person_img_url_a.html +1 -0
  127. data/db/cms_fixtures/cms/pages/index/about-us/people/en/person_img_url_b.html +1 -0
  128. data/db/cms_fixtures/cms/pages/index/about-us/people/en/person_img_url_c.html +1 -0
  129. data/db/cms_fixtures/cms/pages/index/about-us/people/en/person_img_url_d.html +1 -0
  130. data/db/cms_fixtures/cms/pages/index/about-us/people/en/person_name_a.html +1 -0
  131. data/db/cms_fixtures/cms/pages/index/about-us/people/en/person_name_b.html +1 -0
  132. data/db/cms_fixtures/cms/pages/index/about-us/people/en/person_name_c.html +1 -0
  133. data/db/cms_fixtures/cms/pages/index/about-us/people/en/person_name_d.html +1 -0
  134. data/db/cms_fixtures/cms/pages/index/about-us/people/en/person_title_a.html +1 -0
  135. data/db/cms_fixtures/cms/pages/index/about-us/people/en/person_title_b.html +1 -0
  136. data/db/cms_fixtures/cms/pages/index/about-us/people/en/person_title_c.html +1 -0
  137. data/db/cms_fixtures/cms/pages/index/about-us/people/en/person_title_d.html +1 -0
  138. data/db/cms_fixtures/cms/pages/index/about-us/people/es/attributes.yml +8 -0
  139. data/db/cms_fixtures/cms/pages/index/about-us/people/es/person_details_a.html +1 -0
  140. data/db/cms_fixtures/cms/pages/index/about-us/people/es/person_details_b.html +1 -0
  141. data/db/cms_fixtures/cms/pages/index/about-us/people/es/person_details_c.html +1 -0
  142. data/db/cms_fixtures/cms/pages/index/about-us/people/es/person_details_d.html +1 -0
  143. data/db/cms_fixtures/cms/pages/index/about-us/people/es/person_img_url_a.html +1 -0
  144. data/db/cms_fixtures/cms/pages/index/about-us/people/es/person_img_url_b.html +1 -0
  145. data/db/cms_fixtures/cms/pages/index/about-us/people/es/person_img_url_c.html +1 -0
  146. data/db/cms_fixtures/cms/pages/index/about-us/people/es/person_img_url_d.html +1 -0
  147. data/db/cms_fixtures/cms/pages/index/about-us/people/es/person_name_a.html +1 -0
  148. data/db/cms_fixtures/cms/pages/index/about-us/people/es/person_name_b.html +1 -0
  149. data/db/cms_fixtures/cms/pages/index/about-us/people/es/person_name_c.html +1 -0
  150. data/db/cms_fixtures/cms/pages/index/about-us/people/es/person_name_d.html +1 -0
  151. data/db/cms_fixtures/cms/pages/index/about-us/people/es/person_title_a.html +1 -0
  152. data/db/cms_fixtures/cms/pages/index/about-us/people/es/person_title_b.html +1 -0
  153. data/db/cms_fixtures/cms/pages/index/about-us/people/es/person_title_c.html +1 -0
  154. data/db/cms_fixtures/cms/pages/index/about-us/people/es/person_title_d.html +1 -0
  155. data/db/cms_fixtures/cms/pages/index/about-us/people/pt/attributes.yml +8 -0
  156. data/db/cms_fixtures/cms/pages/index/about-us/people/pt/person_details_a.html +1 -0
  157. data/db/cms_fixtures/cms/pages/index/about-us/people/pt/person_details_b.html +1 -0
  158. data/db/cms_fixtures/cms/pages/index/about-us/people/pt/person_details_c.html +1 -0
  159. data/db/cms_fixtures/cms/pages/index/about-us/people/pt/person_details_d.html +1 -0
  160. data/db/cms_fixtures/cms/pages/index/about-us/people/pt/person_name_a.html +1 -0
  161. data/db/cms_fixtures/cms/pages/index/about-us/people/pt/person_name_b.html +1 -0
  162. data/db/cms_fixtures/cms/pages/index/about-us/people/pt/person_name_c.html +1 -0
  163. data/db/cms_fixtures/cms/pages/index/about-us/people/pt/person_name_d.html +1 -0
  164. data/db/cms_fixtures/cms/pages/index/about-us/people/pt/person_title_a.html +1 -0
  165. data/db/cms_fixtures/cms/pages/index/about-us/people/pt/person_title_b.html +1 -0
  166. data/db/cms_fixtures/cms/pages/index/about-us/people/pt/person_title_c.html +1 -0
  167. data/db/cms_fixtures/cms/pages/index/about-us/people/pt/person_title_d.html +1 -0
  168. data/db/cms_fixtures/cms/pages/index/about-us/people/ru/attributes.yml +8 -0
  169. data/db/cms_fixtures/cms/pages/index/about-us/people/ru/person_details_a.html +1 -0
  170. data/db/cms_fixtures/cms/pages/index/about-us/people/ru/person_details_b.html +1 -0
  171. data/db/cms_fixtures/cms/pages/index/about-us/people/ru/person_details_c.html +1 -0
  172. data/db/cms_fixtures/cms/pages/index/about-us/people/ru/person_details_d.html +1 -0
  173. data/db/cms_fixtures/cms/pages/index/about-us/people/ru/person_img_url_a.html +1 -0
  174. data/db/cms_fixtures/cms/pages/index/about-us/people/ru/person_img_url_b.html +1 -0
  175. data/db/cms_fixtures/cms/pages/index/about-us/people/ru/person_img_url_c.html +1 -0
  176. data/db/cms_fixtures/cms/pages/index/about-us/people/ru/person_img_url_d.html +1 -0
  177. data/db/cms_fixtures/cms/pages/index/about-us/people/ru/person_name_a.html +1 -0
  178. data/db/cms_fixtures/cms/pages/index/about-us/people/ru/person_name_b.html +1 -0
  179. data/db/cms_fixtures/cms/pages/index/about-us/people/ru/person_name_c.html +1 -0
  180. data/db/cms_fixtures/cms/pages/index/about-us/people/ru/person_name_d.html +1 -0
  181. data/db/cms_fixtures/cms/pages/index/about-us/people/ru/person_title_a.html +1 -0
  182. data/db/cms_fixtures/cms/pages/index/about-us/people/ru/person_title_b.html +1 -0
  183. data/db/cms_fixtures/cms/pages/index/about-us/people/ru/person_title_c.html +1 -0
  184. data/db/cms_fixtures/cms/pages/index/about-us/people/ru/person_title_d.html +1 -0
  185. data/db/cms_fixtures/cms/pages/index/about-us/services/attributes.yml +8 -0
  186. data/db/cms_fixtures/cms/pages/index/about-us/services/content_a.html +1 -0
  187. data/db/cms_fixtures/cms/pages/index/about-us/services/content_b.html +0 -0
  188. data/db/cms_fixtures/cms/pages/index/about-us/services/content_c.html +0 -0
  189. data/db/cms_fixtures/cms/pages/index/about-us/services/de/attributes.yml +8 -0
  190. data/db/cms_fixtures/cms/pages/index/about-us/services/de/content_a.html +1 -0
  191. data/db/cms_fixtures/cms/pages/index/about-us/services/de/content_b.html +1 -0
  192. data/db/cms_fixtures/cms/pages/index/about-us/services/de/content_c.html +1 -0
  193. data/db/cms_fixtures/cms/pages/index/about-us/services/de/title_a.html +1 -0
  194. data/db/cms_fixtures/cms/pages/index/about-us/services/de/title_b.html +1 -0
  195. data/db/cms_fixtures/cms/pages/index/about-us/services/de/title_c.html +1 -0
  196. data/db/cms_fixtures/cms/pages/index/about-us/services/en/attributes.yml +8 -0
  197. data/db/cms_fixtures/cms/pages/index/about-us/services/en/content_a.html +1 -0
  198. data/db/cms_fixtures/cms/pages/index/about-us/services/en/content_b.html +1 -0
  199. data/db/cms_fixtures/cms/pages/index/about-us/services/en/content_c.html +1 -0
  200. data/db/cms_fixtures/cms/pages/index/about-us/services/en/title_a.html +1 -0
  201. data/db/cms_fixtures/cms/pages/index/about-us/services/en/title_b.html +1 -0
  202. data/db/cms_fixtures/cms/pages/index/about-us/services/en/title_c.html +1 -0
  203. data/db/cms_fixtures/cms/pages/index/about-us/services/es/attributes.yml +8 -0
  204. data/db/cms_fixtures/cms/pages/index/about-us/services/es/content_a.html +1 -0
  205. data/db/cms_fixtures/cms/pages/index/about-us/services/es/content_b.html +1 -0
  206. data/db/cms_fixtures/cms/pages/index/about-us/services/es/content_c.html +1 -0
  207. data/db/cms_fixtures/cms/pages/index/about-us/services/es/title_a.html +1 -0
  208. data/db/cms_fixtures/cms/pages/index/about-us/services/es/title_b.html +1 -0
  209. data/db/cms_fixtures/cms/pages/index/about-us/services/es/title_c.html +1 -0
  210. data/db/cms_fixtures/cms/pages/index/about-us/services/title_a.html +1 -0
  211. data/db/cms_fixtures/cms/pages/index/about-us/services/title_b.html +0 -0
  212. data/db/cms_fixtures/cms/pages/index/about-us/services/title_c.html +0 -0
  213. data/db/cms_fixtures/cms/pages/index/attributes.yml +8 -0
  214. data/db/cms_fixtures/cms/pages/index/content.html +1 -0
  215. data/db/cms_fixtures/cms/pages/index/title.html +0 -0
  216. data/db/cms_fixtures/cms/snippets/snippet1/attributes.yml +3 -0
  217. data/db/cms_fixtures/cms/snippets/snippet1/content.html +1 -0
  218. data/db/cms_fixtures/sample-site/categories/files.yml +1 -0
  219. data/db/cms_fixtures/sample-site/categories/pages.yml +1 -0
  220. data/db/cms_fixtures/sample-site/categories/snippets.yml +1 -0
  221. data/db/cms_fixtures/sample-site/files/_sample.jpg.yml +5 -0
  222. data/db/cms_fixtures/sample-site/files/sample.jpg +0 -0
  223. data/db/cms_fixtures/sample-site/layouts/default/attributes.yml +1 -0
  224. data/db/cms_fixtures/sample-site/layouts/default/content.html +5 -0
  225. data/db/cms_fixtures/sample-site/layouts/default/javascript.js +1 -0
  226. data/db/cms_fixtures/sample-site/layouts/default/nested/attributes.yml +2 -0
  227. data/db/cms_fixtures/sample-site/layouts/default/nested/content.haml +3 -0
  228. data/db/cms_fixtures/sample-site/layouts/default/nested/javascript.js +1 -0
  229. data/db/cms_fixtures/sample-site/layouts/default/nested/stylesheet.css +1 -0
  230. data/db/cms_fixtures/sample-site/layouts/default/stylesheet.css +1 -0
  231. data/db/cms_fixtures/sample-site/pages/index/attributes.yml +6 -0
  232. data/db/cms_fixtures/sample-site/pages/index/child/attributes.yml +3 -0
  233. data/db/cms_fixtures/sample-site/pages/index/child/left.haml +1 -0
  234. data/db/cms_fixtures/sample-site/pages/index/child/right.html +1 -0
  235. data/db/cms_fixtures/sample-site/pages/index/child/thumbnail.png +0 -0
  236. data/db/cms_fixtures/sample-site/pages/index/content.html +2 -0
  237. data/db/cms_fixtures/sample-site/snippets/default/attributes.yml +4 -0
  238. data/db/cms_fixtures/sample-site/snippets/default/content.html +1 -0
  239. data/db/migrate/20170513221300_create_cms.rb +133 -0
  240. data/db/seeds/spain/translations.rb +2 -2
  241. data/db/seeds/translations_ca.rb +92 -0
  242. data/db/seeds/translations_de.rb +86 -85
  243. data/db/seeds/translations_en.rb +73 -73
  244. data/db/seeds/translations_es.rb +79 -78
  245. data/db/seeds/translations_ru.rb +92 -0
  246. data/db/yml_seeds/prop/flat_for_rent.yml +4 -4
  247. data/db/yml_seeds/sections.yml +2 -2
  248. data/db/yml_seeds/website.yml +3 -1
  249. data/lib/pwb/cms_data_loader.rb +38 -0
  250. data/lib/pwb/engine.rb +1 -0
  251. data/lib/pwb/locale_loader.rb +47 -0
  252. data/lib/pwb/seeder.rb +8 -5
  253. data/lib/pwb/version.rb +1 -1
  254. data/lib/tasks/pwb_tasks.rake +1 -0
  255. data/spec/dummy/config/routes.rb +5 -0
  256. data/spec/dummy/config/secrets.yml +5 -0
  257. data/spec/dummy/db/schema.rb +111 -1
  258. data/spec/dummy/log/development.log +0 -0
  259. data/spec/features/pwb/admin_spec.rb +14 -40
  260. data/spec/features/pwb/admin_spec_tmp.rb +54 -0
  261. data/spec/fixtures/to_import/pwb-properties.csv +2 -2
  262. data/spec/views/pwb/application_layout.html.erb_spec.rb +1 -0
  263. metadata +207 -235
  264. data/app/themes/berlin/views/pwb/welcome/_about_us.html.erb +0 -36
  265. data/db/seeds/translations_others.rb +0 -215
  266. data/spec/dummy/public/assets/application-af04b226fd7202dfc532ce7aedb95a0128277937e90d3b3a3d35e1cce9e16886.css +0 -16
  267. data/spec/dummy/public/assets/application-af04b226fd7202dfc532ce7aedb95a0128277937e90d3b3a3d35e1cce9e16886.css.gz +0 -0
  268. data/spec/dummy/public/assets/application-ec8550e416fd8df1557ddb7f132ccd38baaafd36e4c5c9aff8420fbd47c0313f.js +0 -617
  269. data/spec/dummy/public/assets/application-ec8550e416fd8df1557ddb7f132ccd38baaafd36e4c5c9aff8420fbd47c0313f.js.gz +0 -0
  270. data/spec/dummy/public/assets/bootstrap/glyphicons-halflings-regular-13634da87d9e23f8c3ed9108ce1724d183a39ad072e73e1b3d8cbf646d2d0407.eot +0 -0
  271. data/spec/dummy/public/assets/bootstrap/glyphicons-halflings-regular-13634da87d9e23f8c3ed9108ce1724d183a39ad072e73e1b3d8cbf646d2d0407.eot.gz +0 -0
  272. data/spec/dummy/public/assets/bootstrap/glyphicons-halflings-regular-42f60659d265c1a3c30f9fa42abcbb56bd4a53af4d83d316d6dd7a36903c43e5.svg +0 -288
  273. data/spec/dummy/public/assets/bootstrap/glyphicons-halflings-regular-42f60659d265c1a3c30f9fa42abcbb56bd4a53af4d83d316d6dd7a36903c43e5.svg.gz +0 -0
  274. data/spec/dummy/public/assets/bootstrap/glyphicons-halflings-regular-a26394f7ede100ca118eff2eda08596275a9839b959c226e15439557a5a80742.woff +0 -0
  275. data/spec/dummy/public/assets/bootstrap/glyphicons-halflings-regular-e395044093757d82afcb138957d06a1ea9361bdcf0b442d06a18a8051af57456.ttf +0 -0
  276. data/spec/dummy/public/assets/bootstrap/glyphicons-halflings-regular-e395044093757d82afcb138957d06a1ea9361bdcf0b442d06a18a8051af57456.ttf.gz +0 -0
  277. data/spec/dummy/public/assets/bootstrap/glyphicons-halflings-regular-fe185d11a49676890d47bb783312a0cda5a44c4039214094e7957b4c040ef11c.woff2 +0 -0
  278. data/spec/dummy/public/assets/pwb/application-0dc6ff845cde8e032ed365593c17fe09c18a6966d44f551946bf1673d8d1ac51.css +0 -13
  279. data/spec/dummy/public/assets/pwb/application-0dc6ff845cde8e032ed365593c17fe09c18a6966d44f551946bf1673d8d1ac51.css.gz +0 -0
  280. data/spec/dummy/public/assets/pwb/application-b4df8e7ae7700a0d09d88175af77e7f457ca2fbe15ae08450551ebf3bfb0c4d1.js +0 -15656
  281. data/spec/dummy/public/assets/pwb/application-b4df8e7ae7700a0d09d88175af77e7f457ca2fbe15ae08450551ebf3bfb0c4d1.js.gz +0 -0
  282. data/spec/dummy/public/assets/pwb/themes/berlin-279c2e3a7fa11a902fdee83a6819dcc315ff8eb240cfad21b1322cedadb07ea7.js +0 -18690
  283. data/spec/dummy/public/assets/pwb/themes/berlin-279c2e3a7fa11a902fdee83a6819dcc315ff8eb240cfad21b1322cedadb07ea7.js.gz +0 -0
  284. data/spec/dummy/public/assets/pwb/themes/berlin-8038d5cfd670e73fbffb581f6bb8d8c00ac448957945622c5c34438c467d218b.css +0 -8582
  285. data/spec/dummy/public/assets/pwb/themes/berlin-8038d5cfd670e73fbffb581f6bb8d8c00ac448957945622c5c34438c467d218b.css.gz +0 -0
  286. data/spec/dummy/public/assets/pwb/themes/chic-facdff61de4827adfd797b6a36ffd6c8b432072df7190ed722d039f971caa539.css +0 -3500
  287. data/spec/dummy/public/assets/pwb/themes/chic-facdff61de4827adfd797b6a36ffd6c8b432072df7190ed722d039f971caa539.css.gz +0 -0
  288. data/spec/dummy/public/assets/pwb/themes/default-d697fb0c278f500986e614ddd7eb41fd7db502a54f3370b3e8166cc1714509d0.css +0 -8423
  289. data/spec/dummy/public/assets/pwb/themes/default-d697fb0c278f500986e614ddd7eb41fd7db502a54f3370b3e8166cc1714509d0.css.gz +0 -0
  290. data/spec/dummy/public/assets/pwb_admin_panel/application-2d624898965d7a347eb7f365feab34257032c25051633370811ed7dfd24d7c8c.js +0 -61
  291. data/spec/dummy/public/assets/pwb_admin_panel/application-2d624898965d7a347eb7f365feab34257032c25051633370811ed7dfd24d7c8c.js.gz +0 -0
  292. data/spec/dummy/public/assets/pwb_admin_panel/application-f0e38d58d1ce32501b22edd16697f45b561fa44b5be9265398a05e8dee169885.css +0 -17970
  293. data/spec/dummy/public/assets/pwb_admin_panel/application-f0e38d58d1ce32501b22edd16697f45b561fa44b5be9265398a05e8dee169885.css.gz +0 -0
  294. data/spec/dummy/public/img/about-us.png +0 -0
  295. data/spec/dummy/public/img/agents/agent-1.png +0 -0
  296. data/spec/dummy/public/img/agents/agent-3.png +0 -0
  297. data/spec/dummy/public/img/agents/agent-4.png +0 -0
  298. data/spec/dummy/public/img/agents/agent-5.png +0 -0
  299. data/spec/dummy/public/img/banner-ads.jpg +0 -0
  300. data/spec/dummy/public/img/blog-img-1.jpg +0 -0
  301. data/spec/dummy/public/img/blog-img-2.jpg +0 -0
  302. data/spec/dummy/public/img/blog-img-3.jpg +0 -0
  303. data/spec/dummy/public/img/client-brand-1.png +0 -0
  304. data/spec/dummy/public/img/client-brand-2.png +0 -0
  305. data/spec/dummy/public/img/client-brand-3.png +0 -0
  306. data/spec/dummy/public/img/client-brand-4.png +0 -0
  307. data/spec/dummy/public/img/client-brand-5.png +0 -0
  308. data/spec/dummy/public/img/favicon.ico +0 -0
  309. data/spec/dummy/public/img/gallery/big/1.jpg +0 -0
  310. data/spec/dummy/public/img/gallery/big/10.jpg +0 -0
  311. data/spec/dummy/public/img/gallery/big/11 - Copy.jpg +0 -0
  312. data/spec/dummy/public/img/gallery/big/12.jpg +0 -0
  313. data/spec/dummy/public/img/gallery/big/2.jpg +0 -0
  314. data/spec/dummy/public/img/gallery/big/3.jpg +0 -0
  315. data/spec/dummy/public/img/gallery/big/4.jpg +0 -0
  316. data/spec/dummy/public/img/gallery/big/5.jpg +0 -0
  317. data/spec/dummy/public/img/gallery/big/6.jpg +0 -0
  318. data/spec/dummy/public/img/gallery/big/7.jpg +0 -0
  319. data/spec/dummy/public/img/gallery/big/8.jpg +0 -0
  320. data/spec/dummy/public/img/gallery/big/9.jpg +0 -0
  321. data/spec/dummy/public/img/gallery/fancybox_buttons.png +0 -0
  322. data/spec/dummy/public/img/gallery/fancybox_loading.gif +0 -0
  323. data/spec/dummy/public/img/gallery/fancybox_loading@2x.gif +0 -0
  324. data/spec/dummy/public/img/gallery/fancybox_overlay.png +0 -0
  325. data/spec/dummy/public/img/gallery/fancybox_sprite.png +0 -0
  326. data/spec/dummy/public/img/gallery/fancybox_sprite@2x.png +0 -0
  327. data/spec/dummy/public/img/gallery/small/1.jpg +0 -0
  328. data/spec/dummy/public/img/gallery/small/10.jpg +0 -0
  329. data/spec/dummy/public/img/gallery/small/11.jpg +0 -0
  330. data/spec/dummy/public/img/gallery/small/12.jpg +0 -0
  331. data/spec/dummy/public/img/gallery/small/2.jpg +0 -0
  332. data/spec/dummy/public/img/gallery/small/3.jpg +0 -0
  333. data/spec/dummy/public/img/gallery/small/4.jpg +0 -0
  334. data/spec/dummy/public/img/gallery/small/5.jpg +0 -0
  335. data/spec/dummy/public/img/gallery/small/6.jpg +0 -0
  336. data/spec/dummy/public/img/gallery/small/7.jpg +0 -0
  337. data/spec/dummy/public/img/gallery/small/8.jpg +0 -0
  338. data/spec/dummy/public/img/gallery/small/9.jpg +0 -0
  339. data/spec/dummy/public/img/item/1.jpg +0 -0
  340. data/spec/dummy/public/img/item/2.jpg +0 -0
  341. data/spec/dummy/public/img/item/3.jpg +0 -0
  342. data/spec/dummy/public/img/item/4.jpg +0 -0
  343. data/spec/dummy/public/img/item/5.jpg +0 -0
  344. data/spec/dummy/public/img/item/6.jpg +0 -0
  345. data/spec/dummy/public/img/logo.png +0 -0
  346. data/spec/dummy/public/img/promo-banner.jpg +0 -0
  347. data/spec/dummy/public/img/property-header-bg.jpg +0 -0
  348. data/spec/dummy/public/img/property-view-2.jpg +0 -0
  349. data/spec/dummy/public/img/signin-bg.jpg +0 -0
  350. data/spec/dummy/public/img/slider/1.jpg +0 -0
  351. data/spec/dummy/public/img/slider/2.jpg +0 -0
  352. data/spec/dummy/public/img/slider/3.jpg +0 -0
  353. data/spec/dummy/public/img/slider/4.jpg +0 -0
  354. data/spec/dummy/public/img/slider/5.jpg +0 -0
  355. data/spec/dummy/public/img/slider/6.jpg +0 -0
  356. data/spec/dummy/public/img/testimonial-1.png +0 -0
  357. data/spec/dummy/public/img/testimonial-2.png +0 -0
  358. data/spec/dummy/public/img/testimonial-3.png +0 -0
  359. data/spec/dummy/public/img/testimonial-bg.jpg +0 -0
  360. data/spec/dummy/public/js/bootstrap.js +0 -2363
  361. data/spec/dummy/public/js/custom.js +0 -355
  362. data/spec/dummy/public/js/jquery.fancybox.pack.js +0 -46
  363. data/spec/dummy/public/js/jquery.min.js +0 -5
  364. data/spec/dummy/public/js/jquery.mixitup.js +0 -2098
  365. data/spec/dummy/public/js/nouislider.js +0 -1899
  366. data/spec/dummy/public/js/slick.js +0 -2670
  367. 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
- return render "pwb/custom_css/#{theme_name}", formats: :css
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
- return render "/devise/registrations/edit_success"
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(resource)
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(resource_or_scope)
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
- def after_sign_in_path_for(resource_or_scope)
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
- :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]
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
@@ -6,6 +6,5 @@ module Pwb
6
6
  headers['Content-Type'] ||= 'text/csv'
7
7
  render "all.csv"
8
8
  end
9
-
10
9
  end
11
10
  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: { :error => "Please provide #{param_name}."}, :status => 422
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
- return render json: retrieved_properties
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
- return render json: {
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
- return render json: {
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: { :error => "Please provide url."}, :status => 422
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
- return render json: retrieved_properties
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: { :error => "Please provide url."}, :status => 422
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
- return render json: retrieved_properties
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 :property_details => @property_details
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 :property_details => @property_details
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
- # origin_email: params[:contact][:email]
72
+ # origin_email: params[:contact][:email]
74
73
  })
75
74
 
76
75
  unless @enquiry.save && @client.save
77
- @error_messages = @error_messages + @client.errors.full_messages
78
- @error_messages = @error_messages + @enquiry.errors.full_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 = [ I18n.t("contact.error"), e ]
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
- # %W(#{''} 25,000 50,000 75,000 100,000 150,000 250,000 500,000 1,000,000 2,000,000 5,000,000 )
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
- return render "/pwb/search/buy"
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
- return render "/pwb/search/rent"
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 search_filtering_params
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) || (value.empty?)
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 = Money::Currency.find currency_string
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 header_image_url
189
+ def header_image
187
190
  # used by berlin theme
188
191
  hi_content = Content.where(tag: 'landing-carousel')[0]
189
- @header_image_url = hi_content.present? ? hi_content.default_photo_url : ""
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
- return render "/pwb/sections/static"
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
- return render "/pwb/sections/about_us"
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
- return render "/pwb/sections/static"
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
- return render "/pwb/sections/static"
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 :current_agency_primary_address => @current_agency.primary_address
49
- js :show_contact_map => @current_agency.show_contact_map
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
- return render "/pwb/sections/contact_us"
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
- # origin_email: params[:contact][:email]
81
- })
78
+ # origin_email: params[:contact][:email]
79
+ }
80
+ )
82
81
  unless @enquiry.save && @client.save
83
- @error_messages = @error_messages + @client.errors.full_messages
84
- @error_messages = @error_messages + @enquiry.errors.full_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 = [ I18n.t("contact.error"), e ]
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 header_image_url
112
+ def header_image
114
113
  # used by berlin theme
115
- @header_image_url = Content.where(tag: 'landing-carousel')[0].default_photo_url
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