mirror of
https://github.com/brmlab/brmbar.git
synced 2025-06-07 21:04:00 +02:00
rework barcode generator
This commit is contained in:
parent
0b488c469c
commit
834b7a4959
3 changed files with 28 additions and 27 deletions
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/python
|
||||
|
||||
from flask import Flask, render_template
|
||||
from flask import Flask, render_template, Response
|
||||
from re import match
|
||||
|
||||
app = Flask('BrmBar')
|
||||
|
@ -27,6 +27,18 @@ def code(code):
|
|||
def admin():
|
||||
return render_template('admin.html')
|
||||
|
||||
@app.route('/admin/barcode-generator.txt')
|
||||
def admin_barcodegeneratortxt():
|
||||
ret = []
|
||||
ret.append('Credit 100;$100')
|
||||
ret.append('Credit 200;$200')
|
||||
ret.append('Credit 500;$500')
|
||||
ret.append('Credit 1000;$1000')
|
||||
ret.append('RESET;RST')
|
||||
# TODO: add users in form <username>;U<userid>
|
||||
response = Response(response = '\n'.join(ret) + '\n', content_type = 'text/plain')
|
||||
return response
|
||||
|
||||
@app.route('/log/')
|
||||
def log():
|
||||
return render_template('log.html')
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
{% extends "base.html" %}
|
||||
{% block title %}Admin{% endblock %}
|
||||
{% block content %}
|
||||
admin
|
||||
|
||||
<p><a href="barcode-generator.txt">barcode generator input</a></p>
|
||||
|
||||
{% endblock %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue