From e84d75e07fde29d7c961674cd9de3fe867f1ab62 Mon Sep 17 00:00:00 2001 From: Billy Date: Mon, 29 Apr 2024 19:32:48 -0400 Subject: [PATCH] Added more content to the add page. Also moved the add.js file to the new static folder to align with how flask projects should be laid out. --- static/add.js | 35 ++++++++++ templates/add.js | 3 - templates/adding.html | 150 +++++++++++++++++++++++++++++++++++++++--- 3 files changed, 177 insertions(+), 11 deletions(-) create mode 100644 static/add.js delete mode 100644 templates/add.js diff --git a/static/add.js b/static/add.js new file mode 100644 index 0000000..16dad60 --- /dev/null +++ b/static/add.js @@ -0,0 +1,35 @@ +function add_asset() { + let serial = document.getElementById("add-asset-serial"); + let tag = document.getElementById("add-asset-tag"); + let category = document.getElementById("add-asset-category"); + let model = document.getElementById("add-asset-model"); + + if (tag.value == "") { + tag = null; + } else { + tag = tag.value; + document.getElementById("add-asset-tag").value = ""; + } + if (serial.value == "") { + alert('Serial field cannot be empty!') + return; + } else { + serial = serial.value; + document.getElementById("add-asset-serial").value = ""; + } + if (category.value == "N/A") { + category = null; + } else { + category = category.value; + document.getElementById("add-asset-category").value = "N/A"; + } + if (model.value == "N/A") { + model = null; + } else { + model = model.value; + document.getElementById("add-asset-model").value = "N/A"; + } + + console.log(serial,tag,category,model); + +} \ No newline at end of file diff --git a/templates/add.js b/templates/add.js deleted file mode 100644 index e24b816..0000000 --- a/templates/add.js +++ /dev/null @@ -1,3 +0,0 @@ -function update_add_asset_model() { - -} \ No newline at end of file diff --git a/templates/adding.html b/templates/adding.html index 5ef137d..32f9a0e 100644 --- a/templates/adding.html +++ b/templates/adding.html @@ -21,50 +21,184 @@ +
+

Assets

+ Stuff pertaining to laptops and ipads. +

Adding assets

+

The asset tag is a pseudo-optional field and will assign based on the + database and auto increment the database counter if not provided.

+ +

The serial is required for an asset.

+ +

Both the model and category are optional fields.

+

Modifying assets

+

Provide the asset tag to modify the serial, model, and category.

+ +

The serial should only be modified to correct erroneous data.

+
+
+

Users

+ We know what users are... +

Adding users

+

The user name field is required as that is how we identify users.

+

The user ID field is optional and an ID will automatically be + assigned if an ID is not provided. +

+

The assigned card and assigned asset fields are optional.

+

Modifying users

+

Provide the user id of the user you want to modify.

+

Typically used to assign cards and assets as needed.

+
+
+

Access cards

+ Access cards have two numbers, the display number on the front, and the + actual card number on the back. The card number should be 3 or 4 digits. +

Adding access cards

+ The card number is required as it is usually a unique value. +

Modifying access cards

+ Supply the card number that you want to modify the display number on. + E.g. change card no. 879's display number from null to 8. +

Add asset

- - + +

- - +
+
+ +

- - + +

-

Add user

+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +

Add access card

+
+ + +
+
+ + +
+
+ +

Modify asset

+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +

Modify user

+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +

Modify access card

+
+ + +
+
+ + +
+
+ +
- +