From 2b881deb5a0e3a25d41dd3c4347ff3d019c4487d Mon Sep 17 00:00:00 2001 From: Dfnkk <164560714+Dfnkk@users.noreply.github.com> Date: Thu, 19 Dec 2024 11:49:11 -0800 Subject: [PATCH] Add form button to main page Adding form to the sides of epschedule. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/EastsidePreparatorySchool/epschedule?shareId=XXXX-XXXX-XXXX-XXXX). --- app.py | 7 +++++++ templates/index.html | 11 +++++++++++ 2 files changed, 18 insertions(+) diff --git a/app.py b/app.py index f86168a..85debcc 100644 --- a/app.py +++ b/app.py @@ -3,6 +3,7 @@ import json import os import re +import requests import google.oauth2.id_token from flask import Flask, abort, make_response, render_template, request, session @@ -527,3 +528,9 @@ def handle_cron_photos(): def handle_cron_lunches(): read_lunches() return "OK" + + +@app.route("/forms") +def handle_forms(): + response = requests.get("https://nikhilmahesh.com") + return response.text diff --git a/templates/index.html b/templates/index.html index eca455f..29cd7cc 100644 --- a/templates/index.html +++ b/templates/index.html @@ -62,6 +62,7 @@ EPSchedule +
@@ -235,6 +236,16 @@

Privacy

})(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-83598394-1', 'auto'); ga('send', 'pageview'); + + // Fetch the HTML content from /forms and embed it in the new div + fetch('/forms') + .then(response => response.text()) + .then(html => { + document.getElementById('form-content').innerHTML = html; + }) + .catch(error => { + console.error('Error fetching form content:', error); + });