index.php 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <?php require_once __DIR__.DIRECTORY_SEPARATOR.'header.php'; ?>
  2. <div class="jumbotron" id="sketchBlock">
  3. <div class="jumbotron-contents">
  4. <h2><i class="fa fa-inbox"></i> Sketch(s)</h2>
  5. <?php if ($myUser->connected()): ?>
  6. <div class="btn-group">
  7. <button class="btn btn-success" type="button" data-toggle="modal" data-target="#editSketch">Ajouter</button>
  8. <button data-toggle="dropdown" class="btn btn-success dropdown-toggle" type="button">
  9. <span class="caret"></span>
  10. <span class="sr-only">Toggle Dropdown</span>
  11. </button>
  12. <ul role="menu" class="dropdown-menu">
  13. <li><a data-toggle="modal" data-target="#editSketch">Créer</a></li>
  14. <li><a data-toggle="modal" data-target="#importSketch" href="#">Importer depuis un hackpoint</a></li>
  15. <li><a id="importJsonSketch">Importer depuis un fichier json</a></li>
  16. </ul>
  17. </div>
  18. <?php endif; ?>
  19. <table class="table table-striped table-hover" id="sketchs">
  20. <thead>
  21. <tr>
  22. <th>#</th>
  23. <th>Libellé</th>
  24. <th>Propriétaire</th>
  25. <th>Visibilité</th>
  26. <th style="width:100px;">Options</th>
  27. </tr>
  28. </thead>
  29. <tbody>
  30. <tr data-id="{{id}}" style="display:none;">
  31. <td><a href="sketch.php?id={{id}}">{{id}}</a></td>
  32. <td><a href="sketch.php?id={{id}}">{{label}}</a></td>
  33. <td>{{owner}}</td>
  34. <td>{{#public}}<i class="fa fa-eye"></i> Publique{{/public}}{{^public}}<i class="fa fa-eye-slash"></i> Privé{{/public}}</td>
  35. <td>
  36. <div onclick="delete_sketch(this);" class="btn btn-danger btn-mini btn-rounded pulse"><i class="fa fa-times"></i></div>
  37. </td>
  38. </tr>
  39. </tbody>
  40. </table>
  41. </div>
  42. </div>
  43. <!-- Modal -->
  44. <div id="editSketch" class="modal fade" role="dialog" data-action="create_sketch">
  45. <div class="modal-dialog">
  46. <!-- Modal content-->
  47. <div class="modal-content">
  48. <div class="modal-header">
  49. <button type="button" class="close" data-dismiss="modal">&times;</button>
  50. <h4 class="modal-title">Edition Sketch</h4>
  51. </div>
  52. <div class="modal-body">
  53. <label for="label">Comment vas t-on appeller ça ? :D</label>
  54. <input class="form-control" type="text" id="label"/>
  55. </div>
  56. <div class="modal-footer">
  57. <button type="button" class="btn btn-primary" onclick="create_sketch();" data-dismiss="modal">Enregistrer</button>
  58. <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
  59. </div>
  60. </div>
  61. </div>
  62. </div>
  63. <!-- Modal -->
  64. <div id="importSketch" class="modal fade" role="dialog" data-action="import_sketch">
  65. <div class="modal-dialog">
  66. <!-- Modal content-->
  67. <div class="modal-content">
  68. <div class="modal-header">
  69. <button type="button" class="close" data-dismiss="modal">&times;</button>
  70. <h4 class="modal-title">Edition Sketch</h4>
  71. </div>
  72. <div class="modal-body">
  73. <label for="url">Quelle est l'adresse du sketch ? :D</label>
  74. <input class="form-control" type="text" id="url"/>
  75. </div>
  76. <div class="modal-footer">
  77. <button type="button" class="btn btn-primary" onclick="import_sketch();" data-dismiss="modal">Enregistrer</button>
  78. <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
  79. </div>
  80. </div>
  81. </div>
  82. </div>
  83. <?php
  84. require_once __ROOT__.'footer.php' ?>