Le repo des sources pour le site web des JM2L
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.
 
 
 
 
 

99 lines
3.4 KiB

  1. # -*- coding: utf-8 -*-
  2. <%inherit file="jm2l:templates/layout.mako"/>
  3. <%
  4. from slugify import slugify
  5. %>
  6. <a style="float:right;" class="btn btn-mini btn-info" role="button" href="/Staff/poles">
  7. <i class="icon-plus-sign icon-white"></i> Ajouter un Pôle d'activité
  8. </a>
  9. <h3>Liste des tâches JM2L Staff</h3>
  10. <div class="tabbable" id="main_tab">
  11. <ul class="nav nav-tabs" style="margin-bottom: 5px;">
  12. % for Num, Entity in enumerate(sorted(tasks.keys(), key=lambda x:x.name)):
  13. <li class="${["","active"][Num==0]}">
  14. <a href="#${slugify(Entity.name)}" id="Map_Pole_${slugify(Entity.name)}" data-toggle="tab">${Entity.name}</a>
  15. </li>
  16. % endfor
  17. </ul>
  18. <div class="tab-content" style="padding:0 10px">
  19. % for Num, Entity in enumerate(sorted(tasks.keys(), key=lambda x:x.name)):
  20. <div class="tab-pane fade ${["","active "][Num==0]} in" id="${slugify(Entity.name)}">
  21. <a style="float:right;" class="btn btn-mini btn-info" role="button" href="/Staff/poles/${Entity.uid}">
  22. <i class="icon-pencil icon-white"></i> Editer le pôle
  23. </a>
  24. <h4>${Entity.name}</h4>
  25. % if Entity.description:
  26. <div>${Entity.description | n}</div>
  27. % endif
  28. <table class="table table-striped table-bordered table-hover">
  29. <thead>
  30. <tr>
  31. <th colspan="2" style="text-align:center;">
  32. <a style="float:right;" class="btn btn-mini btn-info" role="button" href="${request.route_path('handle_task', sep="", task_id="", _query={"pole_id":Entity.uid})}">
  33. <i class="icon-plus-sign icon-white"></i> Ajouter une tâche
  34. </a>
  35. Liste des tâches
  36. </th>
  37. </tr>
  38. </thead>
  39. <tbody>
  40. % if len(tasks[Entity])==0:
  41. <tr>
  42. <td colspan="2" style="text-align:center;">
  43. <i>Il n'y a pas de tâches dans ce pôle</i>
  44. </td>
  45. </tr>
  46. % endif
  47. % for task in tasks[Entity]:
  48. <tr>
  49. <td>
  50. % if task.closed:
  51. <span class="name" style="text-decoration: line-through;">${task.name}</span>
  52. % else:
  53. <a href="/Staff/tasks/${task.uid}">
  54. <span class="name">${task.name}</span>
  55. </a>
  56. <span style="float:right;">${task.due_date.strftime("%d %b").decode("utf-8")}</span>
  57. % endif
  58. </td>
  59. <td style="position: relative;width:70px;">
  60. <div class="actions">
  61. % if task.closed:
  62. [ <a href="/Staff/open/${task.uid}">ré-ouvrir</a> ]
  63. % else:
  64. [ <a href="/Staff/close/${task.uid}">c'est fait</a> ]
  65. % endif
  66. </div>
  67. </td>
  68. </tr>
  69. % if task.description and not task.closed:
  70. <tr>
  71. <td colspan="2"><div>${task.description | n}</div></td>
  72. </tr>
  73. % endif
  74. % endfor
  75. </tbody>
  76. </table>
  77. </div>
  78. % endfor
  79. </div>
  80. </div>
  81. <%def name="jsAddOn()">
  82. <script>
  83. $('a[data-toggle="tab"]')
  84. .on('shown', function(e) {
  85. //stateObj = { tab: $(e.target).attr('href').substr(1) };
  86. //history.replaceState(stateObj, "", "/Staff" + $(e.target).attr('href') );
  87. location.hash = $(e.target).attr('href');
  88. });
  89. if (location.hash !== '') {
  90. $('a[href="' + location.hash + '"]').tab('show');
  91. }
  92. </script>
  93. </%def>