diff options
| author | mo khan <mo@mokhan.ca> | 2014-10-13 13:18:52 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2014-10-13 13:18:52 -0600 |
| commit | 2d92ea754a580e67f69928404c20c616d034dfc9 (patch) | |
| tree | eb6fe6f365ce43c3e2f46153b509d9753d268050 /app | |
| parent | 2575f945ef2f24bb2e6f0bcd3cc54458f45712dc (diff) | |
add product details page.
Diffstat (limited to 'app')
| -rw-r--r-- | app/controllers/admin/products_controller.rb | 4 | ||||
| -rw-r--r-- | app/views/admin/products/index.html.erb | 2 | ||||
| -rw-r--r-- | app/views/admin/products/show.html.erb | 47 |
3 files changed, 52 insertions, 1 deletions
diff --git a/app/controllers/admin/products_controller.rb b/app/controllers/admin/products_controller.rb index 91e6be20..28c3c55e 100644 --- a/app/controllers/admin/products_controller.rb +++ b/app/controllers/admin/products_controller.rb @@ -8,5 +8,9 @@ module Admin def index @products = @product_api.search(params[:q]) end + + def show + @product = @product_api.find(params[:id]) + end end end diff --git a/app/views/admin/products/index.html.erb b/app/views/admin/products/index.html.erb index bfa6e056..7f706654 100644 --- a/app/views/admin/products/index.html.erb +++ b/app/views/admin/products/index.html.erb @@ -13,7 +13,7 @@ <tbody> <% @products.each do |product| %> <tr> - <td><%= link_to product.asin, product.url %></td> + <td><%= link_to product.asin, admin_product_path(product.asin) %></td> <td> <%= link_to product.title, product.url %> is made by <%= product.manufacturer %> in category <%= product.category %> </td> diff --git a/app/views/admin/products/show.html.erb b/app/views/admin/products/show.html.erb new file mode 100644 index 00000000..a458838e --- /dev/null +++ b/app/views/admin/products/show.html.erb @@ -0,0 +1,47 @@ +<div class="row-fluid"> + <div class="span2"> + <%= render partial: "my/shared/my_nav" %> + </div> + <div class="span10"> + <table class="table"> + <tr> + <td>asin</td> + <td><%= link_to @product.asin, @product.detail_page_url %></td> + </tr> + <tr> + <td>attributes</td> + <td><%= @product.item_attributes %></td> + </tr> + <tr> + <td>images</td> + <td> + <% @product.image_sets.image_set.each do |image| %> + <%= image_tag image.large_image.url %> + <%= image_tag image.medium_image.url %> + <%= image_tag image.small_image.url %> + <%= image_tag image.swatch_image.url %> + <%= image_tag image.thumbnail_image.url %> + <%= image_tag image.tiny_image.url %> + <% end %> + </td> + </tr> + <tr> + <td>reviews</td> + <td> + <%= @product.editorial_reviews.editorial_review.content %> + </td> + </tr> + <tr> + <td>links</td> + <td> + <ul> + <% @product.item_links.item_link.each do |link| %> + <li><%= link_to link.description, link.url %></li> + <% end %> + </ul> + </td> + </tr> + </table> + </div> +</div> + |
