first pass at a token navbar experience

This commit is contained in:
2020-11-13 17:55:48 +11:00
parent 77fd5619f6
commit 5fd4479555
3 changed files with 17 additions and 10 deletions

2
README
View File

@@ -19,6 +19,6 @@ python3 main.py
### TODO: ### TODO:
- fix up lame book linkages to tabels that are so not 3nf, *_LST tables, etc. - fix up lame book linkages to tabels that are so not 3nf, *_LST tables, etc.
- use flask-wtf and flask-bootstrap, see this: https://medium.com/better-programming/how-to-use-flask-wtforms-faab71d5a034 for author/<id>
- consider getting rest of Book class connected, e.g. series, loan, etc. - consider getting rest of Book class connected, e.g. series, loan, etc.
- see if we can break this out of main.py -- can't recall what was circular about this, but at least the wtf bits seem to be able to be moved out, so why not do that - see if we can break this out of main.py -- can't recall what was circular about this, but at least the wtf bits seem to be able to be moved out, so why not do that
- get main.html to be some sort of include so that other htmls, can be clicked on / use back button, reload, etc. and it all works, but the whoel thing feels like a discrete app

View File

@@ -182,6 +182,9 @@ def author(id):
message="" message=""
return render_template("author.html", author=author, message=message, author_form=author_form) return render_template("author.html", author=author, message=message, author_form=author_form)
@app.route("/", methods=["GET"])
def main_page():
return render_template("main.html")
if __name__ == "__main__": if __name__ == "__main__":
app.run(host="0.0.0.0", debug=True) app.run(host="0.0.0.0", debug=True)

View File

@@ -1,9 +1,13 @@
<html> <h3>Authors</h3>
<body> <table id="book_table" class="table table-striped table-sm" data-toolbar="#toolbar" data-search="true">
<thead>
<h1>authors</h1> <tr class="thead-light"><th>Surname</th><th>Firstname(s)</th><th>Action</th></tr>
{% for author in authors %} </thead>
<p>{{author.surname}}, {{author.firstnames}}</p> <tbody>
{% endfor %} {% for author in authors %}
</body> <tr><td>{{author.surname}}</td><td>{{author.firstnames}}</td><td>
</html> icons for: E, D
</td></tr>
{% endfor %}
</tbody>
</table>