Açıklama Yok

modal_update_parameter.html 3.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <div class="modal-header">
  2. <h4>Update {{ parameter["param_human_name"] }} of {{ mod_name }} </h4>
  3. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
  4. aria-hidden="true">&times;</span></button>
  5. </div>
  6. <div class="modal-body">
  7. <div class="container col-md-12">
  8. <form method="post" action="" id="form_update_param">
  9. <div class="col-md-12 col-lg-12 col-sm-12">
  10. {{ form.hidden_tag() }}
  11. <div class="form-group">
  12. <b>Description :</b> {{ parameter["param_description"] }}<br/>
  13. <b>Default :</b> {{ parameter["default"] }} <br/>
  14. <b>Mandatory :</b> {{ parameter["mandatory"] }}<br/>
  15. <b>Expected type :</b> {{ parameter["type"] }}<br/>
  16. </div>
  17. <div class="form-group mt-3">
  18. {% if parameter["type"].startswith("textfield_") %}
  19. <label class="placeholder"><b>Value</b></label>
  20. <div id="editor_detail">{{ parameter["value"] }}</div>
  21. {% elif parameter["type"] == 'bool' %}
  22. <div class="form-check">
  23. <label class="form-check-label">
  24. <input type="checkbox" id="parameter_value"
  25. class="form-control"
  26. {% if parameter["value"] == True %} checked {% endif %}
  27. />
  28. <span class="form-check-sign">Check to set to true</span>
  29. </label>
  30. </div>
  31. {% else %}
  32. <label class="placeholder"><b>Value</b></label>
  33. <input class="form-control required" name="parameter_value" type="text" value="{{ parameter["value"] }}">
  34. {% endif %}
  35. </div>
  36. <button type="button" class="btn btn-outline-success ml-4 mt-5 float-right"
  37. id="submit_save_parameter">Save</button>
  38. </div>
  39. </form>
  40. </div>
  41. </div>
  42. <script>
  43. $(document).ready(function(){
  44. if ($('#editor_detail').length != 0) {
  45. var editor = ace.edit("editor_detail",
  46. {
  47. autoScrollEditorIntoView: true,
  48. minLines: 30,
  49. });
  50. editor.setTheme("ace/theme/tomorrow");
  51. {% if parameter["type"].endswith("json") %}
  52. editor.session.setMode("ace/mode/json");
  53. {% elif parameter["type"].endswith("html") %}
  54. editor.session.setMode("ace/mode/html");
  55. {% elif parameter["type"].endswith("markdown") %}
  56. editor.session.setMode("ace/mode/markdown");
  57. {% endif %}
  58. editor.renderer.setShowGutter(true);
  59. editor.setOption("showLineNumbers", true);
  60. editor.setOption("showPrintMargin", false);
  61. editor.setOption("displayIndentGuides", true);
  62. editor.setOption("maxLines", "Infinity");
  63. editor.session.setUseWrapMode(true);
  64. editor.setOption("indentedSoftWrap", true);
  65. editor.renderer.setScrollMargin(8, 5);
  66. }
  67. });
  68. </script>