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.

148 lines
4.6 KiB

  1. ::use 'design.mtt'::
  2. <div class="col-md-12">
  3. <!-- Distributions to validate -->
  4. <div class="article text-center" ::cond multidistribs.length>0:: style="max-height:400px;overflow-y: auto;">
  5. <h2>::_("Distributions to validate")::</h2>
  6. <p>::_("You need to validate these distributions which took place recently")::</p>
  7. ::foreach m multidistribs::
  8. <p>
  9. ::if(!m.isConfirmed())::
  10. <a href="/distribution/validate/::m.getDate().toString().substr(0,10)::/::m.getPlace().id::" class="btn btn-primary">
  11. ::dDate(m.getDate())::, ::m.getPlace().name::
  12. </a>
  13. ::if (isAdmin)::
  14. <a href="/distribution/autovalidate/::m.getDate().toString().substr(0,10)::/::m.getPlace().id::" class="btn btn-danger">Admin : Autovalidate</a>
  15. ::end::
  16. ::elseif(isAdmin)::
  17. <a class="btn btn-default disabled">
  18. <span class="glyphicon glyphicon-ok"></span> ::dDate(m.getDate())::, ::m.getPlace().name::
  19. </a>
  20. <a href="/distribution/unvalidate/::m.getDate().toString().substr(0,10)::/::m.getPlace().id::" class="btn btn-danger">Admin : Unvalidate</a>
  21. ::end::
  22. </p>
  23. ::end::
  24. </div>
  25. <div class="article" id="contracts">
  26. <h2>
  27. ::if getParam("old")::
  28. ::_("Old contracts")::
  29. ::else::
  30. ::_("Contracts")::
  31. ::end::
  32. </h2>
  33. <table class="table">
  34. ::foreach c contracts::
  35. ::if c.endDate!=null && c.endDate.getTime() < Date.now().getTime()::
  36. ::set class = "disabled"::
  37. ::elseif c.startDate!=null && c.startDate.getTime() > Date.now().getTime()::
  38. ::set class = "disabled"::
  39. ::else::
  40. ::set class = ""::
  41. ::end::
  42. <tr class="::class::" >
  43. <td>
  44. ::if c._vendor._image!=null::
  45. <div class="productImg" style="background-image:url('::file(c._vendor._image)::');width:48px;height:48px;" ></div>
  46. ::end::
  47. </td>
  48. <td>::c._vendor.name::</td>
  49. <td>
  50. <b>::c.name::</b>
  51. </td>
  52. <td style="font-size:0.9em;">
  53. du ::hDate(c.startDate)::<br/>
  54. au ::hDate(c.endDate)::
  55. </td>
  56. <td>
  57. <div class="btn-group" role="group">
  58. $$edit(::_("Manage")::,/contractAdmin/view/::c.id::)
  59. ::if user.canManageAllContracts()::
  60. $$delete(::_("Del.||short version of delete")::,/contract/delete/::c.id::?token=::token::)
  61. ::end::
  62. </div>
  63. </td>
  64. </tr>
  65. ::end::
  66. </table>
  67. ::if user.canManageAllContracts()::
  68. $$insert(::_("New contract")::,/contract/insert/)
  69. ::end::
  70. <a href="/contractAdmin?old=1" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-folder-close"></span> ::_("Old contracts")::</a>
  71. <a href="/contractAdmin/calendar" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-calendar"></span> ::_("Calendar")::</a>
  72. <div class="dropdown" style="display:inline-block;">
  73. <button class="btn btn-default btn-sm dropdown-toggle btn-noAntiDoubleClick" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
  74. ::_("Global orders view")::
  75. <span class="caret"></span>
  76. </button>
  77. <ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
  78. <li><a href="/contractAdmin/ordersByDate"><span class="glyphicon glyphicon-list"></span> ::_("Same day")::</a></li>
  79. <li><a href="/contractAdmin/ordersByTimeFrame"><span class="glyphicon glyphicon-list"></span> ::_("Timeframe")::</a></li>
  80. </ul>
  81. </div>
  82. </div>
  83. </div>
  84. <div class="col-md-6">
  85. <div class="article" id="vendors">
  86. <h2>::_("Farmers")::</h2>
  87. <table class="table">
  88. ::foreach v vendors::
  89. <tr>
  90. <td>
  91. ::if v._image!=null::
  92. <div class="productImg" style="background-image:url('::file(v._image)::');width:48px;height:48px;"></div>
  93. ::end::
  94. </td>
  95. <td><b>::v.name::</b></td>
  96. <td>
  97. <div class="btn-group" role="group">
  98. $$edit(::_("Edit")::,/vendor/edit/::v.id::)
  99. <a href="/vendor/addImage/::v.id::" class="btn btn-default btn-sm"> <span class="glyphicon glyphicon-picture"></span> ::_("Picture")::</a>
  100. ::if user.isAmapManager():: $$delete(,/vendor/delete/::v.id::?token=::token::) ::end::
  101. </div>
  102. </td>
  103. </tr>
  104. ::end::
  105. </table>
  106. $$insert(::_("New farmer")::,/vendor/insert/)
  107. </div>
  108. </div>
  109. <div class="col-md-6">
  110. <div class="article" id="places">
  111. <h2>::_("Delivery places")::</h2>
  112. <table class="table">
  113. ::foreach p places::
  114. <tr>
  115. <td><b>::p.name::</b></td>
  116. <td>
  117. $$edit(::_("Edit")::,/place/edit/::p.id::)
  118. ::if user.isAmapManager():: $$delete(::_("Del.||short version for delete")::,/place/delete/::p.id::?token=::token::) ::end::
  119. </td>
  120. </tr>
  121. ::end::
  122. </table>
  123. $$insert(::_("New delivery place")::,/place/insert/)
  124. </div>
  125. </div>
  126. ::end::