Le repo des sources pour le site web des JM2L
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 
 

101 linhas
3.5 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. <a href="/Staff/tasks/${task.uid}">
  52. <span class="name" style="text-decoration: line-through;">${task.name}</span>
  53. </a>
  54. % else:
  55. <a href="/Staff/tasks/${task.uid}">
  56. <span class="name">${task.name}</span>
  57. </a>
  58. <span style="float:right;">${task.due_date.strftime("%d %b").decode("utf-8")}</span>
  59. % endif
  60. </td>
  61. <td style="position: relative;width:70px;">
  62. <div class="actions">
  63. % if task.closed:
  64. [ <a href="/Staff/open/${task.uid}">ré-ouvrir</a> ]
  65. % else:
  66. [ <a href="/Staff/close/${task.uid}">c'est fait</a> ]
  67. % endif
  68. </div>
  69. </td>
  70. </tr>
  71. % if task.description and not task.closed:
  72. <tr>
  73. <td colspan="2"><div>${task.description | n}</div></td>
  74. </tr>
  75. % endif
  76. % endfor
  77. </tbody>
  78. </table>
  79. </div>
  80. % endfor
  81. </div>
  82. </div>
  83. <%def name="jsAddOn()">
  84. <script>
  85. $('a[data-toggle="tab"]')
  86. .on('shown', function(e) {
  87. //stateObj = { tab: $(e.target).attr('href').substr(1) };
  88. //history.replaceState(stateObj, "", "/Staff" + $(e.target).attr('href') );
  89. location.hash = $(e.target).attr('href');
  90. });
  91. if (location.hash !== '') {
  92. $('a[href="' + location.hash + '"]').tab('show');
  93. }
  94. </script>
  95. </%def>