diff --git a/app/assets/stylesheets/space.scss b/app/assets/stylesheets/space.scss index 32068e3..76ba990 100644 --- a/app/assets/stylesheets/space.scss +++ b/app/assets/stylesheets/space.scss @@ -13,7 +13,12 @@ ul.building-showcase{ position: relative; transition-property: left, right, top; width: 200px; - height: 250px; + height: 275px; + + .actions { + text-align: center; + margin-top: 5px; + } .shade { background-color: #000000; @@ -31,7 +36,7 @@ ul.building-showcase{ } p { - bottom: 0; + bottom: 30px; color: #f2f2f2; font-family: "Playfair Display SC",sans-serif; font-size: 30px; @@ -46,7 +51,7 @@ ul.building-showcase{ } img { - height: 100%; + height: 250px; width: 100%; } } diff --git a/app/controllers/spaces_controller.rb b/app/controllers/spaces_controller.rb index bd55ad9..162836d 100644 --- a/app/controllers/spaces_controller.rb +++ b/app/controllers/spaces_controller.rb @@ -1,10 +1,20 @@ class SpacesController < ApplicationController def index buildings = Building.all.collect do |building| + floors = building.floors.collect do |floor| + image = (!floor.layout_image.nil? ? floor.layout_image.url : "/assets/no-layout.jpg") + { + "floor-title" => floor.title, + "floor-image" => image, + "alt-title" => floor.title, + "link_to_show" => OrbitHelper.url_to_show(floor.to_param) + } + end { "building-title" => building.title, "building-image" => building.image.url, - "alt-title" => building.title + "alt-title" => building.title, + "floors" => floors } end diff --git a/app/models/floor.rb b/app/models/floor.rb index 68bb335..19d7804 100644 --- a/app/models/floor.rb +++ b/app/models/floor.rb @@ -7,6 +7,7 @@ class Floor field :layout mount_uploader :layout_image, ImageUploader + mount_uploader :frontend_image, ImageUploader belongs_to :building has_many :floor_units, :dependent => :destroy diff --git a/app/views/admin/spaces/_building.html.erb b/app/views/admin/spaces/_building.html.erb index 0f84f0f..12700e4 100644 --- a/app/views/admin/spaces/_building.html.erb +++ b/app/views/admin/spaces/_building.html.erb @@ -4,4 +4,7 @@
<%= building.title %>
+ \ No newline at end of file diff --git a/app/views/admin/spaces/floors.html.erb b/app/views/admin/spaces/floors.html.erb index 63acce9..10505bb 100644 --- a/app/views/admin/spaces/floors.html.erb +++ b/app/views/admin/spaces/floors.html.erb @@ -42,6 +42,12 @@ +