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.
 
 
 
 
 

91 lines
2.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="/Salles">
  7. <i class="icon-plus-sign icon-white"></i> Ajouter une Salle
  8. </a>
  9. <h3>Gestion des salles JM2L</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(DicSalle.keys(), key=lambda x:x.year_uid, reverse=True)):
  15. <li class="${["","active"][Num==0]}">
  16. <a href="#${Entity.year_uid}" id="Map_Pole_${Entity.year_uid}" data-toggle="tab">${Entity.year_uid}</a>
  17. </li>
  18. % endfor
  19. </ul>
  20. <div class="tab-content" style="padding:0 10px">
  21. % for Num, Entity in enumerate(sorted(DicSalle.keys(), key=lambda x:x.year_uid, reverse=True)):
  22. <div class="tab-pane fade ${["","active "][Num==0]} in" id="${Entity.year_uid}">
  23. <h4>${Entity.year_uid}</h4>
  24. <table class="table table-striped table-bordered table-hover">
  25. <thead>
  26. <tr>
  27. <th colspan="2" style="text-align:center;">
  28. Liste des salles
  29. </th>
  30. </tr>
  31. </thead>
  32. <tbody>
  33. % if len(DicSalle[Entity])==0:
  34. <tr>
  35. <td style="text-align:center;">
  36. <i>Il n'y a pas de salle d&eacute;finie pour l'ann&eacute;e ${Entity.year_uid}</i>
  37. </td>
  38. </tr>
  39. % endif
  40. % for Salle in DicSalle[Entity]:
  41. <tr>
  42. <td>
  43. ${Salle.place_type or ""} <a href="/Salles/${Salle.salle_id}">${Salle.name or ""}</a>
  44. ${len(Salle.allevents)} : [
  45. % for e in Salle.allevents:
  46. <a href="/event/${e.for_year}/${e.slug}">${e.uid}</a>,
  47. % endfor
  48. ]
  49. <div class="pull-right">
  50. % if Salle.phy_salle_id:
  51. [ <a href="/PhySalles/${Salle.phy_salle_id}">${Salle.phy.name}</a> ${Salle.phy.nb_places} places ]
  52. % else:
  53. [ <a href="/PhySalles">Cr&eacute;er</a> ]
  54. % endif
  55. </div>
  56. </td>
  57. </tr>
  58. % if Salle.description:
  59. <tr>
  60. <td><div>${Salle.description | n}</div></td>
  61. </tr>
  62. % endif
  63. % endfor
  64. </tbody>
  65. </table>
  66. </div>
  67. % endfor
  68. </div>
  69. </div>
  70. </div>
  71. </div>
  72. <%def name="jsAddOn()">
  73. <script>
  74. $('a[data-toggle="tab"]')
  75. .on('shown', function(e) {
  76. //stateObj = { tab: $(e.target).attr('href').substr(1) };
  77. //history.replaceState(stateObj, "", "/Staff" + $(e.target).attr('href') );
  78. location.hash = $(e.target).attr('href');
  79. });
  80. if (location.hash !== '') {
  81. $('a[href="' + location.hash + '"]').tab('show');
  82. }
  83. </script>
  84. </%def>