code from amapei
This commit is contained in:
@@ -0,0 +1,108 @@
|
||||
::use 'design.mtt'::
|
||||
<div class="col-md-12">
|
||||
|
||||
<h2 style="margin:auto;">::_("Choose a delivery")::</h2>
|
||||
|
||||
<div class="row">
|
||||
|
||||
::if distribs.length==0::
|
||||
<div class="alert alert-danger" class="col-md-12">
|
||||
::_("There is currently no delivery planned.")::
|
||||
</div>
|
||||
::end::
|
||||
|
||||
::foreach d distribs::
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="distrib">
|
||||
::set active =""::
|
||||
::if d.active==false:: ::set active="disabled":: ::end::
|
||||
|
||||
<div class="header ::active::">
|
||||
|
||||
::set s = getDate( d.startDate)::
|
||||
|
||||
<div class="date" style="float:left;width:100px;">
|
||||
<div>::s.dow::</div>
|
||||
<div style="font-size:28px;color:#990000;">::s.d::</div>
|
||||
<div>::s.m::</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="info">
|
||||
|
||||
::set e = getDate(d.endDate)::
|
||||
<span class="glyphicon glyphicon-time"></span> de ::s.h+":"+s.i:: à ::e.h+":"+e.i::
|
||||
</div>
|
||||
|
||||
|
||||
::if d.place!=null::
|
||||
<div class="info">
|
||||
<span class="glyphicon glyphicon-map-marker"></span> <a href="/place/view/::d.place.id::">::d.place::</a>
|
||||
</div>
|
||||
<div class="address">
|
||||
$$nullSafe(::d.place.address1::)
|
||||
$$nullSafe(::d.place.address2::)
|
||||
$$nullSafe(::d.place.zipCode::)
|
||||
$$nullSafe(::d.place.city::)
|
||||
|
||||
</div>
|
||||
::end::
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="content">
|
||||
|
||||
<div class="row">
|
||||
::foreach p d.products::
|
||||
|
||||
|
||||
<div class="col-md-3" data-toggle="tooltip" data-placement="top" title="::p.name::" >
|
||||
<img class="img-responsive" src="::p.image::" style="height:80px;width:80px;margin:4px;"/>
|
||||
</div>
|
||||
|
||||
|
||||
::end::
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="footer" style="text-align:right;">
|
||||
|
||||
::if d.active==true::
|
||||
<a href="/shop/::d.place.id::/::d.startDate.toString().substr(0,10)::" class="btn btn-primary">
|
||||
<span class="glyphicon glyphicon-chevron-right"></span>
|
||||
::_("Order")::
|
||||
</a>
|
||||
::else::
|
||||
|
||||
<span class="glyphicon glyphicon-close"></span>
|
||||
::_("Opening of orders")::<br/>
|
||||
le ::hDate(d.startDate)::
|
||||
|
||||
::end::
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
::end::
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
::end::
|
||||
@@ -0,0 +1,205 @@
|
||||
::use 'design.mtt'::
|
||||
<div class="col-md-9">
|
||||
|
||||
<div class="shop">
|
||||
<!-- 2018-09-27 -->
|
||||
|
||||
<div style="display:none;">
|
||||
::if(contracts!=null)::
|
||||
::foreach c contracts::
|
||||
::c.name::
|
||||
::end::
|
||||
::end::
|
||||
</div>
|
||||
|
||||
<div class="header">
|
||||
|
||||
<div style="float:right;text-align:right;">
|
||||
::if place!=null::
|
||||
<span class="info">
|
||||
<span class="glyphicon glyphicon-map-marker"></span> <a href="/place/view/::place.id::">::place::</a>
|
||||
</span>
|
||||
::end::
|
||||
|
||||
::if place!=null::
|
||||
<div class="address">
|
||||
$$nullSafe(::place.address1::)
|
||||
$$nullSafe(::place.address2::)
|
||||
$$nullSafe(::place.zipCode::)
|
||||
$$nullSafe(::place.city::)
|
||||
</div>
|
||||
::end::
|
||||
</div>
|
||||
|
||||
|
||||
<div>
|
||||
::set hdate = hDate(date)::
|
||||
<div class="info" style="font-size:1.2em;">::__("Distribution on ::date::",{date:hdate})::</div>
|
||||
|
||||
|
||||
<div class="">
|
||||
<span class="info">
|
||||
<span class="glyphicon glyphicon-time"></span> ::_("Orders will close on")::
|
||||
</span>
|
||||
::if ArrayTool.mapLength(infos) == 1::
|
||||
::hDate( infos.iterator().next()[0].orderEndDate )::
|
||||
::else::
|
||||
<ul>
|
||||
::foreach k infos.keys()::
|
||||
<li>
|
||||
::set dists = infos.get(k)::
|
||||
|
||||
::if dists.length==1::
|
||||
::dists[0]._contract.name::
|
||||
::else::
|
||||
::set tt = ""::
|
||||
::foreach d dists::
|
||||
::set tt = tt + d._contract.name + ". "::
|
||||
::end::
|
||||
<span data-toggle="tooltip" title="::tt::" style="text-decoration:underline;">::_("Autres")::</span>
|
||||
::end::
|
||||
|
||||
: ::hDate(Date.fromString(k))::
|
||||
</li>
|
||||
::end::
|
||||
</ul>
|
||||
::end::
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="body">
|
||||
|
||||
<script language="javascript">
|
||||
var cart;
|
||||
$(function(){
|
||||
cart = _.getCart();
|
||||
cart.init("::place.id::","::date.toString().substr(0,10)::");
|
||||
});
|
||||
</script>
|
||||
|
||||
<div class="row">
|
||||
::foreach p products::
|
||||
<div class="col-xs-12 col-sm-6 col-lg-4 product product::p.id::" style="display:none;">
|
||||
|
||||
::set popup = "_.overlay('/shop/productInfo/" + p.id + "?distribution=" + p.distributionId + "','" + urlEncode(p.name) +"')"::
|
||||
|
||||
<table class="product">
|
||||
<tr>
|
||||
<td>
|
||||
<a onclick="::popup::" data-toggle="tooltip" data-placement="top" title="::_('Read more')::">
|
||||
<div style="background-image:url('::p.image::')" class="productImg" style="width:64px;height:64px;"/>
|
||||
</a>
|
||||
|
||||
<div>
|
||||
::if p.organic:: <img src="/img/AB.png"/> ::end::
|
||||
::if p.variablePrice:: <img src="/img/weight.png"/> ::end::
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<a onclick="::popup::" class="productName">
|
||||
::p.name::
|
||||
::if p.qt!=null && p.unitType!=null && p.qt>0::
|
||||
::p.qt:: ::unit(p.unitType,p.qt>1)::
|
||||
::end::
|
||||
</a>
|
||||
|
||||
<div class="price">::formatNum(p.price):: ::currency()::</div>
|
||||
|
||||
::if p.variablePrice::
|
||||
<div style="font-size:0.8em;font-weight:bold;">
|
||||
<div class="vat">::raw pricePerUnit(p.price,p.qt,p.unitType)::</div>
|
||||
</div>
|
||||
::end::
|
||||
|
||||
<div>
|
||||
<form class="form-inline">
|
||||
::if p.stock!=null && p.stock==0::
|
||||
<span style="color:#AAA;">::_("Out of stock")::</span>
|
||||
::elseif !p.orderable::
|
||||
<span style="color:#AAA;">::_("Order closed")::</span>
|
||||
::else::
|
||||
::if p.stock!=null && p.stock>0 && p.stock<=10::
|
||||
<div class="warning" >::__("Only ::pstock:: items in stock",{pstock:p.stock})::</div>
|
||||
::end::
|
||||
|
||||
<div class="input-group">
|
||||
<input id="productQt::p.id::" type="text" value="1" style="height: 25px;width:35px;" class="form-control input-sm" maxlength="4" data-toggle="tooltip" data-placement="top" title="::_('Quantity')::"/>
|
||||
<span class="input-group-btn">
|
||||
<a class="btn btn-default btn-xs" onclick="cart.add(::p.id::)">::_("Order||Order button")::</a>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
::end::
|
||||
</form>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
::end::
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-3" id="cartContainer">
|
||||
|
||||
|
||||
<div class="cartDiv">
|
||||
|
||||
<h3>
|
||||
<span class="glyphicon glyphicon-shopping-cart"></span>
|
||||
::_("My order")::
|
||||
<img id="loader" src="/img/loader.gif"/>
|
||||
</h3>
|
||||
<div id="cart"></div>
|
||||
|
||||
<a onClick="cart.submit();" class="btn btn-default">
|
||||
::if(user==null)::
|
||||
::_("Sign up and validate the order")::
|
||||
::else::
|
||||
::_("Validate")::
|
||||
::end::
|
||||
</a>
|
||||
|
||||
<a class="infos" href='/contract'>::_("You can check your previous orders in 'my account' section")::</a>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="article">
|
||||
<span class="tag active" id="tag0" onclick="cart.filter(0);" style="cursor:pointer;"><span class="glyphicon glyphicon-ok"></span> ::_("All products")::</span><br/>
|
||||
|
||||
::foreach g group.getCategoryGroups()::
|
||||
<div>
|
||||
<h4>::g.name::</h4>
|
||||
::foreach c g.categs::
|
||||
<span class="tag" id="tag::c.id::" onclick="cart.filter(::c.id::);" style="background-color: ::g.color::;cursor:pointer;">::c.name::</span><br/>
|
||||
::end::
|
||||
</div>
|
||||
::end::
|
||||
|
||||
</div>
|
||||
|
||||
<!-- additionnal blocks from plugins -->
|
||||
::if blocks!=null::
|
||||
::foreach b blocks::
|
||||
<div class="block">
|
||||
<h3>::b.title::</h3>
|
||||
<p>::raw b.html::</p>
|
||||
</div>
|
||||
::end::
|
||||
::end::
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
::end::
|
||||
@@ -0,0 +1,8 @@
|
||||
::use 'design.mtt'::
|
||||
<div id='shop'></div>
|
||||
<script>
|
||||
$(function(){
|
||||
_.shop(::place.id::, "::date::");
|
||||
});
|
||||
</script>
|
||||
::end::
|
||||
@@ -0,0 +1,43 @@
|
||||
::use 'design.mtt'::
|
||||
|
||||
<div class="col-md-3"></div>
|
||||
<div class="col-md-6" style="height:400px;"> <!--
|
||||
<div class="panel panel-success">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">::_("Connection")::</h3>
|
||||
</div>
|
||||
|
||||
<div class="panel-body text-center">
|
||||
<p>
|
||||
::raw _("In order to confirm your basket, <br/>You need to authenticate.")::
|
||||
</p>
|
||||
<hr/>
|
||||
<a href="#" onclick="_.loginBox('::raw redirect::');" class="btn btn-primary" style="margin-right:12px;">
|
||||
<span class="glyphicon glyphicon-user"></span> ::_("Connection")::</a>
|
||||
|
||||
<a href="#" onclick="_.registerBox('::raw redirect::',::phoneRequired::);" class="btn btn-success">
|
||||
<span class="glyphicon glyphicon-chevron-right"></span> ::_("Sign up")::</a>
|
||||
</div>
|
||||
</div>-->
|
||||
</div>
|
||||
<div class="col-md-3"></div>
|
||||
|
||||
::if(group!=null && group.hasPhoneRequired())::
|
||||
::set phoneRequired=true::
|
||||
::else::
|
||||
::set phoneRequired=false::
|
||||
::end::
|
||||
|
||||
<script language="javascript">
|
||||
::if(register==true)::
|
||||
$(function(){
|
||||
_.registerBox('::raw redirect::','::raw message::',::phoneRequired::);
|
||||
});
|
||||
::else::
|
||||
$(function(){
|
||||
_.loginBox('::raw redirect::','::raw message::',::phoneRequired::);
|
||||
});
|
||||
::end::
|
||||
|
||||
</script>
|
||||
::end::
|
||||
@@ -0,0 +1,111 @@
|
||||
<!-- this tpl is also used for offer previews -->
|
||||
|
||||
<div class="article">
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-5">
|
||||
<img src="::p.image::" class="img-thumbnail img-responsive" />
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
|
||||
<span class="price">::formatNum(p.price):: ::currency():: ::_("incl. VAT")::</span>
|
||||
|
||||
::if (p.vat!=null && p.vat!=0) || p.contractTax!=0::
|
||||
<div class="vat">
|
||||
|
||||
::if p.vat!=null && p.vat!=0::
|
||||
::p.vat:: ::_("VAT included")::<br/>
|
||||
::end::
|
||||
|
||||
::if p.contractTax!=null::
|
||||
::p.contractTax:: % ::p.contractTaxName:: ::_("included")::<br/>
|
||||
::end::
|
||||
</div>
|
||||
::end::
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
::if p.unitType!=null && p.qt!=null::
|
||||
|
||||
<span class="price">
|
||||
::set qt = formatNum(p.qt)::
|
||||
::set u = unit(p.unitType,qt>1)::
|
||||
|
||||
::if(p.variablePrice)::
|
||||
::__("about ::qt:: ::unit::||product has a variable weight",{qt:qt,unit:u})::
|
||||
::else::
|
||||
::qt:: ::u::
|
||||
::end::
|
||||
</span>
|
||||
|
||||
<div class="vat">::raw pricePerUnit(p.price,p.qt,p.unitType)::</div>
|
||||
|
||||
::end::
|
||||
</div>
|
||||
|
||||
<div class="col-md-7" style="margin-top:24px;">
|
||||
|
||||
<p ::cond p.organic:: class="vat">
|
||||
<img src="/img/AB.png" /> ::_("Organic agriculture")::
|
||||
</p>
|
||||
|
||||
<p ::cond p.variablePrice:: class="vat">
|
||||
<img src="/img/weight.png"/> ::_("Variable price depending on weight")::
|
||||
</p>
|
||||
|
||||
<p ::cond p.desc!=null::>
|
||||
::raw p.desc::
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<hr />
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div ::cond vendor._image!=null:: class="col-md-3">
|
||||
<img src="::file(vendor._image)::" class="img-thumbnail" />
|
||||
</div>
|
||||
|
||||
<div class="col-md-5">
|
||||
|
||||
<h4>::vendor.name::</h4>
|
||||
|
||||
<b>::vendor.city::</b> (::vendor.zipCode::)
|
||||
|
||||
<p ::cond vendor.desc!=null:: style="font-size: 13px;height:150px;overflow-y: scroll;">
|
||||
::raw nl2br(vendor.desc)::
|
||||
</p>
|
||||
|
||||
::if vendor.linkUrl!=null::
|
||||
<p>
|
||||
::if vendor.linkText!=null::
|
||||
<a href="::vendor.linkUrl::" target="_blank" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-chevron-right"></span> ::vendor.linkText::</a>
|
||||
::else::
|
||||
<a href="::vendor.linkUrl::" target="_blank" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-chevron-right"></span> ::_("Read more")::</a>
|
||||
::end::
|
||||
</p>
|
||||
::end::
|
||||
|
||||
</div>
|
||||
|
||||
::if(product!=null)::
|
||||
::set cats = product.getCategories()::
|
||||
<div class="col-md-4" ::cond cats.length != 0:: >
|
||||
<h3>::_("Categories")::</h3>
|
||||
<div>
|
||||
::foreach c cats::
|
||||
<span class="tag" style="background-color: ::c.getColor()::;">::c.name::</span><br />
|
||||
::end::
|
||||
</div>
|
||||
</div>
|
||||
::end::
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user