From 21d99c8e569a646dd0241f5559d2e91fb4baa870 Mon Sep 17 00:00:00 2001 From: Will Marshall Date: Wed, 18 Dec 2013 15:17:08 +1100 Subject: [PATCH] Directing our form to the order populator --- app/assets/stylesheets/darkswarm/shop.css.sass | 4 +++- app/serializers/spree/product_serializer.rb | 2 +- app/views/shop/_products.html.haml | 11 +++++------ 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/app/assets/stylesheets/darkswarm/shop.css.sass b/app/assets/stylesheets/darkswarm/shop.css.sass index 56ff0c1f57..97c46ccf42 100644 --- a/app/assets/stylesheets/darkswarm/shop.css.sass +++ b/app/assets/stylesheets/darkswarm/shop.css.sass @@ -37,7 +37,7 @@ shop font-size: 1.29em padding-right: 14px .custom.dropdown - width: 250px + width: 280px display: inline-block background: transparent border-width: 2px @@ -59,6 +59,8 @@ shop border: none th line-height: 50px + .notes + max-width: 300px td, th background: #fff border: 1px solid #cccccc diff --git a/app/serializers/spree/product_serializer.rb b/app/serializers/spree/product_serializer.rb index 86bb92afcc..d230e51031 100644 --- a/app/serializers/spree/product_serializer.rb +++ b/app/serializers/spree/product_serializer.rb @@ -1,6 +1,6 @@ module Spree class ProductSerializer < ActiveModel::Serializer - attributes :id, :name, :description, :price + attributes :id, :name, :description, :price, :permalink has_one :master has_one :supplier has_many :variants diff --git a/app/views/shop/_products.html.haml b/app/views/shop/_products.html.haml index a8218af7dd..c418b90e8f 100644 --- a/app/views/shop/_products.html.haml +++ b/app/views/shop/_products.html.haml @@ -1,10 +1,10 @@ %products{"ng-controller" => "ProductsCtrl"} - %form.custom + = form_for :order, :url => populate_orders_path, :class => "custom" do %input.button.right{type: :submit, value: "Check Out"} %table %thead %th{colspan: 2} Item - %th Notes + %th.notes Notes %th Variant %th QTY %th Bulk @@ -18,7 +18,7 @@ %h5 {{ product.name }} {{ product.supplier.name }} - %td {{ product.description | truncate:250 }} + %td.notes {{ product.description | truncate:250 }} %td {{ product.master.options_text }} %td %input{type: :number, value: 0, min: 0, name: "quantity_variant_{{product.master.id}}"} @@ -29,7 +29,7 @@ Not available %td.price %small from - $ {{ product.price }} + ${{ product.price }} %tr{"ng-repeat" => "variant in product.variants"} %td{colspan: 3} %td {{variant.options_text}} @@ -41,7 +41,6 @@ %span{"ng-hide" => "product.group_buy"} Not available %td.price - %small from - ${{ variant.price }} + %small from ${{variant.price }} %input.button.right{type: :submit, value: "Check Out"} -#%pre {{ data.products | json }}