diff --git a/Rev1/app.py b/Rev1/app.py new file mode 100644 index 0000000..5248b8e --- /dev/null +++ b/Rev1/app.py @@ -0,0 +1,15 @@ +from flask import Flask, render_template, url_for, request, redirect +from datetime import datetime + +app = Flask(__name__) + + +@app.route('/', methods=['POST', 'GET']) +def index(): + if request.method == 'POST': + return 'There was an issue adding your task' + else: + return render_template('index.html') + +if __name__ == "__main__": + app.run(debug=True) \ No newline at end of file diff --git a/Rev1/main.py b/Rev1/main.py index 86c94b5..89bbb46 100644 --- a/Rev1/main.py +++ b/Rev1/main.py @@ -25,57 +25,27 @@ class SubModule(DirectoryItem): class Project(DirectoryItem): pass - # def __init__(self,rootDir,name) -> None: - # self.name = name - # self.path = os.path.join(rootDir,name) - # self.itemList = [] - # sList = os.listdir(self.path) - # for p in sList: - # self.itemList.append(SubModule(self.path,p)) - # pass - # def print(self): - # print(self.path) - # for i in self.itemList: - # i.print(); class Projects(DirectoryItem): - # def __init__(self, rootDir) -> None: - # self.itemList = [] - # self.path = rootDir - # pList = os.listdir(self.path) - # for p in pList: - # self.itemList.append(Project(self.path,p)) - # pass - # def print(self): - # print(self.path) - # for i in self.itemList: - # i.print(); - # pass pass rootdir = './Projects' -# projects = os.listdir(rootdir); -# modules = []; -# firmwares = []; -# for project in projects: -# modules.append(os.listdir(os.path.join(rootdir,project))); -# print(modules); +from flask import Flask +app = Flask(__name__) - -# def test(): -# rootdir = './Projects' -# projects = os.listdir(rootdir); -# print(projects); - +@app.route("/") +def hello_world(): + return "

Hello, World!

" def main(): - p = Projects(rootdir,"") - p.print() + # p = Projects(rootdir,"") + # p.print() + app.run() pass; diff --git a/Rev1/static/css/main.css b/Rev1/static/css/main.css new file mode 100644 index 0000000..b98ead3 --- /dev/null +++ b/Rev1/static/css/main.css @@ -0,0 +1,36 @@ +body, html { + margin: 0; + font-family: sans-serif; + background-color: lightblue; +} + +.content { + margin: 0 auto; + width: 400px; +} + +table, td, th { + border: 1px solid #aaa; +} + +table { + border-collapse: collapse; + width: 100%; +} + +th { + height: 30px; +} + +td { + text-align: center; + padding: 5px; +} + +.form { + margin-top: 20px; +} + +#content { + width: 70%; +} \ No newline at end of file diff --git a/Rev1/templates/base.html b/Rev1/templates/base.html new file mode 100644 index 0000000..b31b70a --- /dev/null +++ b/Rev1/templates/base.html @@ -0,0 +1,13 @@ + + + + + + + + {% block head %}{% endblock %} + + + {% block body %}{% endblock %} + + \ No newline at end of file diff --git a/Rev1/templates/index.html b/Rev1/templates/index.html new file mode 100644 index 0000000..7d2602d --- /dev/null +++ b/Rev1/templates/index.html @@ -0,0 +1,41 @@ +{% extends 'base.html' %} {% block head %} +Anka Anvil +{% endblock %} {% block body %} +
+

Please choose an application below

+ + +
+{% endblock %}