diff options
Diffstat (limited to 'gn2/wqflask/templates/gn_editor_commit.html')
-rw-r--r-- | gn2/wqflask/templates/gn_editor_commit.html | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/gn2/wqflask/templates/gn_editor_commit.html b/gn2/wqflask/templates/gn_editor_commit.html new file mode 100644 index 00000000..84ebd818 --- /dev/null +++ b/gn2/wqflask/templates/gn_editor_commit.html @@ -0,0 +1,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 %} |