From 755c2c441f278d31741044a729962684913a0495 Mon Sep 17 00:00:00 2001 From: sageTheDM Date: Tue, 17 Sep 2024 08:03:46 +0200 Subject: [PATCH] Removed contact form and added a documentaion subside --- py/static/contact.js | 26 ----------------- .../{contact.html => documentation.html} | 2 +- py/templates/faq.html | 28 +++++++++---------- py/templates/index.html | 2 +- py/web_flask.py | 4 +-- 5 files changed, 18 insertions(+), 44 deletions(-) delete mode 100644 py/static/contact.js rename py/templates/{contact.html => documentation.html} (95%) diff --git a/py/static/contact.js b/py/static/contact.js deleted file mode 100644 index c42a463..0000000 --- a/py/static/contact.js +++ /dev/null @@ -1,26 +0,0 @@ - -document.addEventListener('DOMContentLoaded', function() { - const contactForm = document.getElementById('contactForm'); - - if (contactForm) { - contactForm.addEventListener('submit', function(event) { - event.preventDefault(); // Prevent the form from submitting the traditional way - - // Generate a random ticket number - const ticketNumber = Math.floor(Math.random() * 1000000); // Generates a random number between 0 and 999999 - - // Retrieve form values - const name = encodeURIComponent(document.getElementById('name').value); - const email = encodeURIComponent(document.getElementById('email').value); - const message = encodeURIComponent(document.getElementById('message').value); - - // Construct the mailto link - const subject = `Support Ticket #${ticketNumber}`; - const body = `Name: ${name}%0AEmail: ${email}%0AMessage:%0A${message}`; - const mailtoLink = `mailto:example@example.com?subject=${subject}&body=${body}`; - - // Open the default mail client - window.location.href = mailtoLink; - }); - } -}); diff --git a/py/templates/contact.html b/py/templates/documentation.html similarity index 95% rename from py/templates/contact.html rename to py/templates/documentation.html index 251aea7..88591d8 100644 --- a/py/templates/contact.html +++ b/py/templates/documentation.html @@ -17,7 +17,7 @@
  • - Contact + Documentation
  • FAQ diff --git a/py/templates/faq.html b/py/templates/faq.html index dac364f..a890258 100644 --- a/py/templates/faq.html +++ b/py/templates/faq.html @@ -10,20 +10,20 @@
    - -
    + +

    Frequently Asked Questions

    diff --git a/py/templates/index.html b/py/templates/index.html index 4ef9be4..67938f8 100644 --- a/py/templates/index.html +++ b/py/templates/index.html @@ -17,7 +17,7 @@
  • - Contact + Documentation
  • FAQ diff --git a/py/web_flask.py b/py/web_flask.py index 1019b88..8506f84 100644 --- a/py/web_flask.py +++ b/py/web_flask.py @@ -36,9 +36,9 @@ def faq(): return render_template('faq.html') -@APP.route('/contact') +@APP.route('/documentation') def contact(): - return render_template('contact.html') + return render_template('documentation.html') if __name__ == '__main__':