Permalink
Browse files

set the description on layouts and products in

seed
  • Loading branch information...
1 parent a37c1f6 commit fe7526856d2b1b4bf5be861f0bd6c512e9983c75 Dirk Kelly committed Oct 23, 2010
View
5 app/views/admin/shop/categories/edit/meta/_status.html.haml
@@ -1,2 +1,3 @@
-- f.fields_for :page do |pf|
- = pf.hidden_field :status_id,:value => Status[Radiant::Config['defaults.page.status']].id
+- if @shop_category.new_record?
+ - f.fields_for :page do |pf|
+ = pf.hidden_field :status_id,:value => Status[Radiant::Config['defaults.page.status']].id
View
5 app/views/admin/shop/products/edit/meta/_status.html.haml
@@ -1,2 +1,3 @@
-- f.fields_for :page do |pf|
- = pf.hidden_field :status_id,:value => Status[Radiant::Config['defaults.page.status']].id
+- if @shop_product.new_record?
+ - f.fields_for :page do |pf|
+ = pf.hidden_field :status_id,:value => Status[Radiant::Config['defaults.page.status']].id
View
2 db/seeds/layouts.rb
@@ -56,7 +56,7 @@
<r:if_products>
<ul class="category_products">
<r:each:product>
- <li class="product" id="product_<r:sku />" data-id="<r:id />">
+ <li class="product" id="product_<r:sku />" data-id="<r:id />"
<h3><r:link /></h3>
<h4><r:price /></h4>
</li>
View
12 db/seeds/products.rb
@@ -4,7 +4,11 @@
:slug => 'category',
:parent => Page.first,
:layout => Layout.find_by_name(Radiant::Config['shop.layout_category']),
- :status_id => 100
+ :status_id => 100,
+ :parts_attributes => [{
+ :name => 'description',
+ :content => 'I am a category'
+ }]
}
})
@@ -15,7 +19,11 @@
:parent => category.page,
:slug => 'product',
:layout => Layout.find_by_name(Radiant::Config['shop.layout_product']),
- :status_id => 100
+ :status_id => 100,
+ :parts_attributes => [{
+ :name => 'description',
+ :content => 'I am a product'
+ }]
}
})

0 comments on commit fe75268

Please sign in to comment.