diff --git a/countdown/views.py b/countdown/views.py index 1b7b9f2..990b646 100644 --- a/countdown/views.py +++ b/countdown/views.py @@ -4,7 +4,7 @@ from . import app from . import forms from .countdown import Cache -@app.route('/', methods=['GET', 'POST']) +@app.route('', methods=['GET', 'POST']) def create(): session.permanent = True if not session.get('created_countdowns'): diff --git a/netclock.py b/netclock.py index bca2751..6caeb85 100644 --- a/netclock.py +++ b/netclock.py @@ -9,3 +9,6 @@ import views from countdown import app as countdown app.register_blueprint(countdown, url_prefix="/countdown") +from worldclock import app as worldclock +app.register_blueprint(worldclock, url_prefix="/worldclock") + diff --git a/querysheet.http b/querysheet.http index 80cbd67..4d97dd6 100644 --- a/querysheet.http +++ b/querysheet.http @@ -18,4 +18,11 @@ PATCH http://localhost:5000/countdown/api/v1/stop/:id PATCH http://localhost:5000/countdown/api/v1/reset/:id # GET -GET http://localhost:5000/countdown/api/v1/:id \ No newline at end of file +GET http://localhost:5000/countdown/api/v1/:id + + +# GET +GET http://localhost:5000/worldclock + +# POST +POST http://localhost:5000/worldclock diff --git a/webpack.common.js b/webpack.common.js index 7c3ce0a..5b320e8 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -4,9 +4,12 @@ const path = require('path'); module.exports = { entry: { netclock: './js/netclock.js', + countdown_create: './countdown/templates/countdown/create.js', countdown_view: './countdown/templates/countdown/view.js', - countdown_created: './countdown/templates/countdown/created.js' + countdown_created: './countdown/templates/countdown/created.js', + + worldclock_create: './worldclock/templates/worldclock/create.js' }, plugins: [ new CleanWebpackPlugin() diff --git a/worldclock/__init__.py b/worldclock/__init__.py new file mode 100644 index 0000000..cda9690 --- /dev/null +++ b/worldclock/__init__.py @@ -0,0 +1,5 @@ +from flask import Blueprint + +app = Blueprint('worldclock', __name__, template_folder='templates') +from . import views +from . import api diff --git a/worldclock/api.py b/worldclock/api.py new file mode 100644 index 0000000..e69de29 diff --git a/worldclock/forms.py b/worldclock/forms.py new file mode 100644 index 0000000..e69de29 diff --git a/worldclock/templates/worldclock/create.html b/worldclock/templates/worldclock/create.html new file mode 100644 index 0000000..3d674c4 --- /dev/null +++ b/worldclock/templates/worldclock/create.html @@ -0,0 +1,27 @@ +{% extends "base.html" %} +{% block title %}Worldclock{% endblock title %} + +{% block body %} +
+
+ {{ form.csrf_token }} +
+
+
+
+
+ +
+
+
+
+
+ + +
+
+{% endblock body %} + +{% block scripts %} + +{% endblock scripts %} diff --git a/worldclock/templates/worldclock/create.js b/worldclock/templates/worldclock/create.js new file mode 100644 index 0000000..6b961ff --- /dev/null +++ b/worldclock/templates/worldclock/create.js @@ -0,0 +1 @@ +import './create.scss'; diff --git a/worldclock/templates/worldclock/create.scss b/worldclock/templates/worldclock/create.scss new file mode 100644 index 0000000..e69de29 diff --git a/worldclock/views.py b/worldclock/views.py new file mode 100644 index 0000000..a0d30c1 --- /dev/null +++ b/worldclock/views.py @@ -0,0 +1,11 @@ +from flask import render_template, request, flash, redirect, url_for, session + +from . import app + +@app.route('', methods=['GET']) +def create_get(): + return "Bye" + +@app.route('', methods=['POST']) +def create_post(): + return "Hello" diff --git a/worldclock/worldclock.py b/worldclock/worldclock.py new file mode 100644 index 0000000..e69de29