Working on the HTML structure, variants etc

This commit is contained in:
Will Marshall
2013-12-18 12:26:34 +11:00
parent e23b33ab48
commit a3dfe1b147
7 changed files with 36 additions and 18 deletions

View File

@@ -38,7 +38,6 @@ shop
width: 200px
display: inline-block
background: transparent
font-weight: bold
border-color: #888
products
@@ -46,14 +45,20 @@ shop
padding-top: 36px
table
width: 100%
font-size: 1.2em
border-collapse: collapse
border: none
th
line-height: 50px
td, th
background: #fff
border: 1px solid #bbb
border: 1px solid #cccccc
border-left: 0px
border-right: 0px
td
padding: 20px 0px
input[type=number]
width: 60px
margin: 0px

View File

@@ -14,18 +14,20 @@
font-family: 'AvenirMed'
src: url("/AvenirLTStd-Medium.otf") format("opentype")
body
font-family: "AvenirMed_IE", "AvenirMed"
//body
//font-family: "AvenirBla_IE", "AvenirBla"
h1, h2, h3, h4, h5, h6
color: #666
font-family: "AvenirMed_IE", "AvenirMed"
color: #333333
font-family: "AvenirBla_IE", "AvenirBla"
padding: 0px
td
font-family: "helvetica"
// These selectors match the default Foundation selectors
// For clean overriden magic
table tr th, table tr td
color: #666
table tr th,
font-weight: bold
color: #333333
table thead tr th, table thead tr td, table tfoot tr th, table tfoot tr td
color: #444
color: #333333

View File

@@ -0,0 +1,3 @@
class EnterpriseSerializer < ActiveModel::Serializer
attributes :id, :name, :description
end

View File

@@ -2,6 +2,7 @@ module Spree
class ProductSerializer < ActiveModel::Serializer
attributes :id, :name, :description, :price
has_one :master
has_one :supplier
has_many :variants
end
end

View File

@@ -12,7 +12,7 @@
%form.custom
%strong Ready for:
%select#order_cycle_id{"ng-model" => "order_cycle.order_cycle_id",
"ng-init" => "order_cycle.order_cycle_id = #{current_order_cycle.andand.id}",
"ng-init" => "order_cycle.order_cycle_id = #{current_order_cycle.andand.id || nil}",
"ng-change" => "changeOrderCycle()",
"ng-options" => "oc.id as oc.time for oc in #{@order_cycles.map {|oc| {time: pickup_time(oc), id: oc.id}}.to_json}"}

View File

@@ -1,9 +1,10 @@
%products{"ng-controller" => "ProductsCtrl"}
%form.custom
%input.button.right{type: :submit, value: "Check Out"}
%table
%thead
%th{colspan: 2} Item
%th Description
%th Notes
%th Variant
%th QTY
%th Bulk
@@ -11,10 +12,12 @@
%tbody{"ng-repeat" => "product in data.products "}
%tr.product
%td
{{ product.master.images[0].mini_url }}
{{product.master.images[0].alt}}
-#{{ product.master.images[0].mini_url }}
-#{{product.master.images[0].alt}}
%td
{{ product.name }}
%h5
{{ product.name }}
{{ product.supplier.name }}
%td {{ product.description }}
%td {{ product.master.options_text }}
%td
@@ -39,6 +42,6 @@
Not available
%td.price
%small from
$ {{ variant.price }}
${{ variant.price }}
%input.button.right{type: :submit, value: "Check Out"}
%pre {{ data.products | json }}

View File

@@ -67,6 +67,10 @@ feature "As a consumer I want to shop with a distributor", js: true do
select "frogs", :from => "order_cycle_id"
page.should have_content product.name
end
it "shows variants when an order cycle has been selected" do
#create(:variant, :
end
end
end