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.
 
 
 
 
 

117 lines
4.5 KiB

  1. <%inherit file="jm2l:templates/layout.mako"/>
  2. <%namespace name="helpers" file="jm2l:templates/helpers.mako"/>
  3. <%def name="jsAddOn()">
  4. <script src="/vendor/repeatable-fields/js/repeatable-fields.js"></script>
  5. <script type="text/javascript">
  6. jQuery(function() {
  7. jQuery('.repeat').each(function() {
  8. jQuery(this).repeatable_fields({
  9. wrapper: 'table',
  10. container: 'tbody',
  11. row: 'tr',
  12. cell: 'td',
  13. });
  14. });
  15. });
  16. </script>
  17. </%def>
  18. <h2>Gestion des catégories pour les entités</h2>
  19. <form method="post" action="#">
  20. <div class="repeat">
  21. <table class="table table-striped table-bordered">
  22. <tbody data-rf-row-count="${len(TiersOpt.get_entity_type())}" class="container ui-sortable">
  23. <tr style="display: none;" class="template row">
  24. ##<td width="10%"><span class="move btn btn-mini btn-info">Move</span></td>
  25. <td class="cell">
  26. <strong>Catégorie</strong>
  27. <input style="width:80%" disabled="" name="collection[{{row-count-placeholder}}][title]"
  28. class="form-control" type="text">
  29. <table class="table table-striped table-bordered">
  30. <caption><strong>Sous Catégories</strong></caption>
  31. <tbody data-rf-row-count="0" style="" class="container ui-sortable">
  32. <tr style="display: none;" class="template row">
  33. ##<td width="10%"><span class="move btn btn-mini btn-info">Move</span></td>
  34. <td class="cell">
  35. <input style="margin-bottom:0"
  36. name="collection[{{row-count-placeholder}}][{{row-count-placeholder}}][id]"
  37. class="form-control" type="text">
  38. </td>
  39. <td><span class="remove btn btn-mini btn-danger"><i class="icon-remove-sign icon-white"></i> Suppr.</span></td>
  40. </tr>
  41. </tbody>
  42. <tfoot>
  43. <tr>
  44. <td colspan="3" style="text-align:center;"><span class="add btn btn-mini btn-success">Ajouter une sous-catégorie</span></td>
  45. </tr>
  46. </tfoot>
  47. </table>
  48. </td>
  49. <td style="width:60px"><span class="remove btn btn-mini btn-danger"><i class="icon-remove-sign icon-white"></i> Suppr.</span></td>
  50. </tr>
  51. % for num, (opt, optcounter) in enumerate(TiersOpt.get_entity_type()):
  52. <tr class="row">
  53. ##<td width="10%"><span class="move btn btn-mini btn-info">Move</span></td>
  54. <td class="cell">
  55. <strong>Catégorie</strong>
  56. <input style="width:70%" name="collection[${opt.slug_entity_type}][title]"
  57. class="form-control" type="text" value="${opt.entity_type}"> ( ${optcounter} entité${["","s"][optcounter>1]} )
  58. <table class="table table-striped table-bordered">
  59. <caption><strong>Sous Catégories</strong></caption>
  60. <tbody data-rf-row-count="${len(TiersOpt.get_entity_sub_type(opt.entity_type))}" style="" class="container ui-sortable">
  61. <tr style="display: none;" class="template row">
  62. ##<td width="10%"><span class="move btn btn-mini btn-info">Move</span></td>
  63. <td class="cell">
  64. <input style="margin-bottom:0;width:95%;"
  65. name="collection[${opt.slug_entity_type}][{{row-count-placeholder}}][id]"
  66. class="form-control" type="text">
  67. </td>
  68. <td style="width:70px;"><span class="remove btn btn-mini btn-danger"><i class="icon-remove-sign icon-white"></i> Suppr.</span></td>
  69. </tr>
  70. % for nums, (sopt, soptcounter) in enumerate(TiersOpt.get_entity_sub_type(opt.entity_type)):
  71. <tr class="row" display: table-row;>
  72. ##<td width="10%"><span class="move btn btn-mini btn-info">Move</span></td>
  73. <td class="cell">
  74. <input style="margin-bottom:0;width:80%;"
  75. name="collection[${opt.slug_entity_type}][${nums}][${sopt.uid}]"
  76. class="form-control" type="text" value="${sopt.entity_subtype}">
  77. ( ${soptcounter} entité${["","s"][soptcounter>1]} )
  78. </td>
  79. % if soptcounter:
  80. <td style="width:70px;"></td>
  81. % else:
  82. <td style="width:70px;"><span class="remove btn btn-mini btn-danger"><i class="icon-remove-sign icon-white"></i> Suppr.</span></td>
  83. % endif
  84. </tr>
  85. % endfor
  86. </tbody>
  87. <tfoot>
  88. <tr>
  89. <td colspan="3" style="text-align:center;">
  90. <span class="add btn btn-mini btn-success">Ajouter une sous-catégorie à ${opt.entity_type}</span>
  91. </td>
  92. </tr>
  93. </tfoot>
  94. </table>
  95. </td>
  96. % if optcounter:
  97. <td style="width:70px;"></td>
  98. % else:
  99. <td style="width:70px;"><span class="remove btn btn-mini btn-danger"><i class="icon-remove-sign icon-white"></i> Suppr.</span></td>
  100. % endif
  101. </tr>
  102. % endfor
  103. </tbody>
  104. <tfoot>
  105. <tr>
  106. <td colspan="2" style="text-align:center;"><span class="add btn btn-mini btn-success">Ajouter une catégorie</span></td>
  107. </tr>
  108. </tfoot>
  109. </table>
  110. </div>
  111. <input type="submit" class="btn btn-primary" value="Enregistrer les modifications" />
  112. </form>