sniipet hack hgack

bzr revid: al@openerp.com-20130702221104-if76w1j5bu3tjest
This commit is contained in:
Antony Lesuisse 2013-07-03 00:11:04 +02:00
parent 0fe15910da
commit a415c9c39b
3 changed files with 57 additions and 37 deletions

View File

@ -1,3 +1,4 @@
/*
.oe_snippet_demo .oe_page{
margin-top: 50px;
margin-bottom: 300px;
@ -25,7 +26,7 @@
z-index: 800;
pointer-events :none;
color: white;
text-shadow: none; /* 0px 1px 3px black; */
text-shadow: none;
font-size: 14px;
line-height: 20px;
text-align: center;
@ -49,6 +50,8 @@
overflow-y: hidden;
overflow-x: scroll;
}
*/
.oe_snippet_list{
width: auto;
white-space: nowrap;
@ -74,8 +77,11 @@
user-select: none;
white-space: normal;
}
.oe_snippet_editor .oe_snippet:after{
content: attr(name); /*attr('name');*/
content: attr(name);
position: absolute;
bottom: 0px;
left: 0px;

View File

@ -71,12 +71,24 @@ instance.website.EditorBar = instance.web.Widget.extend({
$snippet = $(ev.currentTarget);
$snippet.addClass('oe_selected');
$snippet.draggable();
debugger;
selector = $snippet.data("selector");
zone = $(".oe_website_body " + selector);
var droppable = '<div class="oe_snippet_drop" style="border:1px solid red;">.<br/>.<br/>.<br/>.<br/>.<br/></div>';
zone.before(droppable);
zone.after(droppable);
$(".oe_snippet_drop").droppable({
drop: function( event, ui ) {
console.log(event, ui, "DROP");
target = $(event.target);
target.before($snippet.html());
$('.oe_selected').remove();
$('.oe_snippet_drop').remove();
}
});
});
},
snippet: function (ev) {
console.log(ev);
$('.oe_snippet_editor').show();
},
});

View File

@ -141,7 +141,7 @@
<a href="http://www.openerp.com/start" class="oe_button oe_big oe_tacky">Start your <span class="oe_emph">free</span> trial</a>
</div>
</div>
<div class='oe_snippet' name='Alternate Paragraph' selafter='.oe_container'>
<div class='oe_snippet' name='Alternate Paragraph' data-selector=".oe_container">
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<div class="oe_span12">
@ -189,40 +189,42 @@
<field name="type">qweb</field>
<field name="arch" type="xml">
<t t-call="website.layout">
<section class="oe_container">
<div class="oe_row oe_spaced oe_dark">
<div class="oe_span12">
<h2 class="oe_slogan">I'm your home page, please edit me...</h2>
<h3 class="oe_slogan">I'm a motto please edit me...</h3>
</div>
<div class="oe_span6">
<div class="oe_demo oe_picture oe_screenshot">
<a href="#">
<img src="https://www.openerp.com/apps/point_of_sale/pos_sc_02.jpg"/>
</a>
<div>
<section class="oe_container">
<div class="oe_row oe_spaced oe_dark">
<div class="oe_span12">
<h2 class="oe_slogan">I'm your home page, please edit me...</h2>
<h3 class="oe_slogan">I'm a motto please edit me...</h3>
</div>
<div class="oe_span6">
<div class="oe_demo oe_picture oe_screenshot">
<a href="#">
<img src="https://www.openerp.com/apps/point_of_sale/pos_sc_02.jpg"/>
</a>
</div>
</div>
<div class="oe_span6">
<p class='oe_mt32'>
Here you can describoe you company...
OpenERP's Point of Sale introduces a super
clean interface with no installation required
that runs online and offline on modern
hardwares.
</p>
<p>
It's full integration with the company
inventory and accounting, gives you real time
statistics and consolidations amongst all shops
without the hassle of integrating several
applications.
</p>
<div class="oe_centeralign oe_websiteonly">
<a href="http://www.openerp.com/start" class="oe_button oe_big oe_tacky">Start your <span class="oe_emph">free</span> trial</a>
</div>
</div>
</div>
<div class="oe_span6">
<p class='oe_mt32'>
Here you can describoe you company...
OpenERP's Point of Sale introduces a super
clean interface with no installation required
that runs online and offline on modern
hardwares.
</p>
<p>
It's full integration with the company
inventory and accounting, gives you real time
statistics and consolidations amongst all shops
without the hassle of integrating several
applications.
</p>
<div class="oe_centeralign oe_websiteonly">
<a href="http://www.openerp.com/start" class="oe_button oe_big oe_tacky">Start your <span class="oe_emph">free</span> trial</a>
</div>
</div>
</div>
</section>
</section>
</div>
<div class="container">
<div class="row">