SMTL

Die Stadtmeistersteilerliste und das Anmeldeformular - SK Langen e.V.
git clone git://git.oshgnacknak.de/SMTL.git
Log | Files | Refs | README

commit bb7ea0dde413259d6a54ba2f46868ce5e93f8072
parent 8416868445dd4895ee95cc3d854b3a92aa221982
Author: Oshgnacknak <osh@oshgnacknak.de>
Date:   Sun,  4 Aug 2019 13:20:27 +0100

remove old stuff

Diffstat:
MREADME.md | 2+-
Mconfig.py.dist | 2+-
Mrequirements.txt | 1-
Mrun.py | 1-
Msmtl/app.py | 3+++
Msmtl/models/player.py | 3+--
Msmtl/signup_form.py | 2+-
Dsmtl/static/css/style.css | 0
Dsmtl/static/js/main.js | 0
Msmtl/templates/base.html | 7+++++--
Dsmtl/templates/flashes.html | 9---------
Dsmtl/templates/meta.html | 5-----
Dsmtl/utils.py | 4----
13 files changed, 12 insertions(+), 27 deletions(-)

diff --git a/README.md b/README.md @@ -1,6 +1,6 @@ # SMTL -This is a 'single page webapp' for the 'Stadtmeisterschaft' players +This webapp is for for the 'Stadtmeisterschaft' players list and the singup form written in python/flask. diff --git a/config.py.dist b/config.py.dist @@ -1,7 +1,7 @@ # Create your config here and safe as 'config.py'. # Things in 'app_config' must all be set. ($ head -c 32 /dev/random | sha1sum) -# the 'run_config' is optional but has to be a dict. +# 'run_config' and 'meta' are optional but have to be a dict. meta = { "description": "Teilnehmerliste und Anmeldeformular der Langener Stadtmeisterschaft 2019", diff --git a/requirements.txt b/requirements.txt @@ -1,6 +1,5 @@ flask>=1.1.1 wtforms -flask_wtf flask-sqlalchemy flask_caching pymysql diff --git a/run.py b/run.py @@ -1,7 +1,6 @@ from smtl.app import app, db from smtl.routes import front_end_blue_print, api_blue_print from config import run_config -import os def main(): diff --git a/smtl/app.py b/smtl/app.py @@ -3,7 +3,10 @@ from flask_caching import Cache from flask_wtf.csrf import CSRFProtect from flask_sqlalchemy import SQLAlchemy from config import app_config, run_config +from datetime import date + +current_year = date.today().year cache = Cache(config={'CACHE_TYPE': 'null' if run_config.get('DEBUG', False) else 'simple'}) csrf = CSRFProtect() app = Flask(__name__) diff --git a/smtl/models/player.py b/smtl/models/player.py @@ -1,5 +1,4 @@ -from smtl.app import db -from smtl.utils import current_year +from smtl.app import db, current_year from enum import Enum diff --git a/smtl/signup_form.py b/smtl/signup_form.py @@ -1,7 +1,7 @@ from wtforms import Form, TextField, IntegerField, SelectField from wtforms.validators import DataRequired, Regexp, Email, Length, NumberRange from smtl.models.player import Gender, Player -from smtl.utils import current_year +from smtl.app import current_year class SignupForm(Form): diff --git a/smtl/static/css/style.css b/smtl/static/css/style.css diff --git a/smtl/static/js/main.js b/smtl/static/js/main.js diff --git a/smtl/templates/base.html b/smtl/templates/base.html @@ -9,8 +9,11 @@ <title>Stadtmeisterschaft</title> {% endif %} - {% include 'meta.html' %} - <link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}"> + {% if meta %} + {% for name, content in meta.items() %} + <meta name="{{ name }}" content="{{ content }}"> + {% endfor %} + {% endif %} </head> <body> {% if title: %} diff --git a/smtl/templates/flashes.html b/smtl/templates/flashes.html @@ -1,9 +0,0 @@ -{% with messages = get_flashed_messages(with_categories=true) %} - {% if messages %} - <ul id="flashes"> - {% for category, message in messages %} - <li class="{{ category }}">{{ message }}</li> - {% endfor %} - </ul> - {% endif %} -{% endwith %} diff --git a/smtl/templates/meta.html b/smtl/templates/meta.html @@ -1,5 +0,0 @@ -{% if meta %} - {% for name, content in meta.items() %} - <meta name="{{ name }}" content="{{ content }}"> - {% endfor %} -{% endif %} diff --git a/smtl/utils.py b/smtl/utils.py @@ -1,4 +0,0 @@ -from datetime import date - - -current_year = date.today().year