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.

109 lines
2.8 KiB

  1. ::use 'design.mtt'::
  2. <div id="content" class="col-md-12">
  3. <div class="article">
  4. <h2>::_("Planning of deliveries:"):: ::contract.name::</h2>
  5. <p>
  6. ::raw _("Subscribe now by selecting checkboxes corresponding to dates which are convenient for you. The goal of attendances consists in helping during the delivery of products.")::
  7. </p>
  8. <div style="overflow-x:scroll;">
  9. <table class="table table-bordered">
  10. <tr>
  11. <td></td>
  12. ::foreach d distribs::
  13. ::set date = getDate(d.date)::
  14. <th style="font-size:12px;line-height:14px;text-align:center;background-color:#DED;">::date.dow::<br/>
  15. ::date.d::<br/>
  16. ::date.m::<br/>
  17. ::date.h+":"+date.i::</th>
  18. ::end::
  19. </tr>
  20. <!-- current user -->
  21. <tr>
  22. <td style="white-space: nowrap;">
  23. <b>::user.getCoupleName()::</b>
  24. </td>
  25. <script>
  26. window.reg = function(distribId,img){
  27. $(img).hide();
  28. $.ajax("/distribution/register?register=1&distrib="+distribId,{success:function(data){
  29. //alert("data : "+data);
  30. $(img).show();
  31. img.src="/img/tick_ok_me.png";
  32. img.onclick = function(){
  33. unreg(distribId,img);
  34. };
  35. }});
  36. };
  37. window.unreg = function(distribId,img){
  38. $(img).hide();
  39. $.ajax("/distribution/register?register=0&distrib="+distribId,{success:function(data){
  40. //alert("data : "+data+", "+$(this));
  41. $(img).show();
  42. img.src="/img/tick_no.png";
  43. img.onclick = function(){
  44. reg(distribId,img);
  45. };
  46. }});
  47. };
  48. </script>
  49. ::set me = doodle.get(user.id)::
  50. ::foreach d distribs::
  51. <td style="text-align:center;">
  52. ::if me !=null::
  53. ::set a = me.planning.get(d.id)::
  54. ::if a!=null::
  55. <img src="/img/tick_ok_me.png" onclick="unreg('::d.id::',this)" />
  56. ::else::
  57. ::if !d.hasEnoughDistributors()::
  58. <img src="/img/tick_no.png" onclick="reg('::d.id::',this)" />
  59. ::else::
  60. <span style="color: #AAA;font-size: 80%;">::_("full")::</span>
  61. ::end::
  62. ::end::
  63. ::else::
  64. ::if !d.hasEnoughDistributors()::
  65. <img src="/img/tick_no.png" onclick="reg('::d.id::',this)" />
  66. ::else::
  67. ::_("full")::
  68. ::end::
  69. ::end::
  70. </td>
  71. ::end::
  72. </tr>
  73. <!-- other users-->
  74. ::foreach doo doodle::
  75. <tr ::cond doo.user.id!=user.id:: style="background-color:#EEE;">
  76. <td>::doo.user.getCoupleName()::</td>
  77. ::foreach d distribs::
  78. <td style="text-align:center;">
  79. ::set a = doo.planning.get(d.id)::
  80. ::if a!=null::
  81. <img src="/img/tick_ok.png"/>
  82. ::end::
  83. </td>
  84. ::end::
  85. </tr>
  86. ::end::
  87. </table>
  88. </div>
  89. <div style="text-align:right">
  90. <a href="/" class="btn btn-default btn-lg">::_("Validate")::</a>
  91. </div>
  92. </div>
  93. </div>
  94. ::end::