diff options
| author | bth-openerp <bth@tinyerp.com> | 2013-10-17 18:41:39 +0530 |
|---|---|---|
| committer | bth-openerp <bth@tinyerp.com> | 2013-10-17 18:41:39 +0530 |
| commit | addc2d5f9cefc4c7cd1eb7f3abcc496f2c8eeabe (patch) | |
| tree | 9bcb89044f3ca6854b2942206b73653f52859e84 | |
| parent | e3d3cf674c461b2d39418b98898e21d32c08a20d (diff) | |
| parent | d5bbf2501a08dd6b0bab0ea4e2e9ff4b0b03fed7 (diff) | |
[MERGE]Merge trunk-website-al.
bzr revid: bth@tinyerp.com-20131017131139-whjjmuin6g9cby9r
25 files changed, 738 insertions, 320 deletions
diff --git a/addons/product/product_demo.xml b/addons/product/product_demo.xml index 260b4b3ea0b..39be1635d1a 100644 --- a/addons/product/product_demo.xml +++ b/addons/product/product_demo.xml @@ -209,7 +209,8 @@ <field name="categ_id" ref="product.product_category_5"/> </record> - <record id="product_product_1" model="product.product"> + + <record id="product_template_1" model="product.template"> <field name="name">On Site Monitoring</field> <field name="categ_id" ref="product_category_5"/> <field name="public_categ_id" ref="services"/> @@ -221,8 +222,12 @@ <field name="description">This type of service include basic monitoring of products.</field> <field name="description_sale">This type of service include basic monitoring of products.</field> </record> + <record id="product_product_1" model="product.product"> + <field name="product_tmpl_id" ref="product_template_1"/> + </record> - <record id="product_product_2" model="product.product"> + + <record id="product_template_2" model="product.template"> <field name="name">On Site Assistance</field> <field name="categ_id" ref="product_category_5"/> <field name="public_categ_id" ref="services"/> @@ -233,10 +238,13 @@ <field name="uom_po_id" ref="product_uom_hour"/> <field name="description">This type of service include assistance for security questions, system configuration requirements, implementation or special needs.</field> </record> + <record id="product_product_2" model="product.product"> + <field name="product_tmpl_id" ref="product_template_2"/> + </record> - <record id="product_product_3" model="product.product"> + + <record id="product_template_3" model="product.template"> <field name="name">PC Assemble SC234</field> - <field name="default_code">PCSC234</field> <field name="categ_id" ref="product_category_4"/> <field name="public_categ_id" ref="Computer_all_in_one"/> <field name="list_price">450.0</field> @@ -249,10 +257,14 @@ Processor AMD 8-Core 512MB RAM HDD SH-1</field> </record> + <record id="product_product_3" model="product.product"> + <field name="product_tmpl_id" ref="product_template_3"/> + <field name="default_code">PCSC234</field> + </record> - <record id="product_product_4" model="product.product"> + + <record id="product_template_4" model="product.template"> <field name="name">iPad Retina Display</field> - <field name="default_code">A2323</field> <field name="categ_id" ref="ipad"/> <field name="public_categ_id" ref="Computer_all_in_one"/> <field name="standard_price">500.0</field> @@ -264,10 +276,14 @@ HDD SH-1</field> Dual-core A5 with quad-core graphics FaceTime HD Camera, 1.2 MP Photos</field> </record> + <record id="product_product_4" model="product.product"> + <field name="product_tmpl_id" ref="product_template_4"/> + <field name="default_code">A2323</field> + </record> - <record id="product_product_5" model="product.product"> + + <record id="product_template_5" model="product.template"> <field name="name">Bose Mini Bluetooth Speaker</field> - <field name="default_code">B3423</field> <field name="categ_id" ref="accessories"/> <field name="public_categ_id" ref="Speakers"/> <field name="standard_price">600.0</field> @@ -278,10 +294,14 @@ FaceTime HD Camera, 1.2 MP Photos</field> <field name="description">Custom computer assembled on order based on customer's requirement.</field> <field name="description_sale">Bose's smallest portable Bluetooth speaker</field> </record> + <record id="product_product_5" model="product.product"> + <field name="product_tmpl_id" ref="product_template_5"/> + <field name="default_code">B3423</field> + </record> - <record id="product_product_6" model="product.product"> + + <record id="product_template_6" model="product.template"> <field name="name">iPad Mini</field> - <field name="default_code">A1232</field> <field name="categ_id" ref="ipad"/> <field name="public_categ_id" ref="Screen"/> <field name="standard_price">800.0</field> @@ -290,9 +310,13 @@ FaceTime HD Camera, 1.2 MP Photos</field> <field name="uom_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/> </record> - <record id="product_product_7" model="product.product"> + <record id="product_product_6" model="product.product"> + <field name="product_tmpl_id" ref="product_template_6"/> + <field name="default_code">A1232</field> + </record> + + <record id="product_template_7" model="product.template"> <field name="name">Apple In-Ear Headphones</field> - <field name="default_code">A8767</field> <field name="categ_id" ref="accessories"/> <field name="public_categ_id" ref="Screen"/> <field name="standard_price">70.0</field> @@ -301,9 +325,13 @@ FaceTime HD Camera, 1.2 MP Photos</field> <field name="uom_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/> </record> - <record id="product_product_8" model="product.product"> + <record id="product_product_7" model="product.product"> + <field name="product_tmpl_id" ref="product_template_7"/> + <field name="default_code">A8767</field> + </record> + + <record id="product_template_8" model="product.template"> <field name="name">iMac</field> - <field name="default_code">A1090</field> <field name="categ_id" ref="imac"/> <field name="standard_price">1299.0</field> <field name="list_price">1799.0</field> @@ -311,9 +339,13 @@ FaceTime HD Camera, 1.2 MP Photos</field> <field name="uom_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/> </record> - <record id="product_product_9" model="product.product"> + <record id="product_product_8" model="product.product"> + <field name="product_tmpl_id" ref="product_template_8"/> + <field name="default_code">A1090</field> + </record> + + <record id="product_template_9" model="product.template"> <field name="name">Apple Wireless Keyboard</field> - <field name="default_code">AK789</field> <field name="categ_id" ref="accessories"/> <field name="public_categ_id" ref="Keyboard_Mouse"/> <field name="standard_price">10.0</field> @@ -322,9 +354,13 @@ FaceTime HD Camera, 1.2 MP Photos</field> <field name="uom_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/> </record> - <record id="product_product_10" model="product.product"> + <record id="product_product_9" model="product.product"> + <field name="product_tmpl_id" ref="product_template_9"/> + <field name="default_code">AK789</field> + </record> + + <record id="product_template_10" model="product.template"> <field name="name">Mouse, Optical</field> - <field name="default_code">M-Opt</field> <field name="categ_id" ref="product_category_8"/> <field name="public_categ_id" ref="Keyboard_Mouse"/> <field name="standard_price">12.50</field> @@ -333,10 +369,13 @@ FaceTime HD Camera, 1.2 MP Photos</field> <field name="uom_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/> </record> + <record id="product_product_10" model="product.product"> + <field name="product_tmpl_id" ref="product_template_10"/> + <field name="default_code">M-Opt</field> + </record> - <record id="product_product_11_temp" model="product.template"> + <record id="product_template_11" model="product.template"> <field name="name">iPod</field> - <field name="default_code">A6678</field> <field name="categ_id" ref="ipod"/> <field name="public_categ_id" ref="Keyboard_Mouse"/> <field name="standard_price">14</field> @@ -356,17 +395,17 @@ FaceTime HD Camera, 1.2 MP Photos</field> <field name="type">consu</field> <field name="uom_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/> - <field name="product_tmpl_id" ref="product_product_11_temp"/> + <field name="product_tmpl_id" ref="product_template_11"/> + <field name="default_code">A6678</field> </record> <record id="product_product_11_b" model="product.product"> <field name="variants">32 Gb</field> <field name="price_extra">12</field> - <field name="product_tmpl_id" ref="product_product_11_temp"/> + <field name="product_tmpl_id" ref="product_template_11"/> </record> - <record id="product_product_12" model="product.product"> + <record id="product_template_12" model="product.template"> <field name="name">Mouse, Wireless</field> - <field name="default_code">M-Wir</field> <field name="categ_id" ref="product_category_8"/> <field name="public_categ_id" ref="Keyboard_Mouse"/> <field name="standard_price">18</field> @@ -375,9 +414,13 @@ FaceTime HD Camera, 1.2 MP Photos</field> <field name="uom_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/> </record> - <record id="product_product_13" model="product.product"> + <record id="product_product_12" model="product.product"> + <field name="product_tmpl_id" ref="product_template_12"/> + <field name="default_code">M-Wir</field> + </record> + + <record id="product_template_13" model="product.template"> <field name="name">RAM SR5</field> - <field name="default_code">RAM-SR5</field> <field name="categ_id" ref="product_category_8"/> <field name="public_categ_id" ref="Memory"/> <field name="standard_price">78.0</field> @@ -386,9 +429,13 @@ FaceTime HD Camera, 1.2 MP Photos</field> <field name="uom_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/> </record> - <record id="product_product_14" model="product.product"> + <record id="product_product_13" model="product.product"> + <field name="product_tmpl_id" ref="product_template_13"/> + <field name="default_code">RAM-SR5</field> + </record> + + <record id="product_template_14" model="product.template"> <field name="name">RAM SR2</field> - <field name="default_code">RAM-SR2</field> <field name="categ_id" ref="product_category_8"/> <field name="public_categ_id" ref="Memory"/> <field name="standard_price">87.0</field> @@ -397,9 +444,13 @@ FaceTime HD Camera, 1.2 MP Photos</field> <field name="uom_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/> </record> - <record id="product_product_15" model="product.product"> + <record id="product_product_14" model="product.product"> + <field name="product_tmpl_id" ref="product_template_14"/> + <field name="default_code">RAM-SR2</field> + </record> + + <record id="product_template_15" model="product.template"> <field name="name">RAM SR3</field> - <field name="default_code">RAM-SR3</field> <field name="categ_id" ref="product_category_8"/> <field name="public_categ_id" ref="Memory"/> <field name="standard_price">80.0</field> @@ -408,9 +459,13 @@ FaceTime HD Camera, 1.2 MP Photos</field> <field name="uom_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/> </record> - <record id="product_product_16" model="product.product"> + <record id="product_product_15" model="product.product"> + <field name="product_tmpl_id" ref="product_template_15"/> + <field name="default_code">RAM-SR3</field> + </record> + + <record id="product_template_16" model="product.template"> <field name="name">Computer Case</field> - <field name="default_code">C-Case</field> <field name="categ_id" ref="product_category_8"/> <field name="public_categ_id" ref="case"/> <field name="standard_price">20.0</field> @@ -419,9 +474,13 @@ FaceTime HD Camera, 1.2 MP Photos</field> <field name="uom_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/> </record> - <record id="product_product_17" model="product.product"> + <record id="product_product_16" model="product.product"> + <field name="product_tmpl_id" ref="product_template_16"/> + <field name="default_code">C-Case</field> + </record> + + <record id="product_template_17" model="product.template"> <field name="name">HDD SH-1</field> - <field name="default_code">HDD-SH1</field> <field name="categ_id" ref="product_category_8"/> <field name="public_categ_id" ref="HDD"/> <field name="standard_price">860.0</field> @@ -430,9 +489,13 @@ FaceTime HD Camera, 1.2 MP Photos</field> <field name="uom_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/> </record> - <record id="product_product_18" model="product.product"> + <record id="product_product_17" model="product.product"> + <field name="product_tmpl_id" ref="product_template_17"/> + <field name="default_code">HDD-SH1</field> + </record> + + <record id="product_template_18" model="product.template"> <field name="name">HDD SH-2</field> - <field name="default_code">HDD-SH2</field> <field name="categ_id" ref="product_category_8"/> <field name="public_categ_id" ref="HDD"/> <field name="standard_price">1020.0</field> @@ -441,9 +504,13 @@ FaceTime HD Camera, 1.2 MP Photos</field> <field name="uom_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/> </record> - <record id="product_product_19" model="product.product"> + <record id="product_product_18" model="product.product"> + <field name="product_tmpl_id" ref="product_template_18"/> + <field name="default_code">HDD-SH2</field> + </record> + + <record id="product_template_19" model="product.template"> <field name="name">HDD on Demand</field> - <field name="default_code">HDD-DEM</field> <field name="categ_id" ref="product_category_8"/> <field name="public_categ_id" ref="HDD"/> <field name="standard_price">1100.0</field> @@ -453,9 +520,13 @@ FaceTime HD Camera, 1.2 MP Photos</field> <field name="uom_po_id" ref="product_uom_unit"/> <field name="description">On demand hard-disk having capacity based on requirement.</field> </record> - <record id="product_product_20" model="product.product"> + <record id="product_product_19" model="product.product"> + <field name="product_tmpl_id" ref="product_template_19"/> + <field name="default_code">HDD-DEM</field> + </record> + + <record id="product_template_20" model="product.template"> <field name="name">Motherboard I9P57</field> - <field name="default_code">MBi9</field> <field name="categ_id" ref="product_category_8"/> <field name="public_categ_id" ref="motherboard"/> <field name="standard_price">1700.0</field> @@ -464,9 +535,13 @@ FaceTime HD Camera, 1.2 MP Photos</field> <field name="uom_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/> </record> - <record id="product_product_21" model="product.product"> + <record id="product_product_20" model="product.product"> + <field name="product_tmpl_id" ref="product_template_20"/> + <field name="default_code">MBi9</field> + </record> + + <record id="product_template_21" model="product.template"> <field name="name">Motherboard A20Z7</field> - <field name="default_code">MBa20</field> <field name="categ_id" ref="product_category_8"/> <field name="public_categ_id" ref="motherboard"/> <field name="standard_price">1790.0</field> @@ -475,9 +550,13 @@ FaceTime HD Camera, 1.2 MP Photos</field> <field name="uom_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/> </record> - <record id="product_product_22" model="product.product"> + <record id="product_product_21" model="product.product"> + <field name="product_tmpl_id" ref="product_template_21"/> + <field name="default_code">MBa20</field> + </record> + + <record id="product_template_22" model="product.template"> <field name="name">Processor Core i5 2.70 Ghz</field> - <field name="default_code">CPUi5</field> <field name="categ_id" ref="product_category_8"/> <field name="public_categ_id" ref="processor"/> <field name="standard_price">2010.0</field> @@ -486,9 +565,13 @@ FaceTime HD Camera, 1.2 MP Photos</field> <field name="uom_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/> </record> - <record id="product_product_23" model="product.product"> + <record id="product_product_22" model="product.product"> + <field name="product_tmpl_id" ref="product_template_22"/> + <field name="default_code">CPUi5</field> + </record> + + <record id="product_template_23" model="product.template"> <field name="name">Processor AMD 8-Core</field> - <field name="default_code">CPUa8</field> <field name="categ_id" ref="product_category_8"/> <field name="public_categ_id" ref="processor"/> <field name="standard_price">1910.0</field> @@ -497,9 +580,13 @@ FaceTime HD Camera, 1.2 MP Photos</field> <field name="uom_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/> </record> - <record id="product_product_24" model="product.product"> + <record id="product_product_23" model="product.product"> + <field name="product_tmpl_id" ref="product_template_23"/> + <field name="default_code">CPUa8</field> + </record> + + <record id="product_template_24" model="product.template"> <field name="name">Graphics Card</field> - <field name="default_code">CARD</field> <field name="categ_id" ref="product_category_8"/> <field name="public_categ_id" ref="graphics_card"/> <field name="standard_price">876.0</field> @@ -508,9 +595,13 @@ FaceTime HD Camera, 1.2 MP Photos</field> <field name="uom_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/> </record> - <record id="product_product_25" model="product.product"> + <record id="product_product_24" model="product.product"> + <field name="product_tmpl_id" ref="product_template_24"/> + <field name="default_code">CARD</field> + </record> + + <record id="product_template_25" model="product.template"> <field name="name">Laptop E5023</field> - <field name="default_code">LAP-E5</field> <field name="categ_id" ref="product_category_4"/> <field name="public_categ_id" ref="laptops"/> <field name="standard_price">2870.0</field> @@ -523,9 +614,13 @@ FaceTime HD Camera, 1.2 MP Photos</field> Standard-1294P Processor QWERTY keyboard</field> </record> - <record id="product_product_26" model="product.product"> + <record id="product_product_25" model="product.product"> + <field name="product_tmpl_id" ref="product_template_25"/> + <field name="default_code">LAP-E5</field> + </record> + + <record id="product_template_26" model="product.template"> <field name="name">Laptop S3450</field> - <field name="default_code">LAP-S3</field> <field name="categ_id" ref="product_category_4"/> <field name="public_categ_id" ref="laptops"/> <field name="standard_price">3000.0</field> @@ -538,9 +633,13 @@ QWERTY keyboard</field> Hi-Speed 234Q Processor QWERTY keyboard</field> </record> - <record id="product_product_27" model="product.product"> + <record id="product_product_26" model="product.product"> + <field name="product_tmpl_id" ref="product_template_26"/> + <field name="default_code">LAP-S3</field> + </record> + + <record id="product_template_27" model="product.template"> <field name="name">Laptop Customized</field> - <field name="default_code">LAP-CUS</field> <field name="categ_id" ref="product_category_4"/> <field name="public_categ_id" ref="laptops"/> <field name="standard_price">3300.0</field> @@ -550,9 +649,13 @@ QWERTY keyboard</field> <field name="uom_po_id" ref="product_uom_unit"/> <field name="description">Custom Laptop based on customer's requirement.</field> </record> - <record id="product_product_28" model="product.product"> + <record id="product_product_27" model="product.product"> + <field name="product_tmpl_id" ref="product_template_27"/> + <field name="default_code">LAP-CUS</field> + </record> + + <record id="product_template_28" model="product.template"> <field name="name">External Hard disk</field> - <field name="default_code">EXT-HDD</field> <field name="categ_id" ref="product_category_6"/> <field name="public_categ_id" ref="External_Hard_Drive"/> <field name="standard_price">390.0</field> @@ -561,10 +664,14 @@ QWERTY keyboard</field> <field name="uom_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/> </record> + <record id="product_product_28" model="product.product"> + <field name="product_tmpl_id" ref="product_template_28"/> + <field name="default_code">EXT-HDD</field> + </record> - <record id="product_product_29" model="product.product"> + + <record id="product_template_29" model="product.template"> <field name="name">Pen drive, SP-2</field> - <field name="default_code">PD-SP2</field> <field name="categ_id" ref="product_category_7"/> <field name="public_categ_id" ref="Pen_Drive"/> <field name="standard_price">90.0</field> @@ -573,10 +680,14 @@ QWERTY keyboard</field> <field name="uom_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/> </record> + <record id="product_product_29" model="product.product"> + <field name="product_tmpl_id" ref="product_template_29"/> + <field name="default_code">PD-SP2</field> + </record> - <record id="product_product_30" model="product.product"> + + <record id="product_template_30" model="product.template"> <field name="name">Pen drive, SP-4</field> - <field name="default_code">PD-SP4</field> <field name="categ_id" ref="product_category_7"/> <field name="public_categ_id" ref="Pen_Drive"/> <field name="standard_price">126.0</field> @@ -585,9 +696,13 @@ QWERTY keyboard</field> <field name="uom_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/> </record> - <record id="product_product_31" model="product.product"> + <record id="product_product_30" model="product.product"> + <field name="product_tmpl_id" ref="product_template_30"/> + <field name="default_code">PD-SP4</field> + </record> + + <record id="product_template_31" model="product.template"> <field name="name">Multimedia Speakers</field> - <field name="default_code">MM-SPK</field> <field name="categ_id" ref="product_category_7"/> <field name="public_categ_id" ref="Speakers"/> <field name="standard_price">134.0</field> @@ -597,9 +712,13 @@ QWERTY keyboard</field> <field name="uom_po_id" ref="product_uom_unit"/> <field name="description">.</field> </record> - <record id="product_product_32" model="product.product"> + <record id="product_product_31" model="product.product"> + <field name="product_tmpl_id" ref="product_template_31"/> + <field name="default_code">MM-SPK</field> + </record> + + <record id="product_template_32" model="product.template"> <field name="name">Headset standard</field> - <field name="default_code">HEAD</field> <field name="categ_id" ref="product_category_7"/> <field name="public_categ_id" ref="Headset"/> <field name="standard_price">57.0</field> @@ -609,9 +728,13 @@ QWERTY keyboard</field> <field name="uom_po_id" ref="product_uom_unit"/> <field name="description">Hands free headset for laptop PC with in-line microphone and headphone plug.</field> </record> - <record id="product_product_33" model="product.product"> + <record id="product_product_32" model="product.product"> + <field name="product_tmpl_id" ref="product_template_32"/> + <field name="default_code">HEAD</field> + </record> + + <record id="product_template_33" model="product.template"> <field name="name">Headset USB</field> - <field name="default_code">HEAD-USB</field> <field name="categ_id" ref="product_category_7"/> <field name="public_categ_id" ref="Headset"/> <field name="standard_price">60.0</field> @@ -621,10 +744,14 @@ QWERTY keyboard</field> <field name="uom_po_id" ref="product_uom_unit"/> <field name="description">Headset for laptop PC with USB connector.</field> </record> + <record id="product_product_33" model="product.product"> + <field name="product_tmpl_id" ref="product_template_33"/> + <field name="default_code">HEAD-USB</field> + </record> - <record id="product_product_34" model="product.product"> + + <record id="product_template_34" model="product.template"> <field name="name">Webcam</field> - <field name="default_code">WCAM</field> <field name="categ_id" ref="product_category_7"/> <field name="public_categ_id" ref="video_acquisition"/> <field name="standard_price">38.0</field> @@ -633,10 +760,14 @@ QWERTY keyboard</field> <field name="uom_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/> </record> + <record id="product_product_34" model="product.product"> + <field name="product_tmpl_id" ref="product_template_34"/> + <field name="default_code">WCAM</field> + </record> - <record id="product_product_35" model="product.product"> + + <record id="product_template_35" model="product.template"> <field name="name">Blank CD</field> - <field name="default_code">CD</field> <field name="categ_id" ref="product_category_7"/> <field name="standard_price">18.40</field> <field name="list_price">20.0</field> @@ -644,10 +775,14 @@ QWERTY keyboard</field> <field name="uom_id" ref="product_uom_dozen"/> <field name="uom_po_id" ref="product_uom_dozen"/> </record> + <record id="product_product_35" model="product.product"> + <field name="product_tmpl_id" ref="product_template_35"/> + <field name="default_code">CD</field> + </record> - <record id="product_product_36" model="product.product"> + + <record id="product_template_36" model="product.template"> <field name="name">Blank DVD-RW</field> - <field name="default_code">DVD</field> <field name="categ_id" ref="product_category_7"/> <field name="standard_price">21.60</field> <field name="list_price">24.0</field> @@ -655,10 +790,14 @@ QWERTY keyboard</field> <field name="uom_id" ref="product_uom_dozen"/> <field name="uom_po_id" ref="product_uom_dozen"/> </record> + <record id="product_product_36" model="product.product"> + <field name="product_tmpl_id" ref="product_template_36"/> + <field name="default_code">DVD</field> + </record> - <record id="product_product_37" model="product.product"> + + <record id="product_template_37" model="product.template"> <field name="name">Printer, All-in-one</field> - <field name="default_code">PRINT</field> <field name="categ_id" ref="product_category_6"/> <field name="public_categ_id" ref="printer"/> <field name="standard_price">4258.0</field> @@ -668,10 +807,14 @@ QWERTY keyboard</field> <field name="uom_po_id" ref="product_uom_unit"/> <field name="description">All in one hi-speed printer with fax and scanner.</field> </record> + <record id="product_product_37" model="product.product"> + <field name="product_tmpl_id" ref="product_template_37"/> + <field name="default_code">PRINT</field> + </record> - <record id="product_product_38" model="product.product"> + + <record id="product_template_38" model="product.template"> <field name="name">Ink Cartridge</field> - <field name="default_code">INK</field> <field name="categ_id" ref="product_category_6"/> <field name="public_categ_id" ref="printer"/> <field name="standard_price">60.0</field> @@ -680,10 +823,14 @@ QWERTY keyboard</field> <field name="uom_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/> </record> + <record id="product_product_38" model="product.product"> + <field name="product_tmpl_id" ref="product_template_38"/> + <field name="default_code">INK</field> + </record> - <record id="product_product_39" model="product.product"> + + <record id="product_template_39" model="product.template"> <field name="name">Toner Cartridge</field> - <field name="default_code">TONER</field> <field name="categ_id" ref="product_category_6"/> <field name="public_categ_id" ref="printer"/> <field name="standard_price">66.0</field> @@ -692,10 +839,14 @@ QWERTY keyboard</field> <field name="uom_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/> </record> + <record id="product_product_39" model="product.product"> + <field name="product_tmpl_id" ref="product_template_39"/> + <field name="default_code">TONER</field> + </record> - <record id="product_product_40" model="product.product"> + + <record id="product_template_40" model="product.template"> <field name="name">Windows 7 Professional</field> - <field name="default_code">Win7</field> <field name="categ_id" ref="product_category_9"/> <field name="public_categ_id" ref="Softwares"/> <field name="standard_price">330.0</field> @@ -704,10 +855,14 @@ QWERTY keyboard</field> <field name="uom_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/> </record> + <record id="product_product_40" model="product.product"> + <field name="product_tmpl_id" ref="product_template_40"/> + <field name="default_code">Win7</field> + </record> - <record id="product_product_41" model="product.product"> + + <record id="product_template_41" model="product.template"> <field name="name">Windows Home Server 2011</field> - <field name="default_code">WServer</field> <field name="categ_id" ref="product_category_9"/> <field name="public_categ_id" ref="Softwares"/> <field name="standard_price">540.0</field> @@ -716,10 +871,14 @@ QWERTY keyboard</field> <field name="uom_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/> </record> + <record id="product_product_41" model="product.product"> + <field name="product_tmpl_id" ref="product_template_41"/> + <field name="default_code">WServer</field> + </record> - <record id="product_product_42" model="product.product"> + + <record id="product_template_42" model="product.template"> <field name="name">Office Suite</field> - <field name="default_code">OSuite</field> <field name="categ_id" ref="product_category_9"/> <field name="public_categ_id" ref="Softwares"/> <field name="standard_price">110.0</field> @@ -729,10 +888,14 @@ QWERTY keyboard</field> <field name="uom_po_id" ref="product_uom_unit"/> <field name="description_sale">Office Editing Software with word processing, spreadsheets, presentations, graphics, and databases...</field> </record> + <record id="product_product_42" model="product.product"> + <field name="product_tmpl_id" ref="product_template_42"/> + <field name="default_code">OSuite</field> + </record> - <record id="product_product_43" model="product.product"> + + <record id="product_template_43" model="product.template"> <field name="name">Zed+ Antivirus</field> - <field name="default_code">Zplus</field> <field name="categ_id" ref="product_category_9"/> <field name="public_categ_id" ref="Softwares"/> <field name="standard_price">235.0</field> @@ -741,10 +904,14 @@ QWERTY keyboard</field> <field name="uom_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/> </record> + <record id="product_product_43" model="product.product"> + <field name="product_tmpl_id" ref="product_template_43"/> + <field name="default_code">Zplus</field> + </record> - <record id="product_product_44" model="product.product"> + + <record id="product_template_44" model="product.template"> <field name="name">GrapWorks Software</field> - <field name="default_code">GRAPs/w</field> <field name="categ_id" ref="product_category_9"/> <field name="public_categ_id" ref="Softwares"/> <field name="standard_price">155.0</field> @@ -754,10 +921,14 @@ QWERTY keyboard</field> <field name="uom_po_id" ref="product_uom_unit"/> <field name="description_sale">Full featured image editing software.</field> </record> + <record id="product_product_44" model="product.product"> + <field name="product_tmpl_id" ref="product_template_44"/> + <field name="default_code">GRAPs/w</field> + </record> - <record id="product_product_45" model="product.product"> + + <record id="product_template_45" model="product.template"> <field name="name">Router R430</field> - <field name="default_code">ROUT_430</field> <field name="categ_id" ref="product_category_6"/> <field name="public_categ_id" ref="Modem_Router"/> <field name="standard_price">55.0</field> @@ -766,10 +937,14 @@ QWERTY keyboard</field> <field name="uom_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/> </record> + <record id="product_product_45" model="product.product"> + <field name="product_tmpl_id" ref="product_template_45"/> + <field name="default_code">ROUT_430</field> + </record> - <record id="product_product_46" model="product.product"> + + <record id="product_template_46" model="product.template"> <field name="name">Datacard</field> - <field name="default_code">DC</field> <field name="categ_id" ref="product_category_6"/> <field name="public_categ_id" ref="Pen_Drive"/> <field name="standard_price">35.0</field> @@ -778,10 +953,14 @@ QWERTY keyboard</field> <field name="uom_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/> </record> + <record id="product_product_46" model="product.product"> + <field name="product_tmpl_id" ref="product_template_46"/> + <field name="default_code">DC</field> + </record> - <record id="product_product_47" model="product.product"> + + <record id="product_template_47" model="product.template"> <field name="name">Switch, 24 ports</field> - <field name="default_code">SW24</field> <field name="categ_id" ref="product_category_6"/> <field name="public_categ_id" ref="Switch"/> <field name="standard_price">55.0</field> @@ -790,10 +969,14 @@ QWERTY keyboard</field> <field name="uom_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/> </record> + <record id="product_product_47" model="product.product"> + <field name="product_tmpl_id" ref="product_template_47"/> + <field name="default_code">SW24</field> + </record> - <record id="product_product_48" model="product.product"> + + <record id="product_template_48" model="product.template"> <field name="name">USB Adapter</field> - <field name="default_code">ADPT</field> <field name="categ_id" ref="product_category_6"/> <field name="standard_price">13.0</field> <field name="list_price">18.0</field> @@ -801,328 +984,333 @@ QWERTY keyboard</field> <field name="uom_id" ref="product_uom_unit"/> <field name="uom_po_id" ref="product_uom_unit"/> </record> + <record id="product_product_48" model="product.product"> + <field name="product_tmpl_id" ref="product_template_48"/> + <field name="default_code">ADPT</field> + </record> + <!-- Resource: product.supplierinfo --> <record id="product_supplierinfo_1" model="product.supplierinfo"> - <field name="product_id" ref="product_product_6"/> + <field name="product_id" ref="product_template_6"/> <field name="name" ref="base.res_partner_1"/> <field name="delay">3</field> <field name="min_qty">1</field> </record> <record id="product_supplierinfo_2" model="product.supplierinfo"> - <field name="product_id" ref="product_product_6"/> + <field name="product_id" ref="product_template_6"/> <field name="name" ref="base.res_partner_4"/> <field name="delay">3</field> <field name="min_qty">1</field> </record> <record id="product_supplierinfo_3" model="product.supplierinfo"> - <field name="product_id" ref="product_product_7"/> + <field name="product_id" ref="product_template_7"/> <field name="name" ref="base.res_partner_1"/> <field name="delay">3</field> <field name="min_qty">1</field> </record> <record id="product_supplierinfo_4" model="product.supplierinfo"> - <field name="product_id" ref="product_product_7"/> + <field name="product_id" ref="product_template_7"/> <field name="name" ref="base.res_partner_4"/> <field name="delay">3</field> <field name="min_qty">1</field> </record> <record id="product_supplierinfo_5" model="product.supplierinfo"> - <field name="product_id" ref="product_product_8"/> + <field name="product_id" ref="product_template_8"/> <field name="name" ref="base.res_partner_16"/> <field name="delay">2</field> <field name="min_qty">5</field> </record> <record id="product_supplierinfo_6" model="product.supplierinfo"> - <field name="product_id" ref="product_product_8"/> + <field name="product_id" ref="product_template_8"/> <field name="name" ref="base.res_partner_8"/> <field name="delay">4</field> <field name="min_qty">1</field> </record> <record id="product_supplierinfo_7" model="product.supplierinfo"> - <field name="product_id" ref="product_product_10"/> + <field name="product_id" ref="product_template_10"/> <field name="name" ref="base.res_partner_16"/> <field name="delay">2</field> <field name="min_qty">1</field> </record> <record id="product_supplierinfo_8" model="product.supplierinfo"> - <field name="product_id" ref="product_product_11"/> + <field name="product_id" ref="product_template_11"/> <field name="name" ref="base.res_partner_16"/> <field name="delay">2</field> <field name="min_qty">1</field> </record> <record id="product_supplierinfo_9" model="product.supplierinfo"> - <field name="product_id" ref="product_product_13"/> + <field name="product_id" ref="product_template_13"/> <field name="name" ref="base.res_partner_4"/> <field name="delay">5</field> <field name="min_qty">1</field> </record> <record id="product_supplierinfo_10" model="product.supplierinfo"> - <field name="product_id" ref="product_product_14"/> + <field name="product_id" ref="product_template_14"/> <field name="name" ref="base.res_partner_4"/> <field name="delay">5</field> <field name="min_qty">1</field> </record> <record id="product_supplierinfo_11" model="product.supplierinfo"> - <field name="product_id" ref="product_product_15"/> + <field name="product_id" ref="product_template_15"/> <field name="name" ref="base.res_partner_4"/> <field name="delay">5</field> <field name="min_qty">1</field> </record> <record id="product_supplierinfo_12" model="product.supplierinfo"> - <field name="product_id" ref="product_product_15"/> + <field name="product_id" ref="product_template_15"/> <field name="name" ref="base.res_partner_1"/> <field name="delay">1</field> <field name="min_qty">1</field> </record> <record id="product_supplierinfo_13" model="product.supplierinfo"> - <field name="product_id" ref="product_product_16"/> + <field name="product_id" ref="product_template_16"/> <field name="name" ref="base.res_partner_3"/> <field name="delay">1</field> <field name="min_qty">1</field> </record> <record id="product_supplierinfo_14" model="product.supplierinfo"> - <field name="product_id" ref="product_product_17"/> + <field name="product_id" ref="product_template_17"/> <field name="name" ref="base.res_partner_19"/> <field name="delay">3</field> <field name="min_qty">1</field> </record> <record id="product_supplierinfo_15" model="product.supplierinfo"> - <field name="product_id" ref="product_product_20"/> + <field name="product_id" ref="product_template_20"/> <field name="name" ref="base.res_partner_4"/> <field name="delay">3</field> <field name="min_qty">1</field> </record> <record id="product_supplierinfo_16" model="product.supplierinfo"> - <field name="product_id" ref="product_product_20"/> + <field name="product_id" ref="product_template_20"/> <field name="name" ref="base.res_partner_16"/> <field name="delay">4</field> <field name="min_qty">5</field> </record> <record id="product_supplierinfo_17" model="product.supplierinfo"> - <field name="product_id" ref="product_product_21"/> + <field name="product_id" ref="product_template_21"/> <field name="name" ref="base.res_partner_4"/> <field name="delay">3</field> <field name="min_qty">1</field> </record> <record id="product_supplierinfo_18" model="product.supplierinfo"> - <field name="product_id" ref="product_product_21"/> + <field name="product_id" ref="product_template_21"/> <field name="name" ref="base.res_partner_16"/> <field name="delay">2</field> <field name="min_qty">1</field> </record> <record id="product_supplierinfo_19" model="product.supplierinfo"> - <field name="product_id" ref="product_product_22"/> + <field name="product_id" ref="product_template_22"/> <field name="name" ref="base.res_partner_19"/> <field name="delay">3</field> <field name="min_qty">1</field> </record> <record id="product_supplierinfo_20" model="product.supplierinfo"> - <field name="product_id" ref="product_product_23"/> + <field name="product_id" ref="product_template_23"/> <field name="name" ref="base.res_partner_19"/> <field name="delay">3</field> <field name="min_qty">1</field> </record> <record id="product_supplierinfo_21" model="product.supplierinfo"> - <field name="product_id" ref="product_product_24"/> + <field name="product_id" ref="product_template_24"/> <field name="name" ref="base.res_partner_19"/> <field name="delay">3</field> <field name="min_qty">1</field> </record> <record id="product_supplierinfo_22" model="product.supplierinfo"> - <field name="product_id" ref="product_product_25"/> + <field name="product_id" ref="product_template_25"/> <field name="name" ref="base.res_partner_1"/> <field name="delay">8</field> <field name="min_qty">1</field> </record> <record id="product_supplierinfo_23" model="product.supplierinfo"> - <field name="product_id" ref="product_product_26"/> + <field name="product_id" ref="product_template_26"/> <field name="name" ref="base.res_partner_1"/> <field name="delay">8</field> <field name="min_qty">1</field> </record> <record id="product_supplierinfo_24" model="product.supplierinfo"> - <field name="product_id" ref="product_product_28"/> + <field name="product_id" ref="product_template_28"/> <field name="name" ref="base.res_partner_19"/> <field name="delay">4</field> <field name="min_qty">1</field> </record> <record id="product_supplierinfo_25" model="product.supplierinfo"> - <field name="product_id" ref="product_product_28"/> + <field name="product_id" ref="product_template_28"/> <field name="name" ref="base.res_partner_1"/> <field name="delay">5</field> <field name="min_qty">1</field> </record> <record id="product_supplierinfo_26" model="product.supplierinfo"> - <field name="product_id" ref="product_product_29"/> + <field name="product_id" ref="product_template_29"/> <field name="name" ref="base.res_partner_3"/> <field name="delay">2</field> <field name="min_qty">12</field> </record> <record id="product_supplierinfo_27" model="product.supplierinfo"> - <field name="product_id" ref="product_product_30"/> + <field name="product_id" ref="product_template_30"/> <field name="name" ref="base.res_partner_3"/> <field name="delay">2</field> <field name="min_qty">12</field> </record> <record id="product_supplierinfo_28" model="product.supplierinfo"> - <field name="product_id" ref="product_product_31"/> + <field name="product_id" ref="product_template_31"/> <field name="name" ref="base.res_partner_3"/> <field name="delay">2</field> <field name="min_qty">5</field> </record> <record id="product_supplierinfo_29" model="product.supplierinfo"> - <field name="product_id" ref="product_product_32"/> + <field name="product_id" ref="product_template_32"/> <field name="name" ref="base.res_partner_3"/> <field name="delay">2</field> <field name="min_qty">12</field> </record> <record id="product_supplierinfo_30" model="product.supplierinfo"> - <field name="product_id" ref="product_product_34"/> + <field name="product_id" ref="product_template_34"/> <field name="name" ref="base.res_partner_16"/> <field name="delay">2</field> <field name="min_qty">5</field> </record> <record id="product_supplierinfo_31" model="product.supplierinfo"> - <field name="product_id" ref="product_product_35"/> + <field name="product_id" ref="product_template_35"/> <field name="name" ref="base.res_partner_8"/> <field name="delay">2</field> <field name="min_qty">1</field> </record> <record id="product_supplierinfo_32" model="product.supplierinfo"> - <field name="product_id" ref="product_product_36"/> + <field name="product_id" ref="product_template_36"/> <field name="name" ref="base.res_partner_8"/> <field name="delay">2</field> <field name="min_qty">1</field> </record> <record id="product_supplierinfo_33" model="product.supplierinfo"> - <field name="product_id" ref="product_product_38"/> + <field name="product_id" ref="product_template_38"/> <field name="name" ref="base.res_partner_22"/> <field name="delay">4</field> <field name="min_qty">1</field> </record> <record id="product_supplierinfo_34" model="product.supplierinfo"> - <field name="product_id" ref="product_product_39"/> + <field name="product_id" ref="product_template_39"/> <field name="name" ref="base.res_partner_22"/> <field name="delay">4</field> <field name="min_qty">1</field> </record> <record id="product_supplierinfo_35" model="product.supplierinfo"> - <field name="product_id" ref="product_product_45"/> + <field name="product_id" ref="product_template_45"/> <field name="name" ref="base.res_partner_22"/> <field name="delay">5</field> <field name="min_qty">1</field> </record> <record id="product_supplierinfo_36" model="product.supplierinfo"> - <field name="product_id" ref="product_product_46"/> + <field name="product_id" ref="product_template_46"/> <field name="name" ref="base.res_partner_22"/> <field name="delay">5</field> <field name="min_qty">1</field> </record> <record id="product_supplierinfo_37" model="product.supplierinfo"> - <field name="product_id" ref="product_product_47"/> + <field name="product_id" ref="product_template_47"/> <field name="name" ref="base.res_partner_8"/> <field name="delay">7</field> <field name="min_qty">1</field> </record> <!--record id="product_supplierinfo_38" model="product.supplierinfo"> - <field name="product_id" ref="product_product_48"/> + <field name="product_id" ref="product_template_48"/> <field name="name" ref="base.res_partner_8"/> <field name="delay">7</field> <field name="min_qty">1</field> </record--> <record id="product_supplierinfo_39" model="product.supplierinfo"> - <field name="product_id" ref="product_product_18"/> + <field name="product_id" ref="product_template_18"/> <field name="name" ref="base.res_partner_19"/> <field name="delay">4</field> <field name="min_qty">1</field> </record> <record id="product_supplierinfo_40" model="product.supplierinfo"> - <field name="product_id" ref="product_product_19"/> + <field name="product_id" ref="product_template_19"/> <field name="name" ref="base.res_partner_1"/> <field name="delay">4</field> <field name="min_qty">0</field> </record> <record id="product_supplierinfo_41" model="product.supplierinfo"> - <field name="product_id" ref="product_product_19"/> + <field name="product_id" ref="product_template_19"/> <field name="name" ref="base.res_partner_8"/> <field name="delay">5</field> <field name="min_qty">0</field> </record> <record id="product_supplierinfo_42" model="product.supplierinfo"> - <field name="product_id" ref="product_product_33"/> + <field name="product_id" ref="product_template_33"/> <field name="name" ref="base.res_partner_3"/> <field name="delay">2</field> <field name="min_qty">0</field> </record> <record id="product_supplierinfo_43" model="product.supplierinfo"> - <field name="product_id" ref="product_product_9"/> + <field name="product_id" ref="product_template_9"/> <field name="name" ref="base.res_partner_8"/> <field name="delay">4</field> <field name="min_qty">0</field> </record> <record id="product_supplierinfo_44" model="product.supplierinfo"> - <field name="product_id" ref="product_product_27"/> + <field name="product_id" ref="product_template_27"/> <field name="name" ref="base.res_partner_1"/> <field name="delay">10</field> <field name="min_qty">0</field> </record> <record id="product_supplierinfo_45" model="product.supplierinfo"> - <field name="product_id" ref="product_product_12"/> + <field name="product_id" ref="product_template_12"/> <field name="name" ref="base.res_partner_16"/> <field name="delay">3</field> <field name="min_qty">0</field> </record> <record id="product_supplierinfo_46" model="product.supplierinfo"> - <field name="product_id" ref="product_product_37"/> + <field name="product_id" ref="product_template_37"/> <field name="name" ref="base.res_partner_22"/> <field name="delay">5</field> <field name="min_qty">0</field> diff --git a/addons/website/controllers/main.py b/addons/website/controllers/main.py index baa6b6c780b..083f9f3aef7 100644 --- a/addons/website/controllers/main.py +++ b/addons/website/controllers/main.py @@ -51,11 +51,7 @@ class Website(openerp.addons.web.controllers.main.Home): def index(self, **kw): return self.page("website.homepage") - @http.route('/admin', type='http', auth="none") - def admin(self, *args, **kw): - return super(Website, self).index(*args, **kw) - - # FIXME: auth, if /pagenew known anybody can create new empty page + # FIXME: auth, if /pagenew known anybody can create new empty page @website.route('/pagenew/<path:path>', type='http', auth="admin") def pagenew(self, path, noredirect=NOPE): module = 'website' diff --git a/addons/website/models/ir_ui_view.py b/addons/website/models/ir_ui_view.py index 1b680549164..d6ad607fa3f 100644 --- a/addons/website/models/ir_ui_view.py +++ b/addons/website/models/ir_ui_view.py @@ -11,8 +11,8 @@ class view(osv.osv): 'inherited_option_ids': fields.one2many('ir.ui.view','inherit_option_id','Optional Inheritancies'), 'page': fields.boolean("Whether this view is a web page template (complete)"), 'website_meta_title': fields.char("Website meta title", size=70, translate=True), - 'website_meta_description': fields.text("Website meta description", translate=True), - 'website_meta_keywords': fields.char("Website meta keywords", size=70, translate=True), + 'website_meta_description': fields.text("Website meta description", size=160, translate=True), + 'website_meta_keywords': fields.char("Website meta keywords", translate=True), } _defaults = { 'page': False, diff --git a/addons/website/models/website.py b/addons/website/models/website.py index ec9d56632f5..b3aaf611ddc 100644 --- a/addons/website/models/website.py +++ b/addons/website/models/website.py @@ -181,11 +181,12 @@ class website(osv.osv): logger.error("Website Rendering Error.\n\n%s" % traceback.format_exc()) return self.render(cr, uid, ids, 'website.404', qweb_context) - try: - main_object = request.registry[view_ref[0]].browse(cr, uid, view_ref[1]) - qweb_context['main_object'] = main_object - except Exception: - pass + if 'main_object' not in qweb_context: + try: + main_object = request.registry[view_ref[0]].browse(cr, uid, view_ref[1]) + qweb_context['main_object'] = main_object + except Exception: + pass try: return view.render( diff --git a/addons/website/static/src/css/editor.css b/addons/website/static/src/css/editor.css index ebcb7f43826..dc9bb076e59 100644 --- a/addons/website/static/src/css/editor.css +++ b/addons/website/static/src/css/editor.css @@ -1,3 +1,4 @@ +@charset "utf-8"; /* ---- CKEditor Minimal Reset ---- */ .navbar.navbar-inverse .cke_chrome { border: none; @@ -304,53 +305,87 @@ table.editorbar-panel td.selected { } /* ---- SNIPPETS DROP ZONES ---- */ -.oe_drop_zone.oe_insert { +#dark_for_dropzone { + width: 100%; + position: absolute; + top: 0; + left: 0; + opacity: 0.4; + z-index: 1000; + pointer-events: none; +} +#dark_for_dropzone td { + background: black; +} +#dark_for_dropzone td.center.active { + background: transparent; +} + +.oe_drop_zone, .oe_drop_zone_style { + border: none; + background: rgba(100, 255, 255, 0.9); + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + -ms-border-radius: 4px; + -o-border-radius: 4px; + border-radius: 4px; +} +.oe_drop_zone div, .oe_drop_zone_style div { + margin: 0; + line-height: 48px; + text-align: center; + color: magenta; + font-weight: bold; + font-size: 24px; +} +.oe_drop_zone .oe_active, .oe_drop_zone_style .oe_active { + display: none; +} + +.oe_drop_zone_style div { + line-height: 24px; +} + +.oe_drop_zone { display: block; height: 48px; margin: 0px; margin-top: -4px; margin-bottom: -44px; - -webkit-transition: margin 250ms linear; - -moz-transition: margin 250ms linear; - -o-transition: margin 250ms linear; - transition: margin 250ms linear; + z-index: 1002; width: 100%; position: absolute; - z-index: 1000; } -.oe_drop_zone.oe_insert:not(.oe_vertical):before { +.oe_drop_zone:not(.oe_vertical):before { content: ""; display: block; border-top: dashed 2px rgba(209, 178, 255, 0.72); position: relative; top: 0px; } -.oe_drop_zone.oe_insert.oe_hover:before { +.oe_drop_zone.oe_hover:before { border-top: dashed 2px rgba(116, 255, 161, 0.72); } -.oe_drop_zone.oe_insert.oe_vertical { +.oe_drop_zone.oe_vertical { width: 48px; float: left; position: relative; - margin: 0px -24px !important; + margin: 4px -24px !important; } -.oe_drop_zone.oe_insert.oe_overlay { +.oe_drop_zone.oe_vertical div { + display: none; +} +.oe_drop_zone.oe_overlay { border-radius: 3px; - background: rgba(153, 0, 255, 0.5); } - -.oe_drop_zone, .oe_drop_zone_style { - border: none; - background: rgba(153, 0, 255, 0.3); - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - -ms-border-radius: 4px; - -o-border-radius: 4px; - border-radius: 4px; +.oe_drop_zone.oe_drop_active { + background: rgba(100, 255, 255, 0.3); +} +.oe_drop_zone.oe_drop_active div { + display: none; } -.oe_drop_zone.oe_hover, .oe_drop_zone_style.oe_hover { - background: rgba(0, 255, 133, 0.3); - z-index: 1001; +.oe_drop_zone.oe_drop_active .oe_active { + display: block; } .oe_drop_zone_style { @@ -602,34 +637,29 @@ table.editorbar-panel td.selected { /* ---- ACE EDITOR ---- */ .oe_ace_view_editor { - -webkit-transition: all 0.2s ease-in; - -moz-transition: all 0.2s ease-in; - -o-transition: all 0.2s ease-in; - transition: all 0.2s ease-in; - filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=30); - opacity: 0.3; position: fixed; top: 51px; right: 0; z-index: 1000; height: 100%; + width: 720px; } .oe_ace_view_editor .oe_ace_view_editor_title { width: 100%; - padding-top: 4px; - padding-left: 4px; - height: 40px; + padding-top: 0; + padding-left: 0; + height: 30px; background: #2f3129; } .oe_ace_view_editor .oe_ace_view_editor_title .oe_view_list { width: 50%; - height: 32px; + height: 30px; font-size: 14px; font-family: "Monaco", "Menlo", "Ubuntu Mono", "Consolas", "source-code-pro", monospace; line-height: normal; } .oe_ace_view_editor .oe_ace_view_editor_title .btn { - height: 32px; + height: 30px; padding: 0 4px 0 4px; font-size: 14px; font-family: "Monaco", "Menlo", "Ubuntu Mono", "Consolas", "source-code-pro", monospace; @@ -637,21 +667,18 @@ table.editorbar-panel td.selected { } .oe_ace_view_editor .ace_editor { position: absolute; - top: 40px; + top: 30px; right: 0; bottom: 51px; left: 0; width: 720px; } -.oe_ace_view_editor:hover { +.oe_ace_view_editor.oe_ace_open { filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100); opacity: 1; } -.oe_ace_view_editor.oe_ace_open { - width: 720px; -} .oe_ace_view_editor.oe_ace_closed { - width: 0; + z-index: -1000; filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0); opacity: 0; } diff --git a/addons/website/static/src/css/editor.sass b/addons/website/static/src/css/editor.sass index 1ef6d67bb49..bc8b238736e 100644 --- a/addons/website/static/src/css/editor.sass +++ b/addons/website/static/src/css/editor.sass @@ -4,15 +4,15 @@ @import "compass/css3/user-interface" @import "compass/css3/transition" -//smartphones, iPhone, portrait 480x320 phones +//smartphones, iPhone, portrait 480x320 phones $smart_phone: 320px //portrait e-readers (Nook/Kindle), smaller tablets @ 600 or @ 640 wide.*/ -$small-tablet: 481px +$small-tablet: 481px //portrait tablets, portrait iPad, landscape e-readers, landscape 800x480 or 854x480 phones -$portrait-tablet: 641px -//tablet, landscape iPad, lo-res laptops ands desktops +$portrait-tablet: 641px +//tablet, landscape iPad, lo-res laptops ands desktops $tablet: 961px -//big landscape tablets, laptops, and desktops +//big landscape tablets, laptops, and desktops $desktop: 1025px /* ---- CKEditor Minimal Reset ---- */ @@ -179,7 +179,7 @@ table.editorbar-panel background: black !important > a padding: 2px 10px !important - width: 100% + width: 100% display: block border: 0 z-index: 1 @@ -189,13 +189,13 @@ table.editorbar-panel display: inline-block white-space: nowrap background: black - > div + > div background: rgb(0,0,0) label width: 44px color: #fff padding-left: 10px - + div width: 100px text-align: center @@ -242,16 +242,45 @@ table.editorbar-panel /* ---- SNIPPETS DROP ZONES ---- */ -.oe_drop_zone.oe_insert +#dark_for_dropzone + width: 100% + position: absolute + top: 0 + left: 0 + opacity: 0.4 + z-index: 1000 + pointer-events: none + td + background: #000 + &.center.active + background: transparent + +.oe_drop_zone, .oe_drop_zone_style + border: none + background: rgba(100, 255, 255, .9) + +border-radius(4px) + div + margin: 0 + line-height: 48px + text-align: center + color: #FF00FF + font-weight: bold + font-size: 24px + .oe_active + display: none + +.oe_drop_zone_style div + line-height: 24px + +.oe_drop_zone display: block height: 48px margin: 0px margin-top: -4px margin-bottom: -44px - @include transition(margin 250ms linear) + z-index: 1002 width: 100% position: absolute - z-index: 1000 &:not(.oe_vertical):before content: "" display: block @@ -264,22 +293,17 @@ table.editorbar-panel width: 48px float: left position: relative - margin: 0px -24px !important + margin: 4px -24px !important + div + display: none &.oe_overlay border-radius: 3px - //@include background-image( repeating-linear-gradient(45deg, rgba(255,255,255,.1) ,rgba(255,255,255,.1) 35px, rgba(0,0,0,.1) 35px, rgba(0,0,0,.1) 75px)) - //background-size: 100px 100px - background: rgba(153, 0, 255,.5) - -.oe_drop_zone, .oe_drop_zone_style - border: none - //@include background-image( repeating-linear-gradient(45deg, rgba(255,255,255,.1) ,rgba(255,255,255,.1) 35px, rgba(0,0,0,.1) 35px, rgba(0,0,0,.1) 75px)) - //background-size: 100px 100px - background: rgba(153, 0, 255, .3) - +border-radius(4px) - &.oe_hover - background: rgba(0, 255, 133, .3) - z-index: 1001 + &.oe_drop_active + background: rgba(100, 255, 255, .3) + div + display: none + .oe_active + display: block .oe_drop_zone_style color: white @@ -293,7 +317,7 @@ table.editorbar-panel display: none position: absolute background: transparent - //@include background-image( repeating-linear-gradient(45deg, rgba(255,255,255,.02) ,rgba(255,255,255,.02) 35px, rgba(0,0,0,.02) 35px, rgba(0,0,0,.02) 75px)) + //@include background-image( repeating-linear-gradient(45deg, rgba(255,255,255,.02) ,rgba(255,255,255,.02) 35px, rgba(0,0,0,.02) 35px, rgba(0,0,0,.02) 75px)) +border-radius(3px) @include transition(opacity 100ms linear) +box-sizing(border-box) @@ -467,7 +491,7 @@ $highlighted_text_color: #ffffff /* ---- ACE EDITOR ---- */ $ace_width: 720px -$editorbar_height: 40px +$editorbar_height: 30px // TODO Fix => might break with themes $navbar_height: 51px @@ -476,25 +500,24 @@ $navbar_height: 51px font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace line-height: normal .oe_ace_view_editor - @include transition(all 0.2s ease-in) - +opacity(0.3) position: fixed top: $navbar_height right: 0 z-index: 1000 height: 100% + width: $ace_width .oe_ace_view_editor_title width: 100% - padding-top: 4px - padding-left: 4px + padding-top: 0 + padding-left: 0 height: $editorbar_height background: #2F3129 .oe_view_list width: 50% - height: $editorbar_height - 8px + height: $editorbar_height @include editor-font .btn - height: $editorbar_height - 8px + height: $editorbar_height padding: 0 4px 0 4px @include editor-font .ace_editor @@ -504,12 +527,10 @@ $navbar_height: 51px bottom: $navbar_height left: 0 width: $ace_width - &:hover - +opacity(1) &.oe_ace_open - width: $ace_width + +opacity(1) &.oe_ace_closed - width: 0 + z-index: -1000 +opacity(0) /* ---- EDITOR TOUR ---- */ diff --git a/addons/website/static/src/css/snippets.css b/addons/website/static/src/css/snippets.css index 63e8fbefa76..c6bb24d04f0 100644 --- a/addons/website/static/src/css/snippets.css +++ b/addons/website/static/src/css/snippets.css @@ -216,5 +216,4 @@ [data-snippet-id] { min-height: 10px; min-width: 10px; -} - +}
\ No newline at end of file diff --git a/addons/website/static/src/css/website.css b/addons/website/static/src/css/website.css index ce87e592136..c5b58815c67 100644 --- a/addons/website/static/src/css/website.css +++ b/addons/website/static/src/css/website.css @@ -235,7 +235,10 @@ footer { } .oe_structure.oe_empty > .oe_drop_zone.oe_insert:only-child, [data-oe-type=html] > .oe_drop_zone.oe_insert:only-child { - position: static; + position: relative; +} +.oe_structure.oe_empty > .oe_drop_zone.oe_insert:only-child div, [data-oe-type=html] > .oe_drop_zone.oe_insert:only-child div { + display: none; } .oe_structure.oe_empty:empty:before, [data-oe-type=html]:empty:before, .oe_structure.oe_empty > .oe_drop_zone.oe_insert:only-child:before, [data-oe-type=html] > .oe_drop_zone.oe_insert:only-child:before { diff --git a/addons/website/static/src/css/website.sass b/addons/website/static/src/css/website.sass index 5197653429c..2735dfe9fc8 100644 --- a/addons/website/static/src/css/website.sass +++ b/addons/website/static/src/css/website.sass @@ -161,7 +161,9 @@ footer height: 220px !important .oe_structure.oe_empty > .oe_drop_zone.oe_insert:only-child, [data-oe-type=html] > .oe_drop_zone.oe_insert:only-child - position: static + position: relative + div + display: none .oe_structure.oe_empty:empty:before, [data-oe-type=html]:empty:before, .oe_structure.oe_empty > .oe_drop_zone.oe_insert:only-child:before, [data-oe-type=html] > .oe_drop_zone.oe_insert:only-child:before content: 'Click Edit To Create Content' diff --git a/addons/website/static/src/js/website.ace.js b/addons/website/static/src/js/website.ace.js index 1a0417ff11a..faf3e8f7e04 100644 --- a/addons/website/static/src/js/website.ace.js +++ b/addons/website/static/src/js/website.ace.js @@ -66,6 +66,9 @@ }); website.ace.ViewEditor = openerp.Widget.extend({ + resizing: false, + refX: 0, + minWidth: 40, template: 'website.ace_view_editor', events: { 'change #ace-view-list': 'displaySelectedView', @@ -89,6 +92,32 @@ self.loadViews.call(self, views); self.open.call(self); }); + + var $editor = self.$('.ace_editor'); + function resizeEditor (target) { + var width = Math.min(document.body.clientWidth, Math.max(parseInt(target, 10), self.minWidth)); + $editor.width(width); + self.aceEditor.resize(); + self.$el.width(width); + } + function startResizing (e) { + self.refX = e.pageX; + self.resizing = true; + } + function stopResizing () { + self.resizing = false; + } + function updateWidth (e) { + if (self.resizing) { + var offset = e.pageX - self.refX; + var width = self.$el.width() - offset; + self.refX = e.pageX; + resizeEditor(width); + } + } + document.body.addEventListener('mouseup', stopResizing, true); + self.$('.ace_gutter').mouseup(stopResizing).mousedown(startResizing).click(stopResizing); + $(document).mousemove(updateWidth); }, loadViews: function (views) { var self = this; @@ -205,11 +234,7 @@ }, close: function () { window.location.hash = ""; - var self = this; - this.$el.bind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function () { - globalEditor = null; - self.destroy.call(self); - }).removeClass('oe_ace_open').addClass('oe_ace_closed'); + this.$el.removeClass('oe_ace_open').addClass('oe_ace_closed'); }, }); diff --git a/addons/website/static/src/js/website.editor.js b/addons/website/static/src/js/website.editor.js index 81fe087a59e..485ba48e35b 100644 --- a/addons/website/static/src/js/website.editor.js +++ b/addons/website/static/src/js/website.editor.js @@ -307,7 +307,7 @@ }); }, cancel: function () { - window.location.href = window.location.href.replace(/unable_editor(=[^&]*)?|#.*/g, ''); + website.reload(); }, }); @@ -394,7 +394,7 @@ // - contextmenu & tabletools (disable contextual menu) // - bunch of unused plugins var plugins = [ - 'a11yhelp', 'basicstyles', 'bidi', 'blockquote', + 'a11yhelp', 'basicstyles', 'blockquote', 'clipboard', 'colorbutton', 'colordialog', 'dialogadvtab', 'elementspath', 'enterkey', 'entities', 'filebrowser', 'find', 'floatingspace','format', 'htmlwriter', 'iframe', @@ -927,7 +927,7 @@ } - var Observer = window.MutationObserver || window.WebkitMutationObserver || window.JsMutationObserver; + website.Observer = window.MutationObserver || window.WebkitMutationObserver || window.JsMutationObserver; var OBSERVER_CONFIG = { childList: true, attributes: true, @@ -935,7 +935,7 @@ subtree: true, attributeOldValue: true, }; - var observer = new Observer(function (mutations) { + var observer = new website.Observer(function (mutations) { // NOTE: Webkit does not fire DOMAttrModified => webkit browsers // relying on JsMutationObserver shim (Chrome < 18, Safari < 6) // will not mark dirty on attribute changes (@class, img/@src, diff --git a/addons/website/static/src/js/website.js b/addons/website/static/src/js/website.js index 1f4e54b43df..963a0b1664d 100644 --- a/addons/website/static/src/js/website.js +++ b/addons/website/static/src/js/website.js @@ -38,7 +38,12 @@ return $.when.apply(null, dones); }; website.reload = function () { - window.location.href = window.location.href.replace(/unable_editor(=[^&]*)?|#.*/g, ''); + location.hash = "scrollTop=" + window.document.body.scrollTop; + if (location.search.indexOf("unable_editor") > -1) { + window.location.href = window.location.href.replace(/unable_editor(=[^&]*)?/g, ''); + } else { + window.location.reload(); + } }; var all_ready = null; @@ -167,6 +172,11 @@ website.init_kanban(this); }); + setTimeout(function () { + if (window.location.hash.indexOf("scrollTop=") > -1) { + window.document.body.scrollTop = +location.hash.match(/scrollTop=([0-9]+)/)[1]; + } + },0); }); return website; diff --git a/addons/website/static/src/js/website.seo.js b/addons/website/static/src/js/website.seo.js index 0d20253290a..342837f43c1 100644 --- a/addons/website/static/src/js/website.seo.js +++ b/addons/website/static/src/js/website.seo.js @@ -241,7 +241,8 @@ return hashIndex >= 0 ? url.substring(0, hashIndex) : url; }, title: function () { - return ($('title').length > 0) && $('title').text() && $('title').text().trim(); + var $title = $('title'); + return ($title.length > 0) && $title.text() && $title.text().trim(); }, changeTitle: function (title) { // TODO create tag if missing @@ -250,7 +251,7 @@ }, description: function () { var $description = $('meta[name=description]'); - return ($description.length > 0) && $description.attr('value') && $description.attr('value').trim(); + return ($description.length > 0) && ($description.attr('value') && $description.attr('value').trim()); }, changeDescription: function (description) { // TODO create tag if missing @@ -322,6 +323,9 @@ 'click button[data-action=update]': 'update', 'hidden.bs.modal': 'destroy', }, + canEditTitle: false, + canEditDescription: false, + canEditKeywords: false, maxTitleSize: 65, maxDescriptionSize: 155, start: function () { @@ -331,13 +335,13 @@ $modal.find('.js_seo_page_url').text(htmlPage.url()); $modal.find('input[name=seo_page_title]').val(htmlPage.title()); $modal.find('textarea[name=seo_page_description]').val(htmlPage.description()); - self.suggestImprovements(); - self.imageList = new website.seo.ImageList(self, { page: htmlPage }); - if (htmlPage.images().length === 0) { - $modal.find('.js_image_section').remove(); - } else { - self.imageList.appendTo($modal.find('.js_seo_image_list')); - } + // self.suggestImprovements(); + // self.imageList = new website.seo.ImageList(self, { page: htmlPage }); + // if (htmlPage.images().length === 0) { + // $modal.find('.js_image_section').remove(); + // } else { + // self.imageList.appendTo($modal.find('.js_seo_image_list')); + // } self.keywordList = new website.seo.KeywordList(self, { page: htmlPage }); self.keywordList.on('list-full', self, function () { $modal.find('input[name=seo_page_keywords]') @@ -356,8 +360,27 @@ self.keywordList.add(word); }); self.keywordList.appendTo($modal.find('.js_seo_keywords_list')); + self.disableUnsavableFields(); $modal.modal(); }, + disableUnsavableFields: function () { + var self = this; + var $modal = self.$el; + self.loadMetaData().then(function (data) { + self.canEditTitle = data && ('website_meta_title' in data); + self.canEditDescription = data && ('website_meta_description' in data); + self.canEditKeywords = data && ('website_meta_keywords' in data); + if (!self.canEditTitle) { + $modal.find('input[name=seo_page_title]').attr('disabled', true); + } + if (!self.canEditDescription) { + $modal.find('textarea[name=seo_page_description]').attr('disabled', true); + } + if (!self.canEditTitle && !canEditDescription && !canEditKeywords) { + $modal.find('button[data-action=update]').attr('disabled', true); + } + }); + }, suggestImprovements: function () { var tips = []; var self = this; @@ -397,11 +420,16 @@ }, update: function () { var self = this; - var data = { - website_meta_title: self.htmlPage.title(), - website_meta_description: self.htmlPage.description(), - website_meta_keywords: self.keywordList.keywords().join(", "), - }; + var data = {}; + if (self.canEditTitle) { + data.website_meta_title = self.htmlPage.title(); + } + if (self.canEditDescription) { + data.website_meta_description = self.htmlPage.description(); + } + if (self.canEditKeywords) { + data.website_meta_keywords = self.keywordList.keywords().join(", "); + } self.saveMetaData(data).then(function () { self.$el.modal('hide'); }); diff --git a/addons/website/static/src/js/website.snippets.js b/addons/website/static/src/js/website.snippets.js index e4e41e802fa..17dd829708f 100644 --- a/addons/website/static/src/js/website.snippets.js +++ b/addons/website/static/src/js/website.snippets.js @@ -24,6 +24,7 @@ }, save: function () { this.snippets.make_active(false); + this.snippets.clean_for_save(); remove_added_snippet_id(); this._super(); }, @@ -44,7 +45,14 @@ /* ----- SNIPPET SELECTOR ---- */ website.snippet = {}; - + var observer = new website.Observer(function (mutations) { + if (!_(mutations).find(function (m) { + return m.type === 'childList' && m.addedNodes.length > 0; + })) { + return; + } + hack_to_add_snippet_id() + }); // puts $el at the same absolute position as $target function hack_to_add_snippet_id () { @@ -78,7 +86,12 @@ } this.$active_snipped_id = false; hack_to_add_snippet_id(); - $("body").on('DOMNodeInserted', hack_to_add_snippet_id); + this.snippets = []; + + observer.observe(document.body, { + childList: true, + subtree: true, + }); }, dom_filter: function (dom, sibling) { if (typeof dom === "string") { @@ -206,6 +219,14 @@ } } }, + clean_for_save: function () { + for (var k in this.snippets) { + var editor = $(this.snippets[k]).data("snippet-editor"); + if (editor) { + editor.clean_for_save(); + } + } + }, make_active: function ($snipped_id) { if ($snipped_id && this.$active_snipped_id && this.$active_snipped_id.get(0) === $snipped_id.get(0)) { return; @@ -214,6 +235,9 @@ this.snippet_blur(this.$active_snipped_id); } if ($snipped_id) { + if(_.indexOf(this.snippets, $snipped_id.get(0)) === -1) { + this.snippets.push($snipped_id.get(0)); + } this.$active_snipped_id = $snipped_id; this.create_overlay(this.$active_snipped_id); this.snippet_focus($snipped_id); @@ -295,17 +319,32 @@ } + var $dark = $(openerp.qweb.render('website.snippet_dark_for_dropzone')) + .css('height', $("body")[0].scrollHeight + 'px'); + $("body").append($dark); + $('.oe_drop_zone').droppable({ over: function(){ if( action === 'insert'){ dropped = true; - $(this).first().after($toInsert); + $(this).first().addClass("oe_drop_active").after($toInsert); + $dark.find("td:first") + .css('height', $toInsert.offset().top+'px'); + $dark.find("tr:eq(1) td:first") + .css('width', $toInsert.offset().left+'px'); + $dark.find("td.center") + .addClass("active") + .css('height', $toInsert.outerHeight()+'px') + .css('width', $toInsert.outerWidth()+'px'); } }, out: function(){ if( action === 'insert'){ + $(this).removeClass("oe_drop_active"); dropped = false; $toInsert.detach(); + $dark.find("td.center").removeClass("active"); + $("body").scroll(); // trigger a scroll to reset position for jquery api } }, drop: function(){ @@ -314,15 +353,8 @@ }); }, stop: function(ev, ui){ - if (action === 'insert' && ! dropped) { - var el = $('.oe_drop_zone').nearest({x: ui.position.left, y: ui.position.top}).first() - if (el) { - el.after($toInsert) - dropped = true; - } - } - $('.oe_drop_zone').droppable('destroy').remove(); + $("#dark_for_dropzone").remove(); if (dropped) { var $target = false; if(action === 'insert'){ @@ -373,7 +405,7 @@ var sibling_selector = selector.siblings; var vertical_child_selector = selector.vertical_children; - var zone_template = "<div class='oe_drop_zone oe_insert'></div>"; + var zone_template = openerp.qweb.render('website.snippet_drop_zone'); if(child_selector){ self.dom_filter(child_selector).each(function (){ @@ -393,7 +425,7 @@ var temp_left = 0; $zone.find('> *:not(.oe_drop_zone):visible').each(function () { var $col = $(this); - $template.css('height', ($col.outerHeight() + parseInt($col.css("margin-top")) + parseInt($col.css("margin-bottom")))+'px'); + $template.css('height', ($col.outerHeight() + parseInt($col.css("margin-top")) + parseInt($col.css("margin-bottom")) - 8)+'px'); $lastinsert = $template.clone(); $(this).after($lastinsert); @@ -562,7 +594,8 @@ * Displayed into the overlay options on focus */ _readXMLData: function() { - this.$el = this.parent.$snippets.siblings("[data-snippet-id='"+this.snippet_id+"']").clone(); + var self = this; + this.$el = this.parent.$snippets.filter(function () { return $(this).data("snippet-id") == self.snippet_id; }).clone(); this.$editor = this.$el.find(".oe_snippet_options"); var $options = this.$overlay.find(".oe_overlay_options"); this.$editor.prependTo($options.find(".oe_options ul")); @@ -597,18 +630,28 @@ }); }, _drag_and_drop_after_insert_dropzone: function (){}, - _drag_and_drop_active_drop_zone: function ($zones){ + _drag_and_drop_active_drop_zone: function (){ var self = this; - $zones.droppable({ + var $dark = $("#dark_for_dropzone"); + $('.oe_drop_zone').droppable({ over: function(){ - $(".oe_drop_zone.hide").removeClass("hide"); - $(this).addClass("hide").first().after(self.$target); + $(this).first().addClass("oe_drop_active").after(self.$target); + $dark.find("td:first") + .css('height', self.$target.offset().top+'px'); + $dark.find("tr:eq(1) td:first") + .css('width', self.$target.offset().left+'px'); + $dark.find("td.center") + .addClass("active") + .css('height', self.$target.outerHeight()+'px') + .css('width', self.$target.outerWidth()+'px'); self.dropped = true; }, out: function(){ - $(this).removeClass("hide"); + $(this).removeClass("oe_drop_active"); + $dark.find("td.center").removeClass("active"); self.$target.detach(); self.dropped = false; + $("body").scroll(); // trigger a scroll to reset position for jquery api }, }); }, @@ -632,8 +675,12 @@ $("body").addClass('move-important'); + var $dark = $(openerp.qweb.render('website.snippet_dark_for_dropzone')) + .css('height', $("body")[0].scrollHeight + 'px'); + $("body").append($dark); + self._drag_and_drop_after_insert_dropzone(); - self._drag_and_drop_active_drop_zone($('.oe_drop_zone')); + self._drag_and_drop_active_drop_zone(); }, _drag_and_drop_stop: function (){ var self = this; @@ -643,6 +690,7 @@ self.$overlay.removeClass("hidden"); $("body").removeClass('move-important'); $('.oe_drop_zone').droppable('destroy').remove(); + $('#dark_for_dropzone').remove(); $(".oe_drop_clone, .oe_drop_to_remove").remove(); self.parent.editor_busy = false; self.get_parent_block(); @@ -718,8 +766,9 @@ start: function () { var self = this; this.$overlay.on('click', '.oe_snippet_remove', function () { - self.$target.detach(); self.onBlur(); + var index = _.indexOf(self.parent.snippets, self.$target.get(0)); + delete self.parent.snippets[index]; self.$target.remove(); return false; }); @@ -749,10 +798,18 @@ this.$overlay.removeClass('oe_active'); }, + /* clean_for_save + * function called just before save vue + */ + clean_for_save: function () { + + }, + change_background: function (bg, ul_options) { var self = this; this.set_options_background(bg, ul_options); var $ul = this.$editor.find(ul_options); + var bg_value = (typeof bg === 'string' ? this.$target.find(bg) : $(bg)).css("background-image").replace(/url\(['"]*|['"]*\)/g, ""); // bind envent on options var $li = $ul.find("li"); @@ -931,23 +988,25 @@ _drag_and_drop_after_insert_dropzone: function(){ var self = this; - var $zones = $(".row:has(> .oe_drop_zone)").each(function () { - var $row = $(this); - var width = $row.innerWidth(); - var pos = 0; - while (width > pos + self.size.width) { - var $last = $row.find("> .oe_drop_zone:last"); - $last.each(function () { - pos = $(this).position().left; - }); - if (width > pos + self.size.width) { - $row.append("<div class='col-md-1 oe_drop_to_remove'/>"); - var $add_drop = $last.clone(); - $row.append($add_drop); - self._drag_and_drop_active_drop_zone($add_drop); - } - } - }); + // commented for perf + + // var $zones = $(".row:has(> .oe_drop_zone)").each(function () { + // var $row = $(this); + // var width = $row.innerWidth(); + // var pos = 0; + // while (width > pos + self.size.width) { + // var $last = $row.find("> .oe_drop_zone:last"); + // $last.each(function () { + // pos = $(this).position().left; + // }); + // if (width > pos + self.size.width) { + // $row.append("<div class='col-md-1 oe_drop_to_remove'/>"); + // var $add_drop = $last.clone(); + // $row.append($add_drop); + // self._drag_and_drop_active_drop_zone($add_drop); + // } + // } + // }); }, _drag_and_drop_start: function () { this._super(); @@ -983,6 +1042,11 @@ }, }); + website.snippet.animationRegistry.carousel = website.snippet.Animation.extend({ + start: function () { + this.$target.carousel(); + }, + }); website.snippet.editorRegistry.carousel = website.snippet.editorRegistry.resize.extend({ build_snippet: function() { var id = 0; @@ -1005,6 +1069,13 @@ this._super(); this.$target.carousel('cycle'); }, + clean_for_save: function () { + this._super(); + this.$target.find(".item").removeClass("next prev left right"); + if(!this.$target.find(".item.active").length) { + this.$target.find(".item:first").addClass("active"); + } + }, start : function () { this._super(); @@ -1029,18 +1100,14 @@ self.$target.carousel(); }); - this.$target.on('dblclick', '.item.active .carousel-image img', function (event) { - $('#oe_rte_toolbar .cke_button__image .cke_button__image_icon').click(); - }); - this.rebind_event(); }, // rebind event to active carousel on edit mode rebind_event: function () { var self = this; - this.$target.on('click', '.carousel-control', function () { + this.$target.off('click').on('click', '.carousel-control', function () { self.$target.carousel($(this).data('slide')); }); - this.$target.on('click', '.carousel-indicators [data-target]', function () { + this.$target.off('click').on('click', '.carousel-indicators [data-target]', function () { self.$target.carousel(+$(this).data('slide-to')); }); }, on_add: function (e) { @@ -1050,8 +1117,13 @@ var index = $active.index(); this.$target.find('.carousel-control, .carousel-indicators').removeClass("hidden"); this.$indicators.append('<li data-target="#' + this.id + '" data-slide-to="' + cycle + '"></li>'); - $active.clone().removeClass('active').insertAfter($active); + + var $clone = this.$el.find(".item.active").clone(); + var bg = this.$editor.find('ul[name="carousel-background"] li:not([data-value="'+ $active.css("background-image").replace(/.*:\/\/[^\/]+|\)$/g, '') +'"]):first').data("value"); + $clone.css("background-image", "url('"+ bg +"')"); + $clone.removeClass('active').insertAfter($active); this.$target.carousel().carousel(++index); + this.rebind_event(); }, on_remove: function (e) { e.preventDefault(); @@ -1068,7 +1140,8 @@ }); setTimeout(function () { new_index = index % cycle; - self.$target.carousel( new_index + 1 ); + self.$target.carousel().carousel( new_index + 1 ); + self.rebind_event(); }, 500); } else { this.$target.find('.carousel-control, .carousel-indicators').addClass("hidden"); diff --git a/addons/website/static/src/xml/website.seo.xml b/addons/website/static/src/xml/website.seo.xml index 96a38a75d32..580779283ad 100644 --- a/addons/website/static/src/xml/website.seo.xml +++ b/addons/website/static/src/xml/website.seo.xml @@ -48,12 +48,13 @@ </div> </div> </section> + <!-- <section class="js_image_section"> <h3 class="page-header">3. Describe your images</h3> <div class="row js_seo_image_list"> - <!-- filled in JS --> </div> </section> + --> </div><div class="modal-footer"> <button data-action="discard" data-dismiss="modal" href="#" class="btn btn-default">Discard</button> <button type="button" data-action="update" class="btn btn-primary">Apply Changes</button> diff --git a/addons/website/static/src/xml/website.snippets.xml b/addons/website/static/src/xml/website.snippets.xml index e5dde368154..6aaf256b523 100644 --- a/addons/website/static/src/xml/website.snippets.xml +++ b/addons/website/static/src/xml/website.snippets.xml @@ -31,8 +31,8 @@ this one: </p> <div class="row"> - <div class="col-sm-4 col-sm-offset-4 oe_drop_zone_style text-center"> - <span class="mt16">drop in this zone</span> + <div class="col-sm-6 col-sm-offset-3 oe_drop_zone_style text-center"> + <div>drop in this zone</div> </div> </div> <div class="text-muted"> @@ -57,6 +57,25 @@ <div id='oe_snippets'></div> </t> + <t t-name="website.snippet_drop_zone"> + <div class='oe_drop_zone oe_insert'> + <div>Drag your block here (move your mouse in this zone)</div> + <div class="oe_active">Drop your block</div> + </div> + </t> + + <t t-name="website.snippet_dark_for_dropzone"> + <div id="dark_for_dropzone"> + <table width="100%" height="100%"> + <tbody> + <tr><td colspan="3"></td></tr> + <tr><td></td><td class="center"></td><td></td></tr> + <tr><td colspan="3"></td></tr> + </tbody> + </table> + </div> + </t> + <t t-name="website.snippet_overlay"> <div class="oe_overlay"> <div class="oe_overlay_options"> diff --git a/addons/website/static/src/xml/website.xml b/addons/website/static/src/xml/website.xml index b3e4cacd32a..409d73f1f27 100644 --- a/addons/website/static/src/xml/website.xml +++ b/addons/website/static/src/xml/website.xml @@ -35,7 +35,7 @@ </ul> </li> <li> - <a href="/admin#action=website.action_module_website">Apps</a> + <a href="/web#action=website.action_module_website">Apps</a> </li> </ul> </div> diff --git a/addons/website/views/snippets.xml b/addons/website/views/snippets.xml index f1292663426..a351e07d4fd 100644 --- a/addons/website/views/snippets.xml +++ b/addons/website/views/snippets.xml @@ -78,7 +78,7 @@ </p> </div> <div class="carousel-image hidden-xs"> - <img src="/website/static/src/img/banner/banner_picture.png" alt="Banner OpenERP Image"/> + <img src="/website/static/src/img/banner/banner_picture.png" contenteditable="true" alt="Banner OpenERP Image"/> </div> </div> </div> diff --git a/addons/website/views/website_templates.xml b/addons/website/views/website_templates.xml index f56a6148c25..e8876c89151 100644 --- a/addons/website/views/website_templates.xml +++ b/addons/website/views/website_templates.xml @@ -29,8 +29,10 @@ </t> <title><t t-esc="title"/></title> <meta name="openerp.company" t-att-value="res_company.name"/> - <meta name="description" t-att-value="main_object and main_object.website_meta_description or website_meta_description"/> - <meta name="keywords" t-att-value="main_object and main_object.website_meta_keywords or website_meta_keywords"/> + <meta name="description" t-att-value="main_object and 'website_meta_description' in main_object + and main_object.website_meta_description or website_meta_description"/> + <meta name="keywords" t-att-value="main_object and 'website_meta_keywords' in main_object + and main_object.website_meta_keywords or website_meta_keywords"/> <!-- Load stylesheets before scripts to avoid blocking --> <link rel='stylesheet' href='/web/static/lib/fontawesome/css/font-awesome.css'/> @@ -93,8 +95,8 @@ <div class="collapse navbar-collapse navbar-top-collapse"> <ul class="nav navbar-nav navbar-right" id="top_menu"> <li name="contactus"><a t-href="/page/website.contactus">Contact us</a></li> - <li t-if="user_id.id == website.public_user.id"><a href="/admin">Sign in</a></li> - <li t-if="user_id.id != website.public_user.id"><a href="/admin"><span t-field="user_id.name"/></a></li> + <li t-if="user_id.id == website.public_user.id"><a href="/web">Sign in</a></li> + <li t-if="user_id.id != website.public_user.id"><a href="/web"><span t-field="user_id.name"/></a></li> <li t-if="request.multilang and (len(website.language_ids) > 1 or editable)" class="dropdown"> <!-- TODO: use flags for language selection --> @@ -235,7 +237,7 @@ </ul> </div> <t t-if="publish_edit"> - <a class="btn btn-xs btn-default" title="Edit in backend" t-att-href="'/admin/#model=%s&id=%s' % (object._name, object.id)"><span t-attf-class="glyphicon glyphicon-wrench"></span></a> + <a class="btn btn-xs btn-default" title="Edit in backend" t-att-href="'/web#model=%s&id=%s' % (object._name, object.id)"><span t-attf-class="glyphicon glyphicon-wrench"></span></a> </t> </div> </t> diff --git a/addons/website_blog/controllers/main.py b/addons/website_blog/controllers/main.py index 7d40e080636..81b0610cb11 100644 --- a/addons/website_blog/controllers/main.py +++ b/addons/website_blog/controllers/main.py @@ -150,6 +150,13 @@ class WebsiteBlog(http.Controller): 'unable_editor': post.get('unable_editor') } + if blog_post: + values['main_object'] = blog_post + elif tag: + values['main_object'] = tag + elif category: + values['main_object'] = category + return request.website.render("website_blog.index", values) @website.route(['/blog/nav'], type='http', auth="public") @@ -178,7 +185,7 @@ class WebsiteBlog(http.Controller): url = request.httprequest.host_url request.session.body = post.get('body') if request.context['is_public_user']: # purpose of this ? - return '%s/admin#action=redirect&url=%s/blog/%s/post' % (url, url, blog_post_id) + return '%s/web#action=redirect&url=%s/blog/%s/post' % (url, url, blog_post_id) if request.session.get('body') and blog_post_id: request.registry['blog.post'].message_post( diff --git a/addons/website_blog/models/website_blog.py b/addons/website_blog/models/website_blog.py index b1d188bf8cc..9f4a214a8b9 100644 --- a/addons/website_blog/models/website_blog.py +++ b/addons/website_blog/models/website_blog.py @@ -41,6 +41,9 @@ class BlogCategory(osv.Model): 'blog.post', 'category_id', 'Blogs', ), + 'website_meta_title': fields.char("Website meta title", size=70, translate=True), + 'website_meta_description': fields.text("Website meta description", size=160, translate=True), + 'website_meta_keywords': fields.char("Website meta keywords", translate=True), } @@ -54,6 +57,9 @@ class BlogTag(osv.Model): 'blog_post_ids': fields.many2many( 'blog.post', string='Posts', ), + 'website_meta_title': fields.char("Website meta title", size=70, translate=True), + 'website_meta_description': fields.text("Website meta description", size=160, translate=True), + 'website_meta_keywords': fields.char("Website meta keywords", translate=True), } @@ -144,6 +150,9 @@ class BlogPost(osv.Model): 'res.users', 'Last Contributor', select=True, readonly=True, ), + 'website_meta_title': fields.char("Website meta title", size=70, translate=True), + 'website_meta_description': fields.text("Website meta description", size=160, translate=True), + 'website_meta_keywords': fields.char("Website meta keywords", translate=True), } def create_history(self, cr, uid, ids, vals, context=None): diff --git a/addons/website_event/controllers/main.py b/addons/website_event/controllers/main.py index 54091a0fbb2..16b76c58213 100644 --- a/addons/website_event/controllers/main.py +++ b/addons/website_event/controllers/main.py @@ -154,9 +154,10 @@ class website_event(http.Controller): @website.route(['/event/<int:event_id>'], type='http', auth="public", multilang=True) def event(self, event_id=None, **post): event_obj = request.registry['event.event'] + event = event_obj.browse(request.cr, request.uid, event_id, dict(request.context, show_address_only=1)) values = { - 'event_id': event_obj.browse(request.cr, request.uid, event_id, - dict(request.context, show_address_only=1)), + 'event_id': event, + 'main_object': event, 'range': range, 'float': float, } diff --git a/addons/website_event/models/event.py b/addons/website_event/models/event.py index 0362b5845b7..237b0fcead2 100644 --- a/addons/website_event/models/event.py +++ b/addons/website_event/models/event.py @@ -45,6 +45,9 @@ class event(osv.osv): string='Website Messages', help="Website communication history", ), + 'website_meta_title': fields.char("Website meta title", size=70, translate=True), + 'website_meta_description': fields.text("Website meta description", size=160, translate=True), + 'website_meta_keywords': fields.char("Website meta keywords", translate=True), } _defaults = { 'website_published': False, diff --git a/addons/website_sale/models/product.py b/addons/website_sale/models/product.py index 04ebbeaf39e..f48464335eb 100644 --- a/addons/website_sale/models/product.py +++ b/addons/website_sale/models/product.py @@ -50,6 +50,9 @@ class product_template(osv.Model): 'website_style_ids' : fields.many2many('website.product.style','product_website_style_rel', 'product_id', 'style_id', 'Styles'), 'website_sequence': fields.integer('Sequence', help="Determine the display order in the Website E-commerce"), 'website_url': fields.function(_website_url, string="Website url"), + 'website_meta_title': fields.char("Website meta title", size=70, translate=True), + 'website_meta_description': fields.text("Website meta description", size=160, translate=True), + 'website_meta_keywords': fields.char("Website meta keywords", translate=True), } _defaults = { 'website_size_x': 1, diff --git a/addons/website_sale/views/website_sale.xml b/addons/website_sale/views/website_sale.xml index b458c36aa0e..a263a01ed2e 100644 --- a/addons/website_sale/views/website_sale.xml +++ b/addons/website_sale/views/website_sale.xml @@ -623,7 +623,7 @@ <div class="col-md-8 oe_mycart"> <h3 class="page-header mt16">Set Billing Information <small t-if="user_id.id == website.public_user.id"> or - <a t-if="not partner" t-attf-href="/admin#action=redirect&url=#{ request.httprequest.host_url }/shop/checkout/">sign in</a> + <a t-if="not partner" t-attf-href="/web#action=redirect&url=#{ request.httprequest.host_url }/shop/checkout/">sign in</a> </small> </h3> <div class="row"> |
