Add configurable guideline redirect
This commit is contained in:
		@ -15,5 +15,9 @@ admin_user = admin
 | 
			
		||||
admin_pass = topSecret
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Link to a document with guidelines for entering
 | 
			
		||||
guideline_url = https://fasttube.de/wp-content/uploads/2020/12/Cororna-Regeln-Stand-01.12.2020.pdf
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# JSON indentation for debugging
 | 
			
		||||
json_indent = 4
 | 
			
		||||
 | 
			
		||||
@ -17,10 +17,18 @@ namefile = config['name_file'] or None
 | 
			
		||||
namelist = NameList(namefile)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
from flask import Flask, request
 | 
			
		||||
from flask import Flask, request, redirect
 | 
			
		||||
app = Flask(__name__, static_folder='../web')
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@app.route('/guidelines')
 | 
			
		||||
def get_guidelines():
 | 
			
		||||
	dest = config['guideline_url'] or None
 | 
			
		||||
	if dest:
 | 
			
		||||
		return redirect(dest)
 | 
			
		||||
	return "No guideline document was configured.", 404
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@app.route('/arrival', methods=['POST'])
 | 
			
		||||
def post_arrival():
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -4,7 +4,7 @@
 | 
			
		||||
		<title>FTracker</title>
 | 
			
		||||
		<script>
 | 
			
		||||
			var cbt = {
 | 
			
		||||
				'arrival': 'I have read the protection <a href="/guidelines">guidelines</a>',
 | 
			
		||||
				'arrival': 'I have read and will adhere to the <a href="/guidelines" target="_blank">protection guidelines</a>',
 | 
			
		||||
				'departure': 'I have cleaned my workspace'
 | 
			
		||||
			}
 | 
			
		||||
			function getParams() {
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user