fixed up genres.html, publisers.html to work, tweaked menu structure -- still more placeholders than working for now, but started on an Admin menu to allow dealing with genres, covertypes, conditions, etc.
This commit is contained in:
7
main.py
7
main.py
@@ -120,16 +120,11 @@ def book(id):
|
||||
|
||||
book_s['sub_book'] = sub_book
|
||||
|
||||
# print( "parent book details:" )
|
||||
# print( book.parent_ref )
|
||||
# print( "child book details:" )
|
||||
# print( book.child_ref )
|
||||
|
||||
return render_template("book.html", books=book_s, subs=sub_book )
|
||||
|
||||
@app.route("/", methods=["GET"])
|
||||
def main_page():
|
||||
return render_template("main.html")
|
||||
return render_template("base.html")
|
||||
|
||||
if __name__ == "__main__":
|
||||
app.run(host="0.0.0.0", debug=True)
|
||||
|
||||
@@ -14,31 +14,44 @@
|
||||
<body>
|
||||
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
||||
<a class="navbar-brand" href="">Books DB</a>
|
||||
<a class="navbar-brand" href="/">Books DB</a>
|
||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavAltMarkup" aria-controls="navbarNavAltMarkup" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarNavAltMarkup">
|
||||
<div class="navbar-nav">
|
||||
<a class="nav-item nav-link" href="#">Stats</a>
|
||||
<div class="nav-item dropdown">
|
||||
<a class="nav-item dropdown nav-link dropdown-toggle" href="#" id="BookMenu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Books</a>
|
||||
<div class="dropdown-menu" aria-labelledby="BookMenu">
|
||||
<a class="dropdown-item" href="{{url_for('books')}}">Create</a>
|
||||
<a class="dropdown-item" href="{{url_for('books')}}">Show All</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="nav-item dropdown">
|
||||
<a class="nav-item dropdown nav-link dropdown-toggle" href="#" id="AuthorMenu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Authors</a>
|
||||
<div class="dropdown-menu" aria-labelledby="AuthorMenu">
|
||||
<a class="dropdown-item" href="{{url_for('authors')}}">Create</a>
|
||||
<a class="dropdown-item" href="{{url_for('authors')}}">Show All</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="nav-item dropdown">
|
||||
<a class="nav-item dropdown nav-link dropdown-toggle" href="#" id="PublisherMenu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Publishers</a>
|
||||
<div class="dropdown-menu" aria-labelledby="PublisherMenu">
|
||||
<a class="dropdown-item" href="{{url_for('publishers')}}">Create</a>
|
||||
<a class="dropdown-item" href="{{url_for('publishers')}}">Show All</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="nav-item dropdown">
|
||||
<a class="nav-item dropdown nav-link dropdown-toggle" href="#" id="AdminMenu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Admin</a>
|
||||
<div class="dropdown-menu" aria-labelledby="AdminMenu">
|
||||
<a class="dropdown-item" href="{{url_for('genres')}}">Create new Genre</a>
|
||||
<a class="dropdown-item" href="{{url_for('genres')}}">Show Genres</a>
|
||||
<a class="dropdown-item" href="{{url_for('genres')}}">Create new Condition</a>
|
||||
<a class="dropdown-item" href="{{url_for('genres')}}">Show Conditions</a>
|
||||
<a class="dropdown-item" href="{{url_for('genres')}}">Create new Covertype</a>
|
||||
<a class="dropdown-item" href="{{url_for('genres')}}">Show Covertypes</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block main_content %}
|
||||
<h3>Publishers</h3>
|
||||
<h3>Genres</h3>
|
||||
<table id="book_table" class="table table-striped table-sm" data-toolbar="#toolbar" data-search="true">
|
||||
<thead>
|
||||
<tr class="thead-light"><th>Surname</th><th>Firstname(s)</th></tr>
|
||||
<tr class="thead-light"><th>Name</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for publisher in publishers %}
|
||||
<tr><td><a href="{{url_for('publisher', id=publisher.id )}}">{{publisher.name}}</a></td></tr>
|
||||
{% for genre in genres %}
|
||||
<tr><td><a href="{{url_for('genre', id=genre.id )}}">{{genre.name}}</a></td></tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<h3>Publishers</h3>
|
||||
<table id="book_table" class="table table-striped table-sm" data-toolbar="#toolbar" data-search="true">
|
||||
<thead>
|
||||
<tr class="thead-light"><th>Surname</th><th>Firstname(s)</th></tr>
|
||||
<tr class="thead-light"><th>Name</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for publisher in publishers %}
|
||||
|
||||
Reference in New Issue
Block a user