aboutsummaryrefslogtreecommitdiff
path: root/gn2/wqflask/templates/gn_editor_commit.html
diff options
context:
space:
mode:
authorAlexander_Kabui2024-08-13 11:11:22 +0300
committerBonfaceKilz2024-08-29 18:58:56 +0300
commit495c6e926b86e71a7a8a62b3df0c7e691ab66ac8 (patch)
tree76acf5c6d2852a9372fe995c72ebfee490de2c01 /gn2/wqflask/templates/gn_editor_commit.html
parent1d9e79d08c28369147ba52809fc1456e9aafcee6 (diff)
downloadgenenetwork2-495c6e926b86e71a7a8a62b3df0c7e691ab66ac8.tar.gz
Show diff for edited files.
Diffstat (limited to 'gn2/wqflask/templates/gn_editor_commit.html')
-rw-r--r--gn2/wqflask/templates/gn_editor_commit.html31
1 files changed, 20 insertions, 11 deletions
diff --git a/gn2/wqflask/templates/gn_editor_commit.html b/gn2/wqflask/templates/gn_editor_commit.html
index 0ea20adb..8fd1547b 100644
--- a/gn2/wqflask/templates/gn_editor_commit.html
+++ b/gn2/wqflask/templates/gn_editor_commit.html
@@ -9,41 +9,50 @@
<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">
+ class="btn btn-primary col-sm-2 col-sm-offset-1">
Commit
</button>
+ <button id="btn-diff"
+ class="btn col-sm-2 col-sm-offset-1">
+ Show Diff
+ </button>
</div>
<br>
-
+ <div id="diff_page">
+ </div>
</div>
</section>
{% block js %}
-
- <script>
+<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", {
+ 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: {action: 'didInitialize', payload: msg},
+ detail: {},
}),
);
- }
})
</script>
{% endblock %}