added some stuff

This commit is contained in:
Harry Bomrah 2015-09-25 18:11:30 +08:00
parent 0489045aee
commit 2708b8ad28
5 changed files with 29 additions and 4 deletions

View File

@ -13,7 +13,12 @@ ul.building-showcase{
position: relative; position: relative;
transition-property: left, right, top; transition-property: left, right, top;
width: 200px; width: 200px;
height: 250px; height: 275px;
.actions {
text-align: center;
margin-top: 5px;
}
.shade { .shade {
background-color: #000000; background-color: #000000;
@ -31,7 +36,7 @@ ul.building-showcase{
} }
p { p {
bottom: 0; bottom: 30px;
color: #f2f2f2; color: #f2f2f2;
font-family: "Playfair Display SC",sans-serif; font-family: "Playfair Display SC",sans-serif;
font-size: 30px; font-size: 30px;
@ -46,7 +51,7 @@ ul.building-showcase{
} }
img { img {
height: 100%; height: 250px;
width: 100%; width: 100%;
} }
} }

View File

@ -1,10 +1,20 @@
class SpacesController < ApplicationController class SpacesController < ApplicationController
def index def index
buildings = Building.all.collect do |building| 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-title" => building.title,
"building-image" => building.image.url, "building-image" => building.image.url,
"alt-title" => building.title "alt-title" => building.title,
"floors" => floors
} }
end end

View File

@ -7,6 +7,7 @@ class Floor
field :layout field :layout
mount_uploader :layout_image, ImageUploader mount_uploader :layout_image, ImageUploader
mount_uploader :frontend_image, ImageUploader
belongs_to :building belongs_to :building
has_many :floor_units, :dependent => :destroy has_many :floor_units, :dependent => :destroy

View File

@ -4,4 +4,7 @@
<div class="shade"></div> <div class="shade"></div>
<p><%= building.title %></p> <p><%= building.title %></p>
</a> </a>
<div class="actions">
<a href="#">Edit</a> | <a href="#">Delete</a>
</div>
</li> </li>

View File

@ -42,6 +42,12 @@
<input type="file" placeholder="Floor1" id="floor-name-text-box" name="floor[layout_image]" /> <input type="file" placeholder="Floor1" id="floor-name-text-box" name="floor[layout_image]" />
</div> </div>
</div> </div>
<div class="control-group">
<label for="floor-name-text-box" class="control-label muted">Frontend Image</label>
<div class="controls">
<input type="file" placeholder="Floor1" id="floor-name-text-box" name="floor[frontend_image]" />
</div>
</div>
</form> </form>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">