diff --git a/app/forms.py b/app/forms.py
index f8c70dd..6197d7b 100644
--- a/app/forms.py
+++ b/app/forms.py
@@ -24,8 +24,8 @@ class DeleteWishlist(FlaskForm):
class EditWishlistInfo(FlaskForm):
- title = StringField("Title", validators=[DataRequired()])
- description = TextAreaField("Description", validators=[DataRequired()])
+ title = StringField("Title")
+ description = TextAreaField("Description")
wl_edit_submit = SubmitField("Submit")
diff --git a/app/templates/base.html b/app/templates/base.html
new file mode 100644
index 0000000..83340ad
--- /dev/null
+++ b/app/templates/base.html
@@ -0,0 +1,63 @@
+
+
+
+ {% block head %}
+
+
+ Wishthat
+
+
+ {% endblock head %}
+
+
+
+
+ {% block content %}
+ {% endblock content %}
+
+
diff --git a/app/templates/edit.html b/app/templates/edit.html
index 61e8b90..bef1766 100644
--- a/app/templates/edit.html
+++ b/app/templates/edit.html
@@ -1,121 +1,125 @@
{% set cpath = url_for("edit", id=wishlist.editId) %}
-
- Edit '{{wishlist.title}}'
- Manage your wishlist details and items
-
-
-
- Urls
-
-
-
- New item
-
-
- Delete items
- {% if wishlist.items|length == 0 %}No items yet
{% endif %}
-
- {% for value in wishlist.items %}
- -
-
- {{ value.title }}
-
- {% endfor %}
-
-
- Delete wishlist
-
-
-
+{% extends "base.html" %}
-
+ $q("#scrape").addEventListener("click", async e => {
+ e.preventDefault()
+ const tUrl = url.value.trim();
+
+ if (!tUrl) {
+ alert("Please provide a valid url.") //TODO: Replace with daisyui modal
+ return
+ }
+
+ const res = await fetch(
+ "/scrape?" + new URLSearchParams({
+ url: tUrl
+ }).toString(),
+ {
+ method: "get",
+ }
+ )
+
+ if (res.status !== 200) {
+ alert("Failed to scrape site.")
+ return
+ }
+
+ const json = await res.json()
+ title.value = json.name;
+ image.value = json.image;
+ price.value = json.price;
+ })
+
+{% endblock content %}
diff --git a/app/templates/footer.html b/app/templates/footer.html
deleted file mode 100644
index b605728..0000000
--- a/app/templates/footer.html
+++ /dev/null
@@ -1,2 +0,0 @@
-