This commit is contained in:
OzzieIsaacs 2017-09-30 15:24:18 +02:00
parent 031a175474
commit c56a02bab6
7 changed files with 14 additions and 12 deletions

View File

@ -39,7 +39,7 @@
<p class="title">{{entry.title|shortentitle}}</p>
<p class="author">
{% for author in entry.authors %}
<a href="{{url_for('author', book_id=author.id) }}">{{author.name}}</a>
<a href="{{url_for('author', book_id=author.id) }}">{{author.name.replace('|',',')}}</a>
{% if not loop.last %}
&amp;
{% endif %}
@ -66,7 +66,7 @@
{% if other_books %}
<div class="discover">
<h3>{{_("More by")}} {{ author.name|safe }}</h3>
<h3>{{_("More by")}} {{ author.name.replace('|',',')|safe }}</h3>
<div class="row">
{% for entry in other_books %}
<div class="col-sm-3 col-lg-2 col-xs-6 book">
@ -80,7 +80,7 @@
<p class="author">
{% for author in entry.authors %}
<a href="https://www.goodreads.com/author/show/{{ author.gid }}" target="_blank" rel="noopener">
{{author.name}}
{{author.name.replace('|',',')}}
</a>
{% if not loop.last %}
&amp;

View File

@ -62,7 +62,7 @@
<h2>{{entry.title}}</h2>
<p class="author">
{% for author in entry.authors %}
<a href="{{url_for('author', book_id=author.id ) }}">{{author.name}}</a>
<a href="{{url_for('author', book_id=author.id ) }}">{{author.name.replace('|',',')}}</a>
{% if not loop.last %}
&amp;
{% endif %}

View File

@ -56,7 +56,7 @@
<p class="title">{{entry.title|shortentitle}}</p>
<p class="author">
{% for author in entry.authors %}
<a href="{{url_for('author', book_id=author.id) }}">{{author.name}}</a>
<a href="{{url_for('author', book_id=author.id) }}">{{author.name.replace('|',',')}}</a>
{% if not loop.last %}
&amp;
{% endif %}

View File

@ -41,7 +41,7 @@
"rating":{% if entry.ratings.__len__() > 0 %} "{{entry.ratings[0].rating}}.0"{% else %}0.0{% endif %},
"authors": [
{% for author in entry.authors %}
"{{author.name}}"{% if not loop.last %},{% endif %}
"{{author.name.replace('|',',')}}"{% if not loop.last %},{% endif %}
{% endfor %}
],
"other_formats": {
@ -51,4 +51,4 @@
{% endfor %}
{% endif %} },
"title_sort": "{{entry.sort}}"
}
}

View File

@ -24,7 +24,7 @@
<p class="title">{{entry.title|shortentitle}}</p>
<p class="author">
{% for author in entry.authors %}
<a href="{{url_for('author', book_id=author.id ) }}">{{author.name}}</a>
<a href="{{url_for('author', book_id=author.id ) }}">{{author.name.replace('|',',')}}</a>
{% if not loop.last %}
&amp;
{% endif %}

View File

@ -24,7 +24,7 @@
<p class="title">{{entry.title|shortentitle}}</p>
<p class="author">
{% for author in entry.authors %}
<a href="{{url_for('author', book_id=author.id) }}">{{author.name}}</a>
<a href="{{url_for('author', book_id=author.id) }}">{{author.name.replace('|',',')}}</a>
{% if not loop.last %}
&amp;
{% endif %}

View File

@ -1122,6 +1122,8 @@ def author_list():
entries = db.session.query(db.Authors, func.count('books_authors_link.book').label('count'))\
.join(db.books_authors_link).join(db.Books).filter(common_filters())\
.group_by('books_authors_link.author').order_by(db.Authors.sort).all()
for entry in entries:
entry.Authors.name=entry.Authors.name.replace('|',',')
return render_title_template('list.html', entries=entries, folder='author', title=_(u"Author list"))
@ -1135,7 +1137,7 @@ def author(book_id, page):
flash(_(u"Error opening eBook. File does not exist or file is not accessible:"), category="error")
return redirect(url_for("index"))
name = db.session.query(db.Authors).filter(db.Authors.id == book_id).first().name
name = (db.session.query(db.Authors).filter(db.Authors.id == book_id).first().name).replace('|',',')
author_info = None
other_books = []
@ -2740,7 +2742,7 @@ def edit_book(book_id):
except Exception:
book.languages[index].language_name = _(isoLanguages.get(part3=book.languages[index].lang_code).name)
for author in book.authors:
author_names.append(author.name)
author_names.append(author.name.replace('|',','))
# Show form
if request.method != 'POST':
@ -2783,7 +2785,7 @@ def edit_book(book_id):
book.title = to_save["book_title"]
edited_books_id.add(book.id)
input_authors = to_save["author_name"].split('&')
input_authors = map(lambda it: it.strip(), input_authors)
input_authors = map(lambda it: it.strip().replace(',','|'), input_authors)
# we have all author names now
if input_authors == ['']:
input_authors = [_(u'unknown')] # prevent empty Author