first pass at a token navbar experience
This commit is contained in:
2
README
2
README
@@ -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
|
||||||
|
|||||||
3
main.py
3
main.py
@@ -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)
|
||||||
|
|||||||
@@ -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>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
{% for author in authors %}
|
{% for author in authors %}
|
||||||
<p>{{author.surname}}, {{author.firstnames}}</p>
|
<tr><td>{{author.surname}}</td><td>{{author.firstnames}}</td><td>
|
||||||
|
icons for: E, D
|
||||||
|
</td></tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</body>
|
</tbody>
|
||||||
</html>
|
</table>
|
||||||
|
|||||||
Reference in New Issue
Block a user