aboutsummaryrefslogtreecommitdiff
path: root/gn2/wqflask/templates/gn_editor_commit.html
blob: 0ea20adb56d82a9a11d3396718ff5f3b4a46d3e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<section classs="row commit-content"  style="padding-top:25px">
  <div  class="col-sm-10 col-sm-offset-1">
    <div>
      <div>
        <h2> <i>Commit your Changes</i></h2>
      </div>
    </div>
    <br>
    <div>
      <div class="row">
        <label class="col-sm-4" for="message"> <i>*Commit Message*</i></label>

      </div>
      <br>
      <div class="row">
        <textarea rows="12" class="col-sm-12" name="message" required id="commit-message">
        </textarea>

      </div>
    </div>
    <br>
    <br>
    <div class="row">
      <button id="btn-commit"
	       class="btn btn-primary col-sm-2 col-sm-offset-1">
        Commit
      </button>
    </div>
    <br>

  </div>
</section>
{% block js %}

 <script>
  htmx.on("#btn-commit", "click", function(event){
      let msg = htmx.find("#commit-message").value.trim()
      if (msg != ""){
	  //fire custom event here re
	  htmx.find("#output").dispatchEvent(
          new CustomEvent("commitEvent", {
              bubbles: true,
              detail: {action: 'didInitialize', payload: msg},
          }),
      );
      }
  })
</script>
{% endblock %}