You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

353 lines
11 KiB

::use 'design.mtt'::
::if user==null::
<div style="margin-top:12px;"></div>
::end::
<div id="content" class="col-md-8">
<!-- Welcoming message + access to tutos-->
::if newGroup::
<div class="alert alert-success">
<h3>::_("Welcome to Cagette.net !")::</h3>
<p>
::raw _("Congratulations, you just created a new group !<br/>As an example, we created a fake farmer and fake products.<br/>It will show you how things work together in Cagette.net.<br/>Of course, you'll be able to delete them.")::
</p>
<hr/>
<p>
::raw _("As a starter, we recommand you to follow the <b>guided tour</b> to discover step by step the main sections of the software.")::
</p>
<p>
<a href="/contract/?startTuto=intro" class="btn btn-primary"><span class="glyphicon glyphicon-chevron-right"></span> ::_("Start the guided tour")::</a>
</p>
</div>
::end::
<!-- standard mode order forms -->
::if !amap.hasShopMode()::
<div class="homeBlock" ::cond ( openContracts!=null && openContracts.length>0 )::>
<img src="/img/order.png" width="64" height="64" style="float:right;" />
<h2>::_("Open orders")::</h2>
<ul>
::foreach c openContracts::
<li><a href="/contract/view/::c.id::">::c.name::</a></li>
::end::
</ul>
</div>
::end::
<!-- empty planning -->
::if distribs==null || count(distribs)==0::
<div class="homeBlock">
<!--Votre planning de livraison est vide pour l'instant.-->
::_("You delivery planning is currently empty||on homepage when there is no planned deliveries")::
<br/>
</div>
::else::
::foreach d distribs::
::if d.userHasOrders(user)::
<!-- block with orders -->
<div class="distrib">
::set place = d.getPlace()::
::set active = d.isActive()::
::set start = d.getDate()::
::set end = d.getEndDate()::
::set ordersStartDate = d.getOrdersStartDate()::
::set ordersEndDate = d.getOrdersEndDate()::
<div class="header orders">
<div class="dateBoxOffset">
::set s = getDate(start)::
::if isToday(start)::
$$today(::s.dow::,::s.d::,::s.m::,::s.y::,::s.h::,null)
::else::
$$date(::s.dow::,::s.d::,::s.m::,::s.y::,null)
::end::
</div>
<div class="pull-right text-right" ::cond amap.hasShopMode() && d.type==1 ::>
::if active::
<a ::cond !amap.hasPayments():: href="/contract/editOrderByDate/::start.toString().substr(0,10)::" class="btn btn-default btn-sm">
<span class="glyphicon glyphicon-edit"></span> ::_("Modify my order")::
</a>
<a href="/shop/::place.id::/::start.toString().substr(0,10)::" class="btn btn-default btn-sm">
<span class="glyphicon glyphicon-plus"></span> ::_("Add products")::
</a>
::elseif(ordersEndDate!=null)::
<!--Fermeture des commandes :-->
::if Date.now().getTime() > ordersEndDate.getTime()::
::_("Order closed since"):: <br/>
::hDate(ordersEndDate)::
::else::
::_("Order will open on"):: <br/>
::hDate(ordersStartDate)::
::end::
::end::
</div>
<div class="info">
$$place(::place::)
</div>
</div>
<div class="myorder">::_("My ordered products"):: :</div>
<div class="content orders">
::foreach dist d.distributions::
::set orders = prepare(dist.getUserOrders(user))::
::if orders.length>0::
<h4>
::set s = getDate(dist.date) ::
::set e = getDate(dist.end)::
<span style="color:#999;"><span class="glyphicon glyphicon-time"></span> ::s.h+":"+s.i:: - ::e.h+":"+e.i::</span>
&nbsp;::_("Distribution"):: <a href="/contract/view/::dist._contract.id::">::dist._contract.name::</a>
</h4>
<div class="row">
::foreach c orders::
<div class="col-xs-12 col-sm-6 col-lg-4" ::cond orders.length>0:: >
<table>
<tr>
<td>
<div style="background-image:url('::c.productImage::')" class="productImg" />
</td>
<td class="name">
<span ::cond c.quantity >1:: ><b>::raw c.smartQt::</b></span>
<span style="background-color: #B00;color:white;padding: 2px;border-radius: 3px;margin-right:3px;" ::cond c.quantity ==0:: >
::_("Canceled")::
</span>
::c.productName::
::if c.userId2!=null::
::if user.id==c.userId::
::set you = c.userName::
::set mate = c.userName2::
::else::
::set mate = c.userName::
::set you = c.userName2::
::end::
<br/>(
::raw __("alternated with ::mate::",{mate:mate})::,
::if getWhosTurn(c.id,dist)==false::
::if c.userName == you::
<span style="color:#080">::_("It's your turn")::</span>
::else::
::_("It's his/her turn")::
::end::
::else::
::if c.userName2 == you::
<span style="color:#080">::_("It's your turn")::</span>
::else::
::_("It's his/her turn")::
::end::
::end::
)
::end::
</td>
</tr>
</table>
</div>
::end::
</div>
<div class="footer">
::if user.isContractManager(dist._contract) || dist.distributor1Id==user.id || dist.distributor2Id==user.id || dist.distributor3Id==user.id || dist.distributor4Id==user.id::
<a href="/distribution/list/::dist.id::"><span class="glyphicon glyphicon-print"></span> ::_("Distribution list")::</a>
::end::
<span ::cond dist.distributor1Id!=null || dist.distributor2Id!=null || dist.distributor3Id!=null || dist.distributor4Id!=null::>
&nbsp; <a href="#" onclick="$('#distributors::dist.id::').toggle();return false;"><span class="glyphicon glyphicon-user"></span> ::_("Permanence")::</a>
</span>
&nbsp; <a href="/contract/view/::dist._contract.id::"><span class="glyphicon glyphicon-list-alt"></span> ::_("Contract details")::</a>
::if !amap.hasShopMode() && dist._contract.type==1::
&nbsp; <a href="/contract/order/::dist._contract.id::"><span class="glyphicon glyphicon-edit"></span> ::_("Modify my order")::</a>
::end::
<div id="distributors::dist.id::" style="display:none;margin:8px;">
<ul>
<li ::cond dist.distributor1Id!=null::><i class="icon-user"></i> ::dist._distributor1.getCoupleName():: </li>
<li ::cond dist.distributor2Id!=null::><i class="icon-user"></i> ::dist._distributor2.getCoupleName():: </li>
<li ::cond dist.distributor3Id!=null::><i class="icon-user"></i> ::dist._distributor3.getCoupleName():: </li>
<li ::cond dist.distributor4Id!=null::><i class="icon-user"></i> ::dist._distributor4.getCoupleName():: </li>
</ul>
</div>
<div class="distribMessage" ::cond dist.distributor1Id==user.id || dist.distributor2Id==user.id ||dist.distributor3Id==user.id || dist.distributor4Id==user.id::>
::_("Warning, you're engaged in this distribution !")::
</div>
</div>
::end::
::end::
<!-- extra html -->
<div class="text-center">
<!--::foreach i d.actions::
<a href="::i.link::" class="btn btn-default btn-sm">
<span ::cond i.icon:: class="glyphicon glyphicon-::i.icon::" ></span>
::i.name::
</a>
::end::-->
::raw d.extraHtml::
</div>
</div>
</div>
::elseif(amap.hasShopMode())::
<!-- delivery open to orders (only for shopmode) -->
<div class="distrib">
::set place = d.getPlace()::
::set active = d.isActive()::
::set start = d.getDate()::
::set end = d.getEndDate()::
::set ordersStartDate = d.getOrdersStartDate()::
::set ordersEndDate = d.getOrdersEndDate()::
::set class =""::
::if !active::
::set class="disabled"::
::end::
<div class="header ::class::">
<div class="text-right pull-right">
::if active==true::
<a href="/shop/::place.id::/::start.toString().substr(0,10)::" class="btn btn-lg btn-primary">
<span class="glyphicon glyphicon-chevron-right"></span>
::_("Order||Order button on homepage")::
</a>
<br/>
::elseif(ordersEndDate!=null)::
<!--Fermeture des commandes :-->
::if Date.now().getTime() > ordersEndDate.getTime()::
::_("Order closed since"):: <br/>
::hDate(ordersEndDate)::
::else::
::_("Order will open on"):: <br/>
::hDate(ordersStartDate)::
::end::
::end::
</div>
<div class="dateBoxOffset">
::set s = getDate(start)::
::if isToday(start)::
$$today(::s.dow::,::s.d::,::s.m::,::s.y::,::s.h::,null)
::else::
$$date(::s.dow::,::s.d::,::s.m::,::s.y::,null)
::end::
</div>
<div class="info">
::set e = getDate(end)::
<span class="glyphicon glyphicon-time"></span>
::set start = s.h+":"+s.i::
::set end = e.h+":"+e.i::
::__("Delivery from ::start:: to ::end::||Delivery from 18:00 to 19:30",{start:start,end:end})::
<br/>
$$place(::place::)
</div>
</div>
<div class="content ::class::">
<!-- products previews-->
::foreach p d.getProductsExcerpt()::
<div data-toggle="tooltip" data-placement="top" title="::p.name::" style="background-image:url('::p.image::')" class="productImg"/>
::end::
<!-- extra html -->
<div class="text-center">
::raw d.extraHtml::
</div>
</div>
</div>
::end::
::end::
::end::
</div>
<!-- RIGHT COLUMN -->
<div class="col-md-4">
<div class="block" >
::if amap._image!=null::
::if amap.extUrl!=null && amap.extUrl!=""::
<a href="::amap.extUrl::"><img src="::file(amap._image)::" style="margin:auto;display: block;width: 100%;" class="thumbnail" /><br/></a>
::else::
<img src="::file(amap._image)::" style="margin:auto;display: block;width: 100%;" class="thumbnail" /><br/>
::end::
::end::
::if amap.txtHome!=null && amap.txtHome!=""::
::raw nl2br(amap.txtHome)::
::end::
</div>
<div class="block" ::cond contractsWithDistributors.length>0 ::>
<h3>::_("Permanences")::</h3>
<p>::_("Don't forget to register for permanences")::</p>
<ul>
::foreach c contractsWithDistributors::
<li><a href="/distribution/planning/::c.id::">::c.name::</a></li>
::end::
</ul>
</div>
<div class="alert alert-danger" ::cond user!=null && !user.isFullyRegistred()::>
<p>
::_("Warning, you don't have defined a password yet !")::
</p>
<a href="/user/definePassword" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-chevron-right"></span> ::_("Set my password")::</a>
</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::