basic show page

This commit is contained in:
Emi Matchu 2010-05-15 20:46:41 -04:00
parent fcb22c9fb8
commit f794d07c2c
10 changed files with 69 additions and 7 deletions

View file

@ -9,4 +9,8 @@ class ItemsController < ApplicationController
end end
end end
end end
def show
@item = Item.find params[:id]
end
end end

View file

@ -0,0 +1,20 @@
body.show {
header {
display: block;
}
#item-thumbnail {
@include inline-block;
border: 1px solid $module_border_color;
height: 80px;
margin-right: -.5em;
width: 80px;
}
#item-name {
@include inline-block;
border-bottom: 1px solid $module_border_color;
margin: 0;
padding: 0 1em 0 1em;
}
}

View file

@ -68,6 +68,7 @@ h1 a {
@include inline-block; @include inline-block;
padding: 10px; padding: 10px;
text-align: center; text-align: center;
text-decoration: none;
vertical-align: top; vertical-align: top;
width: 100px; width: 100px;
img { img {
@ -77,3 +78,5 @@ h1 a {
width: 80px; width: 80px;
} }
} }
@import "items/show";

View file

View file

@ -1,3 +1,3 @@
= div_for item do = link_to item, :class => 'item' do
= image_tag item.thumbnail_url, :alt => item.description, :title => item.description = image_tag item.thumbnail_url, :alt => item.description, :title => item.description
= item.name = item.name

View file

@ -1,6 +1,3 @@
= form_tag items_path, :method => :get do
= text_field_tag :q, @query
= submit_tag 'Search', :name => nil
- if @results - if @results
- if @results.empty? - if @results.empty?
:markdown :markdown

View file

@ -0,0 +1,3 @@
%header
= image_tag @item.thumbnail_url, :id => 'item-thumbnail'
%h2#item-name= @item.name

View file

@ -3,8 +3,11 @@
%head %head
%title Infinite Closet %title Infinite Closet
= stylesheet_link_tag 'compiled/screen' = stylesheet_link_tag 'compiled/screen'
%body %body{:class => params[:action]}
#container #container
%h1= link_to 'Infinite Closet', items_path %h1= link_to 'Infinite Closet', items_path
= flashes = flashes
= form_tag items_path, :method => :get do
= text_field_tag :q, @query
= submit_tag 'Search', :name => nil
= yield = yield

View file

@ -1,3 +1,4 @@
OpenneoImpressItems::Application.routes.draw do |map| OpenneoImpressItems::Application.routes.draw do |map|
match '/' => 'items#index', :as => :items match '/' => 'items#index', :as => :items
match '/:id' => 'items#show', :as => :item
end end

View file

@ -335,7 +335,7 @@ body .bottom {
} }
/* line 8, ../../../../../.rvm/gems/ruby-1.9.1-p378/gems/compass-0.10.1/frameworks/blueprint/stylesheets/blueprint/_debug.scss */ /* line 8, ../../../../../.rvm/gems/ruby-1.9.1-p378/gems/compass-0.10.1/frameworks/blueprint/stylesheets/blueprint/_debug.scss */
body .showgrid { body .showgrid {
background: url('/images/grid.png?1273964747'); background: url('/images/grid.png?1273969609');
} }
/* line 4, ../../../../../.rvm/gems/ruby-1.9.1-p378/gems/compass-0.10.1/frameworks/blueprint/stylesheets/blueprint/_interaction.scss */ /* line 4, ../../../../../.rvm/gems/ruby-1.9.1-p378/gems/compass-0.10.1/frameworks/blueprint/stylesheets/blueprint/_interaction.scss */
body .error { body .error {
@ -525,13 +525,44 @@ h1 a:hover {
*vertical-align: auto; *vertical-align: auto;
padding: 10px; padding: 10px;
text-align: center; text-align: center;
text-decoration: none;
vertical-align: top; vertical-align: top;
width: 100px; width: 100px;
} }
/* line 73, ../../../app/stylesheets/screen.scss */ /* line 74, ../../../app/stylesheets/screen.scss */
.item img { .item img {
display: block; display: block;
height: 80px; height: 80px;
margin: 0 auto; margin: 0 auto;
width: 80px; width: 80px;
} }
/* line 2, ../../../app/stylesheets/items/show.scss */
body.show header {
display: block;
}
/* line 6, ../../../app/stylesheets/items/show.scss */
body.show #item-thumbnail {
display: -moz-inline-box;
-moz-box-orient: vertical;
display: inline-block;
vertical-align: middle;
*display: inline;
*vertical-align: auto;
border: 1px solid #033e6b;
height: 80px;
margin-right: -0.5em;
width: 80px;
}
/* line 14, ../../../app/stylesheets/items/show.scss */
body.show #item-name {
display: -moz-inline-box;
-moz-box-orient: vertical;
display: inline-block;
vertical-align: middle;
*display: inline;
*vertical-align: auto;
border-bottom: 1px solid #033e6b;
margin: 0;
padding: 0 1em 0 1em;
}