hidden = forms.BooleanField(required=False)
logo = forms.CharField(required=False)
logo_mono = forms.CharField(required=False)
+ logo_alt = forms.CharField(required=False)
def clean(self):
from django.core.files.base import ContentFile
findable=not self.cleaned_data['hidden'],
logo=self.cleaned_data['logo'],
logo_mono=self.cleaned_data['logo_mono'],
+ logo_alt=self.cleaned_data['logo_alt'],
**kwargs)
@classmethod
def from_text_and_meta(cls, raw_file, book_info, overwrite=False, dont_build=None, search_index=True,
- remote_gallery_url=None, days=0, findable=True, logo=None, logo_mono=None):
+ remote_gallery_url=None, days=0, findable=True, logo=None, logo_mono=None, logo_alt=None):
from catalogue import tasks
if dont_build is None:
extra['logo'] = logo
if logo_mono:
extra['logo_mono'] = logo_mono
+ if logo_alt:
+ extra['logo_alt'] = logo_alt
book.extra_info = json.dumps(extra)
book.load_abstract()
book.load_toc()
{% if extra_info.logo %}
{% thumbnail extra_info.logo '300x200' as th %}
- <img src="{{ th.url }}" style="width: 300px; max-width: 100%;">
+ <img src="{{ th.url }}" style="width: 300px; max-width: 100%;"
+ alt="{{ extra_info.logo_alt|default:'Sponsor' }}"
+ >
{% endthumbnail %}
{% endif %}
</li>
{% if extra_info.logo_mono %}
- {% thumbnail extra_info.logo_mono '200x200' as th %}
- <img src="{{ th.url }}" style="width: 100px; padding: 10px;">
+ {% thumbnail extra_info.logo_mono '200x200' as th %}
+ <img src="{{ th.url }}" style="width: 100px; padding: 10px;"
+ alt="{{ extra_info.logo_alt|default:'Sponsor' }}"
+ >
{% endthumbnail %}
{% endif %}