Le repo des sources pour le site web des JM2L
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 
 
 

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