index.php 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <?php require_once __DIR__.DIRECTORY_SEPARATOR.'header.php'; ?>
  2. <div class="jumbotron" id="sketchBlock">
  3. <div class="jumbotron-contents">
  4. <h2>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 style="width:100px;">Options</th>
  25. </tr>
  26. </thead>
  27. <tbody>
  28. <tr data-id="{{id}}" style="display:none;">
  29. <td><a href="sketch.php?id={{id}}">{{id}}</a></td>
  30. <td><a href="sketch.php?id={{id}}">{{label}}</a></td>
  31. <td>
  32. <div onclick="delete_sketch(this);" class="btn btn-danger"><i class="fa fa-times"></i></div>
  33. </td>
  34. </tr>
  35. </tbody>
  36. </table>
  37. </div>
  38. </div>
  39. <!-- Modal -->
  40. <div id="editSketch" class="modal fade" role="dialog" data-action="create_sketch">
  41. <div class="modal-dialog">
  42. <!-- Modal content-->
  43. <div class="modal-content">
  44. <div class="modal-header">
  45. <button type="button" class="close" data-dismiss="modal">&times;</button>
  46. <h4 class="modal-title">Edition Sketch</h4>
  47. </div>
  48. <div class="modal-body">
  49. <label for="label">Comment vas t-on appeller ça ? :D</label>
  50. <input class="form-control" type="text" id="label"/>
  51. </div>
  52. <div class="modal-footer">
  53. <button type="button" class="btn btn-primary" onclick="create_sketch();" data-dismiss="modal">Enregistrer</button>
  54. <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
  55. </div>
  56. </div>
  57. </div>
  58. </div>
  59. <!-- Modal -->
  60. <div id="importSketch" class="modal fade" role="dialog" data-action="import_sketch">
  61. <div class="modal-dialog">
  62. <!-- Modal content-->
  63. <div class="modal-content">
  64. <div class="modal-header">
  65. <button type="button" class="close" data-dismiss="modal">&times;</button>
  66. <h4 class="modal-title">Edition Sketch</h4>
  67. </div>
  68. <div class="modal-body">
  69. <label for="url">Quelle est l'adresse du sketch ? :D</label>
  70. <input class="form-control" type="text" id="url"/>
  71. </div>
  72. <div class="modal-footer">
  73. <button type="button" class="btn btn-primary" onclick="import_sketch();" data-dismiss="modal">Enregistrer</button>
  74. <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
  75. </div>
  76. </div>
  77. </div>
  78. </div>
  79. <?php
  80. require_once __ROOT__.'footer.php' ?>