mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Working on the HTML structure, variants etc
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
3
app/serializers/enterprise_serializer.rb
Normal file
3
app/serializers/enterprise_serializer.rb
Normal file
@@ -0,0 +1,3 @@
|
||||
class EnterpriseSerializer < ActiveModel::Serializer
|
||||
attributes :id, :name, :description
|
||||
end
|
||||
@@ -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
|
||||
|
||||
@@ -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}"}
|
||||
|
||||
|
||||
@@ -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 }}
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user