diff --git a/app/assets/images/space-p1.png b/app/assets/images/space-p1.png new file mode 100644 index 0000000..cbce3a9 Binary files /dev/null and b/app/assets/images/space-p1.png differ diff --git a/app/assets/images/space-p2.png b/app/assets/images/space-p2.png new file mode 100644 index 0000000..c3541c0 Binary files /dev/null and b/app/assets/images/space-p2.png differ diff --git a/app/assets/stylesheets/space-frontend.scss b/app/assets/stylesheets/space-frontend.scss index 537dee1..dbf57ba 100644 --- a/app/assets/stylesheets/space-frontend.scss +++ b/app/assets/stylesheets/space-frontend.scss @@ -4,7 +4,19 @@ .overlay { position: absolute; } - +.s-space.show-space .selection-box-label.absolute-center{ + display: none; +} +.s-space.show-space .selection-box-label.absolute-center.active{ + display: block; + position: absolute; + bottom: 110%; + left: 100%; + background: #2196F3; + color: white; + width: 150%; + padding: 0.2em; +} #full-layout-canvas { text-align: center; position: relative; diff --git a/app/controllers/spaces_controller.rb b/app/controllers/spaces_controller.rb index 073fd72..58208e2 100644 --- a/app/controllers/spaces_controller.rb +++ b/app/controllers/spaces_controller.rb @@ -1,120 +1,120 @@ class SpacesController < ApplicationController - def index - params = OrbitHelper.params - page = Page.where(:page_id => params[:page_id]).first - buildings = Building.filter_by_categories.collect do |building| - floors = building.floors.desc(:title).collect do |floor| - image = (!floor.frontend_image.thumb.url.nil? ? floor.frontend_image.thumb.url : "/assets/default-floor.jpg") - link = floor.layout.nil? ? (floor.floor_units.empty? ? "#" : "/#{I18n.locale.to_s}#{page.url}/#{floor.floor_units.first.to_param}?method=unit") : OrbitHelper.url_to_show(floor.to_param) - { - "floor-title" => floor.title, - "floor-image" => image, - "alt-title" => floor.title, - "link_to_show" => link - } - end - { - "building-title" => building.title, - "building-image" => building.image.url, - "alt-title" => building.title, - "floors" => floors - } - end + def index + params = OrbitHelper.params + page = Page.where(:page_id => params[:page_id]).first + buildings = Building.filter_by_categories.collect do |building| + floors = building.floors.desc(:title).collect do |floor| + image = (!floor.frontend_image.thumb.url.nil? ? floor.frontend_image.thumb.url : "/assets/default-floor.jpg") + link = floor.layout.nil? ? (floor.floor_units.empty? ? "#" : "/#{I18n.locale.to_s}#{page.url}/#{floor.floor_units.first.to_param}?method=unit") : OrbitHelper.url_to_show(floor.to_param) + { + "floor-title" => floor.title, + "floor-image" => image, + "alt-title" => floor.title, + "link_to_show" => link + } + end + { + "building-title" => building.title, + "building-image" => building.image.url, + "alt-title" => building.title, + "floors" => floors + } + end - { - "buildings" => buildings, - "extras" => { + { + "buildings" => buildings, + "extras" => { - } - } - end + } + } + end - def show - params = OrbitHelper.params - floor = Floor.where(:uid => params[:uid]).first rescue nil - thumb_image = (!floor.frontend_image.thumb.url.nil? ? floor.frontend_image.thumb.url : "/assets/default-floor.jpg") - image = (!floor.frontend_image.mobile.url.nil? ? floor.frontend_image.mobile.url : "#") - page = Page.where(:page_id => params[:page_id]).first + def show + params = OrbitHelper.params + floor = Floor.where(:uid => params[:uid]).first rescue nil + thumb_image = (!floor.frontend_image.thumb.url.nil? ? floor.frontend_image.thumb.url : "/assets/default-floor.jpg") + image = (!floor.frontend_image.mobile.url.nil? ? floor.frontend_image.mobile.url : "#") + page = Page.where(:page_id => params[:page_id]).first - { - "floor-title" => floor.title, - "floor-frontend-image-thumb" => thumb_image, - "floor-frontend-image" => image, - "image-alt" => floor.title, - "building-back-link" => "/" + I18n.locale.to_s + page.url, - "floor-layout" => floor.layout, - "floor-id" => floor.id.to_s, - "page-id" => page.page_id - } - end + { + "floor-title" => floor.title, + "floor-frontend-image-thumb" => thumb_image, + "floor-frontend-image" => image, + "image-alt" => floor.title, + "building-back-link" => "/" + I18n.locale.to_s + page.url, + "floor-layout" => floor.layout, + "floor-id" => floor.id.to_s, + "page-id" => page.page_id + } + end - def floor_units - floor = Floor.find(params[:floor_id]) rescue nil - page = Page.where(:page_id => params[:page_id]).first rescue nil - units = [] - if !floor.nil? - floor.floor_units.each do |unit| - url = "/#{I18n.locale.to_s}#{page.url}/#{unit.to_param}?method=unit" rescue "#" - units << { - "id" => unit.id.to_s, - "url" => url - } - end - end + def floor_units + floor = Floor.find(params[:floor_id]) rescue nil + page = Page.where(:page_id => params[:page_id]).first rescue nil + units = [] + if !floor.nil? + floor.floor_units.each do |unit| + url = "/#{I18n.locale.to_s}#{page.url}/#{unit.to_param}?method=unit" rescue "#" + units << { + "id" => unit.id.to_s, + "url" => url + } + end + end - render :json => {"success" => true, "units" => units} - end + render :json => {"success" => true, "units" => units} + end - def floor_sub_units - unit = FloorUnit.find(params[:unit_id]) rescue nil - page = Page.where(:page_id => params[:page_id]).first rescue nil - units = [] - if !unit.nil? - unit.floor_sub_units.each do |subunit| - url = subunit.floor_sub_unit_images.empty? ? "#" : "/#{I18n.locale.to_s}#{page.url}/#{subunit.to_param}?method=showcase&layout=false" rescue "#" - units << { - "id" => subunit.id.to_s, - "url" => url - } - end - end + def floor_sub_units + unit = FloorUnit.find(params[:unit_id]) rescue nil + page = Page.where(:page_id => params[:page_id]).first rescue nil + units = [] + if !unit.nil? + unit.floor_sub_units.each do |subunit| + url = subunit.floor_sub_unit_images.empty? ? "#" : "/#{I18n.locale.to_s}#{page.url}/#{subunit.to_param}?method=showcase&layout=false" rescue "#" + units << { + "id" => subunit.id.to_s, + "url" => url + } + end + end - render :json => {"success" => true, "sub_units" => units} - end + render :json => {"success" => true, "sub_units" => units} + end - def unit - params = OrbitHelper.params - unit = FloorUnit.where(:uid => params[:uid]).first rescue nil - page = Page.where(:page_id => params[:page_id]).first - layout = unit.layout.nil? ? "