publisher-info  is shown on edit page (#599)
pull/605/head
OzzieIsaacs 6 years ago
parent 3f2d0ea7bb
commit 0e1711631c

@ -71,7 +71,6 @@
<label for="tags">{{_('Tags')}}</label>
<input type="text" class="form-control typeahead" name="tags" id="tags" value="{% for tag in book.tags %}{{tag.name.strip()}}{% if not loop.last %}, {% endif %}{% endfor %}">
</div>
<div class="form-group">
<label for="series">{{_('Series')}}</label>
<input type="text" class="form-control typeahead" name="series" id="series" value="{% if book.series %}{{book.series[0].name}}{% endif %}">
@ -100,11 +99,14 @@
<input type="text" class="form-control fake-input hidden" id="fake_pubdate" value="{% if book.pubdate %}{{book.pubdate|formatdate}}{% endif %}">
</div>
</div>
<div class="form-group">
<label for="publisher">{{_('Publisher')}}</label>
<input type="text" class="form-control typeahead" name="publisher" id="publisher" value="{% if book.publishers|length > 0 %}{{book.publishers[0].name}}{% endif %}" disabled>
</div>
<div class="form-group">
<label for="languages">{{_('Language')}}</label>
<input type="text" class="form-control typeahead" name="languages" id="languages" value="{% for language in book.languages %}{{language.language_name.strip()}}{% if not loop.last %}, {% endif %}{% endfor %}">
</div>
{% if cc|length > 0 %}
{% for c in cc %}
<div class="form-group">

@ -3415,6 +3415,12 @@ def edit_book(book_id):
else:
book.pubdate = db.Books.DEFAULT_PUBDATE
'''if len(book.publishers):
if to_save["publisher"] != book.publishers[0].name:
modify_database_object(to_save["publisher"], book.publishers, db.Publishers, db.session, 'series')
else:
modify_database_object(to_save["publisher"], book.publishers, db.Publishers, db.session, 'series')'''
# retranslate displayed text to language codes
languages = db.session.query(db.Languages).all()
input_l = []
@ -3524,12 +3530,19 @@ def edit_book(book_id):
db.session.commit()
if config.config_use_google_drive:
gdriveutils.updateGdriveCalibreFromLocal()
author_names = []
for authr in book.authors:
author_names.append(authr.name)
if "detail_view" in to_save:
return redirect(url_for('show_book', book_id=book.id))
else:
for indx in range(0, len(book.languages)):
try:
book.languages[indx].language_name = LC.parse(book.languages[indx].lang_code).get_language_name(
get_locale())
except UnknownLocaleError:
book.languages[indx].language_name = _(
isoLanguages.get(part3=book.languages[indx].lang_code).name)
author_names = []
for authr in book.authors:
author_names.append(authr.name)
return render_title_template('book_edit.html', book=book, authors=author_names, cc=cc,
title=_(u"edit metadata"), page="editbook")
else:

Loading…
Cancel
Save