aboutsummaryrefslogtreecommitdiff
path: root/gn2/wqflask/templates/gn_editor_commit.html
blob: 84ebd81850fab5272534a9612fb68459589051c9 (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
50
51
52
53
54
55
<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-8" for="message">
                    <i>*Commit Message*</i>
                </label>
            </div>
            <br>
            <div class="row">
                <textarea style="white-space: normal" 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-lg-3 col-lg-offset-1 col-sm-4 col-sm-offset-1">Commit</button>
            <button id="btn-diff" class="btn col-lg-3 col-lg-offset-1  col-sm-4 col-sm-offset-1">Show Diff</button>
        </div>
        <br>
        <div id="diff_page"></div>
    </div>
</section>
{% block js %}
    <script>
  htmx.on("#btn-commit", "click", function(event){
      let msg = htmx.find("#commit-message").value.trim()
      if (msg != ""){
          htmx.find("#output").dispatchEvent(
              new CustomEvent("commitEvent", {
                  bubbles: true,
                  detail: {action: 'didInitialize', payload: msg},
              }),
          );
      }
  })
  htmx.on("#btn-diff", "click", function(event){
      htmx.find("#output").dispatchEvent(
          new CustomEvent("diffEvent", {
              bubbles: true,
              detail: {},
          }),
      );
  })
    </script>
{% endblock %}