index.php 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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. <textarea>
  6. void setup() {
  7. Serial.begin(9600);
  8. pinMode(PRESENCE_PIN, INPUT);
  9. pinMode(LIGHT_PIN, INPUT);
  10. pinMode(SOUND_PIN, INPUT);
  11. pinMode(LED_PIN, OUTPUT);
  12. digitalWrite(LED_PIN,LOW);
  13. Serial.println("Demarrage de P.R.O.P.I.S.E");
  14. delay(3000);
  15. digitalWrite(LED_PIN,HIGH);
  16. Serial.println("Rruuullleez !");
  17. }
  18. </textarea>
  19. <script>
  20. /*var cEditor = CodeMirror.fromTextArea(document.getElementById("c-code"), {
  21. lineNumbers: true,
  22. matchBrackets: true,
  23. mode: "text/x-csrc"
  24. });
  25. var ceylonEditor = CodeMirror.fromTextArea(document.getElementById("ceylon-code"), {
  26. lineNumbers: true,
  27. matchBrackets: true,
  28. mode: "text/x-ceylon"
  29. });
  30. var mac = CodeMirror.keyMap.default == CodeMirror.keyMap.macDefault;
  31. CodeMirror.keyMap.default[(mac ? "Cmd" : "Ctrl") + "-Space"] = "autocomplete";*/
  32. </script>
  33. <?php if ($myUser->connected()): ?>
  34. <div class="btn-group">
  35. <button class="btn btn-success" type="button" data-toggle="modal" data-target="#editSketch">Ajouter</button>
  36. <button data-toggle="dropdown" class="btn btn-success dropdown-toggle" type="button">
  37. <span class="caret"></span>
  38. <span class="sr-only">Toggle Dropdown</span>
  39. </button>
  40. <ul role="menu" class="dropdown-menu">
  41. <li><a data-toggle="modal" data-target="#editSketch">Créer</a></li>
  42. <li><a data-toggle="modal" data-target="#importSketch" href="#">Importer depuis un hackpoint</a></li>
  43. <li><a id="importJsonSketch">Importer depuis un fichier json</a></li>
  44. </ul>
  45. </div>
  46. <?php endif; ?>
  47. <table class="table table-striped table-hover" id="sketchs">
  48. <thead>
  49. <tr>
  50. <th>#</th>
  51. <th>Libellé</th>
  52. <th>Propriétaire</th>
  53. <th>Visibilité</th>
  54. <th style="width:100px;">Options</th>
  55. </tr>
  56. </thead>
  57. <tbody>
  58. <tr data-id="{{id}}" style="display:none;">
  59. <td><a href="sketch.php?id={{id}}">{{id}}</a></td>
  60. <td><a href="sketch.php?id={{id}}">{{label}}</a></td>
  61. <td>{{owner}}</td>
  62. <td>{{#public}}<i class="fa fa-eye"></i> Publique{{/public}}{{^public}}<i class="fa fa-eye-slash"></i> Privé{{/public}}</td>
  63. <td>
  64. <div onclick="delete_sketch(this);" class="btn btn-danger btn-mini btn-rounded pulse"><i class="fa fa-times"></i></div>
  65. </td>
  66. </tr>
  67. </tbody>
  68. </table>
  69. </div>
  70. </div>
  71. <!-- Modal -->
  72. <div id="editSketch" class="modal fade" role="dialog" data-action="create_sketch">
  73. <div class="modal-dialog">
  74. <!-- Modal content-->
  75. <div class="modal-content">
  76. <div class="modal-header">
  77. <button type="button" class="close" data-dismiss="modal">&times;</button>
  78. <h4 class="modal-title">Edition Sketch</h4>
  79. </div>
  80. <div class="modal-body">
  81. <label for="label">Comment vas t-on appeller ça ? :D</label>
  82. <input class="form-control" type="text" id="label"/>
  83. </div>
  84. <div class="modal-footer">
  85. <button type="button" class="btn btn-primary" onclick="create_sketch();" data-dismiss="modal">Enregistrer</button>
  86. <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
  87. </div>
  88. </div>
  89. </div>
  90. </div>
  91. <!-- Modal -->
  92. <div id="importSketch" class="modal fade" role="dialog" data-action="import_sketch">
  93. <div class="modal-dialog">
  94. <!-- Modal content-->
  95. <div class="modal-content">
  96. <div class="modal-header">
  97. <button type="button" class="close" data-dismiss="modal">&times;</button>
  98. <h4 class="modal-title">Edition Sketch</h4>
  99. </div>
  100. <div class="modal-body">
  101. <label for="url">Quelle est l'adresse du sketch ? :D</label>
  102. <input class="form-control" type="text" id="url"/>
  103. </div>
  104. <div class="modal-footer">
  105. <button type="button" class="btn btn-primary" onclick="import_sketch();" data-dismiss="modal">Enregistrer</button>
  106. <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
  107. </div>
  108. </div>
  109. </div>
  110. </div>
  111. <?php
  112. require_once __ROOT__.'footer.php' ?>