From 9609ad426ddb6d7580e9a6731197b6e5eacb4127 Mon Sep 17 00:00:00 2001 From: ydb5755 Date: Sun, 13 Oct 2024 14:43:03 +0300 Subject: [PATCH] html and js for spliting lines --- app/static/split_line.js | 25 ++++++++++++++++ app/templates/split_line.html | 56 +++++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+) create mode 100644 app/static/split_line.js create mode 100644 app/templates/split_line.html diff --git a/app/static/split_line.js b/app/static/split_line.js new file mode 100644 index 0000000..18c9ca5 --- /dev/null +++ b/app/static/split_line.js @@ -0,0 +1,25 @@ +const addLineButton = document.getElementById("add-line-button"); +const lineContainer = document.getElementById('table-body'); + +function addLine(){ + const columns = ['Amount', 'Vendor', 'Confirmation Code', 'Note']; + var tr = document.createElement('tr'); + var counter = 2; + columns.forEach(column => { + var td = document.createElement('td'); + var ip = document.createElement('input'); + ip.type = 'text' + ip.classList = 'form-control' + ip.name = `${column}-${counter++}` + ip.placeholder = column + td.appendChild(ip) + tr.appendChild(td) + }) + lineContainer.appendChild(tr) + +} + + +document.addEventListener('DOMContentLoaded', () => { + addLineButton.addEventListener('click', addLine) +}) \ No newline at end of file diff --git a/app/templates/split_line.html b/app/templates/split_line.html new file mode 100644 index 0000000..3cc5d81 --- /dev/null +++ b/app/templates/split_line.html @@ -0,0 +1,56 @@ +{% extends 'base.html' %} +{% block title %}Split Line{% endblock title %} + +{% block content %} + +
+
+
+
+ Split Line +
+ +
+
Details
+
+ + + + + + + + + + + + + + + +
Total Amount:{{ li.amount }}
Vendor:{{ li.get_vendor().name }}
Date:{{ li.display_date() }}
+
+
+
+
+
+ + + + + + + + + +
+
+ + +
+
+
+
+ +
+{% endblock content %} \ No newline at end of file