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.
 
 
 
 
 

90 lines
3.1 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. <div>${Entity.description | n}</div>
  26. <table width="100%" class="table table-striped table-bordered table-hover">
  27. <thead>
  28. <tr>
  29. <th colspan="2" style="text-align:center;">
  30. <a style="float:right;" class="btn btn-mini btn-info" role="button" href="/Staff/tasks">
  31. <i class="icon-plus-sign icon-white"></i> Ajouter une tâche
  32. </a>
  33. Liste des tâches
  34. </th>
  35. </tr>
  36. </thead>
  37. <tbody>
  38. % for task in tasks[Entity]:
  39. <tr>
  40. <td>
  41. % if task.closed:
  42. <span class="name" style="text-decoration: line-through;">${task.name}</span>
  43. % else:
  44. <a href="/Staff/tasks/${task.uid}">
  45. <span class="name">${task.name}</span>
  46. </a>
  47. <span style="float:right;">${task.due_date.strftime("%d %b").decode("utf-8")}</a>
  48. % endif
  49. </td>
  50. <td style="position: relative;width:70px;">
  51. <div class="actions">
  52. % if task.closed:
  53. [ <a href="/Staff/open/${task.uid}">ré-ouvrir</a> ]
  54. % else:
  55. [ <a href="/Staff/close/${task.uid}">c'est fait</a> ]
  56. % endif
  57. </div>
  58. </td>
  59. </tr>
  60. % if task.description and not task.closed:
  61. <tr>
  62. <td colspan="2"><div>${task.description | n}</div></td>
  63. </tr>
  64. % endif
  65. % endfor
  66. </tbody>
  67. </table>
  68. </div>
  69. % endfor
  70. </div>
  71. <%def name="jsAddOn()">
  72. <script>
  73. $('a[data-toggle="tab"]')
  74. .on('shown', function(e) {
  75. //stateObj = { tab: $(e.target).attr('href').substr(1) };
  76. //history.replaceState(stateObj, "", "/Staff" + $(e.target).attr('href') );
  77. location.hash = $(e.target).attr('href');
  78. });
  79. if (location.hash !== '') {
  80. $('a[href="' + location.hash + '"]').tab('show');
  81. }
  82. </script>
  83. </%def>