added publisher list in, so publisher in book.html is about done

This commit is contained in:
2020-11-21 17:57:06 +11:00
parent b58b968c66
commit 1edf5082c7
2 changed files with 16 additions and 6 deletions

View File

@@ -1,6 +1,7 @@
{% extends "base.html" %}
{% block main_content %}
<h3><center>View/Edit Book</center></h1>
{% set keys = [ 'title', 'author', 'publisher', 'genre', 'owned', 'covertype', 'condition', 'year_published', 'rating', 'notes', 'blurb' ] %}
<div class="container"><div class="row"><form class="form col-lg-12">
@@ -36,8 +37,16 @@
<a style="color:inherit" href="{{url_for(key, id=-1)}}"><i class="fas fa-plus"></i></a>
</button>
</div>
<span class="form-control col" id="{{key}}[0]">{{books[key][0].name}}
</span>
<select class="form-control" id="publisher">
{% for pub in publisher_list %}
{% set pname=pub.name %}
<option id="{{books.publisher[0].id}}" value="{{books.publisher[0].id}}"
{% if books.publisher[0].name == pname %}
selected
{% endif %}
>{{pname}}</option>
{% endfor %}
</select>
</div class="row">
</div class="col-lg-10">
{% elif key == "author" %}