index.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <?php require_once __DIR__.DIRECTORY_SEPARATOR.'header.php'; ?>
  2. <?php if($myUser->connected()): ?>
  3. <div class="jumbotron">
  4. <div class="jumbotron-contents">
  5. <h2>Mes sketch(s)</h2>
  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. <table class="table table-striped table-hover" id="sketchs">
  19. <thead>
  20. <tr>
  21. <th>#</th>
  22. <th>Libellé</th>
  23. <th style="width:100px;">Options</th>
  24. </tr>
  25. </thead>
  26. <tbody>
  27. <tr data-id="{{id}}" style="display:none;">
  28. <td><a href="sketch.php?id={{id}}">{{id}}</a></td>
  29. <td><a href="sketch.php?id={{id}}">{{label}}</a></td>
  30. <td>
  31. <div onclick="delete_sketch(this);" class="btn btn-danger"><i class="fa fa-times"></i></div>
  32. </td>
  33. </tr>
  34. </tbody>
  35. </table>
  36. </div>
  37. </div>
  38. <!-- Modal -->
  39. <div id="editSketch" class="modal fade" role="dialog" data-action="create_sketch">
  40. <div class="modal-dialog">
  41. <!-- Modal content-->
  42. <div class="modal-content">
  43. <div class="modal-header">
  44. <button type="button" class="close" data-dismiss="modal">&times;</button>
  45. <h4 class="modal-title">Edition Sketch</h4>
  46. </div>
  47. <div class="modal-body">
  48. <label for="label">Comment vas t-on appeller ça ? :D</label>
  49. <input class="form-control" type="text" id="label"/>
  50. </div>
  51. <div class="modal-footer">
  52. <button type="button" class="btn btn-primary" onclick="create_sketch();" data-dismiss="modal">Enregistrer</button>
  53. <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
  54. </div>
  55. </div>
  56. </div>
  57. </div>
  58. <!-- Modal -->
  59. <div id="importSketch" class="modal fade" role="dialog" data-action="import_sketch">
  60. <div class="modal-dialog">
  61. <!-- Modal content-->
  62. <div class="modal-content">
  63. <div class="modal-header">
  64. <button type="button" class="close" data-dismiss="modal">&times;</button>
  65. <h4 class="modal-title">Edition Sketch</h4>
  66. </div>
  67. <div class="modal-body">
  68. <label for="url">Quelle est l'adresse du sketch ? :D</label>
  69. <input class="form-control" type="text" id="url"/>
  70. </div>
  71. <div class="modal-footer">
  72. <button type="button" class="btn btn-primary" onclick="import_sketch();" data-dismiss="modal">Enregistrer</button>
  73. <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
  74. </div>
  75. </div>
  76. </div>
  77. </div>
  78. <?php else: ?>
  79. <div class="jumbotron">
  80. <div class="jumbotron-contents">
  81. <h2>Connexion</h2>
  82. <form action="action.php?action=login" method="post">
  83. <label for="login">Identifiant</label>
  84. <input type="text" class="form-control" name="login" placeholder="Identifiant">
  85. <label for="password">Mot de passe</label>
  86. <input type="password" class="form-control" name="password" placeholder="Mot de passe">
  87. <br/>
  88. <input type="submit" class="btn btn-primary btn-block" value="Connexion"/>
  89. </form>
  90. </div>
  91. </div>
  92. <?php endif; ?>
  93. <?php
  94. require_once __ROOT__.'footer.php' ?>