Removed title tags from cover images

This commit is contained in:
mmonkey 2022-01-26 23:56:10 -06:00
parent 18ce310b30
commit 3416323767
7 changed files with 9 additions and 12 deletions

View File

@ -37,7 +37,7 @@
<div class="cover"> <div class="cover">
<a href="{{ url_for('web.show_book', book_id=entry.id) }}"> <a href="{{ url_for('web.show_book', book_id=entry.id) }}">
<span class="img" title="{{entry.title}}"> <span class="img" title="{{entry.title}}">
{{ image.book_cover(entry, title=author.name|safe) }} {{ image.book_cover(entry, alt=author.name|safe) }}
{% if entry.id in read_book_ids %}<span class="badge read glyphicon glyphicon-ok"></span>{% endif %} {% if entry.id in read_book_ids %}<span class="badge read glyphicon glyphicon-ok"></span>{% endif %}
</span> </span>
</a> </a>

View File

@ -10,7 +10,7 @@
{% if entry.has_cover is defined %} {% if entry.has_cover is defined %}
<a href="{{ url_for('web.show_book', book_id=entry.id) }}" data-toggle="modal" data-target="#bookDetailsModal" data-remote="false"> <a href="{{ url_for('web.show_book', book_id=entry.id) }}" data-toggle="modal" data-target="#bookDetailsModal" data-remote="false">
<span class="img" title="{{entry.title}}"> <span class="img" title="{{entry.title}}">
{{ image.book_cover(entry, alt=entry.title) }} {{ image.book_cover(entry) }}
{% if entry.id in read_book_ids %}<span class="badge read glyphicon glyphicon-ok"></span>{% endif %} {% if entry.id in read_book_ids %}<span class="badge read glyphicon glyphicon-ok"></span>{% endif %}
</span> </span>
</a> </a>

View File

@ -28,7 +28,7 @@
<div class="cover"> <div class="cover">
<a href="{{url_for('web.books_list', data=data, sort_param='stored', book_id=entry[0].series[0].id )}}"> <a href="{{url_for('web.books_list', data=data, sort_param='stored', book_id=entry[0].series[0].id )}}">
<span class="img" title="{{entry[0].series[0].name}}"> <span class="img" title="{{entry[0].series[0].name}}">
{{ image.series(entry[0].series[0], title=entry[0].series[0].name|shortentitle) }} {{ image.series(entry[0].series[0], alt=entry[0].series[0].name|shortentitle) }}
<span class="badge">{{entry.count}}</span> <span class="badge">{{entry.count}}</span>
</span> </span>
</a> </a>

View File

@ -1,23 +1,20 @@
{% macro book_cover(book, title=None, alt=None) -%} {% macro book_cover(book, alt=None) -%}
{%- set image_title = book.title if book.title else book.name -%} {%- set image_title = book.title if book.title else book.name -%}
{%- set image_title = title if title else image_title -%}
{%- set image_alt = alt if alt else image_title -%} {%- set image_alt = alt if alt else image_title -%}
{% set srcset = book|get_cover_srcset %} {% set srcset = book|get_cover_srcset %}
<img <img
srcset="{{ srcset }}" srcset="{{ srcset }}"
src="{{ url_for('web.get_cover', book_id=book.id, resolution='og', c=book|last_modified) }}" src="{{ url_for('web.get_cover', book_id=book.id, resolution='og', c=book|last_modified) }}"
title="{{ image_title }}"
alt="{{ image_alt }}" alt="{{ image_alt }}"
/> />
{%- endmacro %} {%- endmacro %}
{% macro series(series, title=None, alt=None) -%} {% macro series(series, alt=None) -%}
{%- set image_alt = alt if alt else image_title -%} {%- set image_alt = alt if alt else image_title -%}
{% set srcset = series|get_series_srcset %} {% set srcset = series|get_series_srcset %}
<img <img
srcset="{{ srcset }}" srcset="{{ srcset }}"
src="{{ url_for('web.get_series_cover', series_id=series.id, resolution='og', c='day'|cache_timestamp) }}" src="{{ url_for('web.get_series_cover', series_id=series.id, resolution='og', c='day'|cache_timestamp) }}"
title="{{ title }}"
alt="{{ book_title }}" alt="{{ book_title }}"
/> />
{%- endmacro %} {%- endmacro %}

View File

@ -10,7 +10,7 @@
<div class="cover"> <div class="cover">
<a href="{{ url_for('web.show_book', book_id=entry.id) }}" data-toggle="modal" data-target="#bookDetailsModal" data-remote="false"> <a href="{{ url_for('web.show_book', book_id=entry.id) }}" data-toggle="modal" data-target="#bookDetailsModal" data-remote="false">
<span class="img" title="{{ entry.title }}"> <span class="img" title="{{ entry.title }}">
{{ image.book_cover(entry, alt=entry.title) }} {{ image.book_cover(entry) }}
{% if entry.id in read_book_ids %}<span class="badge read glyphicon glyphicon-ok"></span>{% endif %} {% if entry.id in read_book_ids %}<span class="badge read glyphicon glyphicon-ok"></span>{% endif %}
</span> </span>
</a> </a>
@ -92,7 +92,7 @@
<div class="cover"> <div class="cover">
<a href="{{ url_for('web.show_book', book_id=entry.id) }}" data-toggle="modal" data-target="#bookDetailsModal" data-remote="false"> <a href="{{ url_for('web.show_book', book_id=entry.id) }}" data-toggle="modal" data-target="#bookDetailsModal" data-remote="false">
<span class="img" title="{{ entry.title }}"> <span class="img" title="{{ entry.title }}">
{{ image.book_cover(entry, alt=entry.title) }} {{ image.book_cover(entry) }}
{% if entry.id in read_book_ids %}<span class="badge read glyphicon glyphicon-ok"></span>{% endif %} {% if entry.id in read_book_ids %}<span class="badge read glyphicon glyphicon-ok"></span>{% endif %}
</span> </span>
</a> </a>

View File

@ -46,7 +46,7 @@
{% if entry.Books.has_cover is defined %} {% if entry.Books.has_cover is defined %}
<a href="{{ url_for('web.show_book', book_id=entry.Books.id) }}" data-toggle="modal" data-target="#bookDetailsModal" data-remote="false"> <a href="{{ url_for('web.show_book', book_id=entry.Books.id) }}" data-toggle="modal" data-target="#bookDetailsModal" data-remote="false">
<span class="img" title="{{entry.Books.title}}" > <span class="img" title="{{entry.Books.title}}" >
{{ image.book_cover(entry.Books, alt=entry.Books.title) }} {{ image.book_cover(entry.Books) }}
{% if entry.Books.id in read_book_ids %}<span class="badge read glyphicon glyphicon-ok"></span>{% endif %} {% if entry.Books.id in read_book_ids %}<span class="badge read glyphicon glyphicon-ok"></span>{% endif %}
</span> </span>
</a> </a>

View File

@ -35,7 +35,7 @@
<div class="cover"> <div class="cover">
<a href="{{ url_for('web.show_book', book_id=entry.id) }}" data-toggle="modal" data-target="#bookDetailsModal" data-remote="false"> <a href="{{ url_for('web.show_book', book_id=entry.id) }}" data-toggle="modal" data-target="#bookDetailsModal" data-remote="false">
<span class="img" title="{{entry.title}}" > <span class="img" title="{{entry.title}}" >
{{ image.book_cover(entry, alt=entry.title) }} {{ image.book_cover(entry) }}
{% if entry.id in read_book_ids %}<span class="badge read glyphicon glyphicon-ok"></span>{% endif %} {% if entry.id in read_book_ids %}<span class="badge read glyphicon glyphicon-ok"></span>{% endif %}
</span> </span>
</a> </a>