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.
 
 
 
 
 

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