[ADD]: automatically generate a menu from h1 and h2 tag in the content
bzr revid: aja@tinyerp.com-20140107134220-nhff7fw6bpz8jhjb
This commit is contained in:
parent
ef23e7d8bc
commit
7565880648
|
@ -297,7 +297,7 @@
|
|||
<field name="price_unit">12950.00</field>
|
||||
<field name="website_description" type="html">
|
||||
<section data-snippet-id="title">
|
||||
<h2>Online Training + Certification</h2>
|
||||
<h1>Online Training + Certification</h1>
|
||||
</section>
|
||||
<section data-snippet-id="text-image">
|
||||
<div class="row">
|
||||
|
@ -339,6 +339,9 @@
|
|||
<field name="product_uom_qty">1</field>
|
||||
<field name="price_unit">00.00</field>
|
||||
<field name="website_description" type="html">
|
||||
<section data-snippet-id="title">
|
||||
<h1>Technical Training</h1>
|
||||
</section>
|
||||
<section id="whatsuit" data-snippet-id="text-block">
|
||||
<div class="row">
|
||||
<div class="col-md-12 mt32">
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
.affix {
|
||||
width : 260px;
|
||||
}
|
|
@ -22,5 +22,32 @@ $(document).ready(function () {
|
|||
});
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
// automatically generate a menu from h1 and h1 tag in content
|
||||
var ul = null;
|
||||
var sub_li = null;
|
||||
var sub_ul = null;
|
||||
|
||||
$("section h1, section h2").each(function() {
|
||||
switch (this.tagName.toLowerCase()) {
|
||||
case "h1":
|
||||
if (!ul) {
|
||||
ul = $('[data-id="quote_sidebar"]');
|
||||
}
|
||||
sub_li = $("<li>").html('<label class="nav-header">'+$(this).text()+'</label>').appendTo(ul);
|
||||
sub_ul = null;
|
||||
break;
|
||||
case "h2":
|
||||
id = _.uniqueId('quote_')
|
||||
if (sub_li) {
|
||||
if (!sub_ul) {
|
||||
sub_ul = $("<ul class='nav nav-pills nav-stacked nav-hierarchy'>").appendTo(sub_li);
|
||||
}
|
||||
$(this).attr('id',id)
|
||||
$("<li>").html('<a href="#'+id+'">'+$(this).text()+'</a>').appendTo(sub_ul);
|
||||
}
|
||||
break;
|
||||
}
|
||||
});
|
||||
//vim:et fdc=0 fdl=0 foldnestmax=3 fdm=syntax:
|
||||
});
|
||||
|
|
|
@ -121,166 +121,158 @@
|
|||
<t t-call="website.layout">
|
||||
<t t-set="head">
|
||||
<script type="text/javascript" src="/website_quotation/static/src/js/website_quotation.js"></script>
|
||||
<link rel='stylesheet' href='/website_quotation/static/src/css/website_quotation.css'/>
|
||||
<t t-raw="head or ''"/>
|
||||
</t>
|
||||
<div class="container">
|
||||
<div class="row mt16">
|
||||
<div class="col-md-3 navbar hidden-print">
|
||||
<ul class="nav nav-pills nav-stacked mt32">
|
||||
<li class="active">
|
||||
<a href="#introduction" data-toggle="tab">Introduction</a>
|
||||
</li>
|
||||
<li t-foreach="quotation.order_line" t-as="line">
|
||||
<a t-att-href="'#%s'% line.id" data-toggle="tab">
|
||||
<t t-raw="line.product_id.name"/>
|
||||
</a>
|
||||
</li>
|
||||
<li><a href="#quote" data-toggle="tab">Pricing</a></li>
|
||||
<li><a href="#terms" data-toggle="tab">Terms & Conditions</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
|
||||
<div class="text-center hidden-print">
|
||||
<div class="btn-group btn-group-lg" t-if="quotation.state in ('draft', 'sent', 'waiting_date')">
|
||||
<a class="btn btn-success fa fa-check" data-toggle="modal" data-target="#modelaccept">
|
||||
Accept
|
||||
</a>
|
||||
<a class="btn btn-info fa fa-comment" type="submit" href="#chat">
|
||||
Feedback
|
||||
</a>
|
||||
<a class="btn btn-danger fa fa-times" data-toggle="modal" data-target="#modeldecline">
|
||||
Refuse
|
||||
</a>
|
||||
</div>
|
||||
<body data-spy="scroll" data-target=".nav">
|
||||
<div class="container">
|
||||
<div class="row mt16">
|
||||
<div class="col-md-3">
|
||||
<ul class="nav" data-id="quote_sidebar" data-offset-top="60" data-offset-bottom="110" data-spy="affix"/>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
|
||||
<h1 class="page-header">
|
||||
<span t-if="quotation.state in ('draft','sent','cancel')">Your Quotation</span>
|
||||
<span t-if="quotation.state not in ('draft','sent','cancel')">Your Order</span>
|
||||
<em t-esc="quotation.name"/>
|
||||
<small t-field="quotation.state"/>
|
||||
</h1>
|
||||
|
||||
<div class="modal fade" id="modelaccept" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
|
||||
<h4 class="modal-title">Please confirm you accept this order:</h4>
|
||||
</div>
|
||||
<form id="accept" method="POST" t-attf-action="/quote/#{quotation.id}/#{quotation.access_token}/accept">
|
||||
<div class="modal-body">
|
||||
<dl class="dl-horizontal">
|
||||
<dt><h4>Your Name : </h4></dt>
|
||||
<dd><h4 t-esc="quotation.partner_id.name"></h4></dd>
|
||||
<dt><h4>Price : </h4></dt>
|
||||
<dd><h4 data-id="total_amount" t-field="quotation.amount_total" t-field-options='{"widget": "monetary","display_currency": "quotation.pricelist_id.currency_id"}'/></dd>
|
||||
<dt><h4>Payment Term : </h4></dt>
|
||||
<dd><h4 t-esc="quotation.payment_term.name"></h4></dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="submit" class="btn btn-success">Validate Order</button>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Discard</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="alert alert-warning alert-dismissable" t-if="quotation.state == 'cancel'">
|
||||
<button type="button" class="close hidden-print" data-dismiss="alert" aria-hidden="true">&times;</button>
|
||||
<strong>This quotation has been canceled.</strong> Contact <p t-field="quotation.user_id"/> to ask a new one.
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="modeldecline" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
|
||||
<h4 class="modal-title">Reason</h4>
|
||||
</div>
|
||||
<form id="decline" method="POST" t-attf-action="/quote/#{quotation.id}/#{quotation.access_token}/decline">
|
||||
<div class="modal-body">
|
||||
<textarea rows="3" name="decline_message" placeholder="Your Comment....." class="form-control"> </textarea>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
||||
<button type="submit" t-att-id="quotation.id" class="btn btn-info">Post</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a id="introduction"/>
|
||||
<div class="row mt32">
|
||||
<div class="col-md-6">
|
||||
<div>
|
||||
<label class="col-sm-3 text-right">Bill To:</label>
|
||||
<div class="col-sm-9">
|
||||
<div t-field="quotation.partner_invoice_id" t-field-options='{
|
||||
"widget": "contact",
|
||||
"fields": ["address", "name", "phone", "email"]
|
||||
}'/>
|
||||
</div>
|
||||
</div>
|
||||
<div t-if="quotation.partner_shipping_id.id != quotation.partner_invoice_id.id">
|
||||
<label class="col-sm-3 text-right">Ship To:</label>
|
||||
<div class="col-sm-9">
|
||||
<div t-field="quotation.partner_shipping_id" t-field-options='{
|
||||
"widget": "contact",
|
||||
"fields": ["address", "name", "phone"]
|
||||
}'/>
|
||||
</div>
|
||||
<div class="text-center hidden-print">
|
||||
<div class="btn-group btn-group-lg" t-if="quotation.state in ('draft', 'sent', 'waiting_date')">
|
||||
<a class="btn btn-success fa fa-check" data-toggle="modal" data-target="#modelaccept">
|
||||
Accept
|
||||
</a>
|
||||
<a class="btn btn-info fa fa-comment" type="submit" href="#discussion">
|
||||
Feedback
|
||||
</a>
|
||||
<a class="btn btn-danger fa fa-times" data-toggle="modal" data-target="#modeldecline">
|
||||
Refuse
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="row">
|
||||
<label class="col-sm-5 text-right">Your Contact:</label>
|
||||
<div class="col-sm-7">
|
||||
<div t-field="quotation.user_id" t-field-options='{
|
||||
"widget": "contact",
|
||||
"fields": ["name", "phone", "email"]
|
||||
}'/>
|
||||
|
||||
<h1 class="page-header">
|
||||
<span t-if="quotation.state in ('draft','sent','cancel')">Your Quotation</span>
|
||||
<span t-if="quotation.state not in ('draft','sent','cancel')">Your Order</span>
|
||||
<em t-esc="quotation.name"/>
|
||||
<small t-field="quotation.state"/>
|
||||
</h1>
|
||||
|
||||
<div class="modal fade" id="modelaccept" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
|
||||
<h4 class="modal-title">Please confirm you accept this order:</h4>
|
||||
</div>
|
||||
<form id="accept" method="POST" t-attf-action="/quote/#{quotation.id}/#{quotation.access_token}/accept">
|
||||
<div class="modal-body">
|
||||
<dl class="dl-horizontal">
|
||||
<dt><h4>Your Name : </h4></dt>
|
||||
<dd><h4 t-esc="quotation.partner_id.name"></h4></dd>
|
||||
<dt><h4>Price : </h4></dt>
|
||||
<dd><h4 data-id="total_amount" t-field="quotation.amount_total" t-field-options='{"widget": "monetary","display_currency": "quotation.pricelist_id.currency_id"}'/></dd>
|
||||
<dt><h4>Payment Term : </h4></dt>
|
||||
<dd><h4 t-esc="quotation.payment_term.name"></h4></dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="submit" class="btn btn-success">Validate Order</button>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Discard</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="alert alert-warning alert-dismissable" t-if="quotation.state == 'cancel'">
|
||||
<button type="button" class="close hidden-print" data-dismiss="alert" aria-hidden="true">&times;</button>
|
||||
<strong>This quotation has been canceled.</strong> Contact <p t-field="quotation.user_id"/> to ask a new one.
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="modeldecline" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
|
||||
<h4 class="modal-title">Reason</h4>
|
||||
</div>
|
||||
<form id="decline" method="POST" t-attf-action="/quote/#{quotation.id}/#{quotation.access_token}/decline">
|
||||
<div class="modal-body">
|
||||
<textarea rows="3" name="decline_message" placeholder="Your Comment....." class="form-control"> </textarea>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
||||
<button type="submit" t-att-id="quotation.id" class="btn btn-info">Post</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a id="introduction"/>
|
||||
<div class="row mt32">
|
||||
<div class="col-md-6">
|
||||
<div>
|
||||
<label class="col-sm-3 text-right">Bill To:</label>
|
||||
<div class="col-sm-9">
|
||||
<div t-field="quotation.partner_invoice_id" t-field-options='{
|
||||
"widget": "contact",
|
||||
"fields": ["address", "name", "phone", "email"]
|
||||
}'/>
|
||||
</div>
|
||||
</div>
|
||||
<div t-if="quotation.partner_shipping_id.id != quotation.partner_invoice_id.id">
|
||||
<label class="col-sm-3 text-right">Ship To:</label>
|
||||
<div class="col-sm-9">
|
||||
<div t-field="quotation.partner_shipping_id" t-field-options='{
|
||||
"widget": "contact",
|
||||
"fields": ["address", "name", "phone"]
|
||||
}'/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label class="col-sm-5 text-right">Quote Date:</label>
|
||||
<div class="col-sm-7">
|
||||
<span t-field="quotation.date_order"/>
|
||||
</div>
|
||||
<div class="clearfix"/>
|
||||
<div t-if="quotation.client_order_ref">
|
||||
<label class="col-sm-5 text-right">Your Reference:</label>
|
||||
<div class="col-md-6">
|
||||
<div class="row">
|
||||
<label class="col-sm-5 text-right">Your Contact:</label>
|
||||
<div class="col-sm-7">
|
||||
<span t-field="quotation.client_order_ref"/>
|
||||
<div t-field="quotation.user_id" t-field-options='{
|
||||
"widget": "contact",
|
||||
"fields": ["name", "phone", "email"]
|
||||
}'/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label class="col-sm-5 text-right">Quote Date:</label>
|
||||
<div class="col-sm-7">
|
||||
<span t-field="quotation.date_order"/>
|
||||
</div>
|
||||
<div class="clearfix"/>
|
||||
<div t-if="quotation.client_order_ref">
|
||||
<label class="col-sm-5 text-right">Your Reference:</label>
|
||||
<div class="col-sm-7">
|
||||
<span t-field="quotation.client_order_ref"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a id="offer"/>
|
||||
<div t-field="quotation.website_description"/>
|
||||
|
||||
<t t-foreach="quotation.order_line" t-as="line">
|
||||
<a t-att-id="line.id"/>
|
||||
<div t-field="line.website_description"/>
|
||||
</t>
|
||||
|
||||
<a id="pricing"/>
|
||||
<t t-call="website_quotation.pricing"/>
|
||||
|
||||
<a id="options"/>
|
||||
<t t-call="website_quotation.optional_products"/>
|
||||
|
||||
<a id="discussion"/>
|
||||
<t t-call="website_quotation.chatter"/>
|
||||
</div>
|
||||
|
||||
<a id="offer"/>
|
||||
<div t-field="quotation.website_description"/>
|
||||
|
||||
<t t-foreach="quotation.order_line" t-as="line">
|
||||
<a t-att-id="line.id"/>
|
||||
<div t-field="line.website_description"/>
|
||||
</t>
|
||||
|
||||
<a id="pricing"/>
|
||||
<t t-call="website_quotation.pricing"/>
|
||||
|
||||
<a id="options"/>
|
||||
<t t-call="website_quotation.optional_products"/>
|
||||
|
||||
<a id="discussion"/>
|
||||
<t t-call="website_quotation.chatter"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
|
|
Loading…
Reference in New Issue