Use the right snippets on Templates

This commit is contained in:
Joachim
2021-06-07 18:13:24 +02:00
parent cba34780d8
commit b448d40514
10 changed files with 38 additions and 22 deletions

View File

@ -1,7 +1,9 @@
{% load static %}
<div class="columns">
<div class="column is-narrow is-hidden-mobile">
<figure class="block">
<img src="{% if site.logo %}/images/{{ site.logo }}{% else %}/static/images/logo.png{% endif %}" alt="BookWyrm logo">
<img src="{% if site.logo %}/images/{{ site.logo }}{% else %}{% static "images/logo.png" %}{% endif %}" alt="BookWyrm logo">
</figure>
</div>
<div class="content">

View File

@ -1,2 +1,4 @@
<img class="avatar image {% if large %}is-96x96{% elif medium %}is-48x48{% else %}is-32x32{% endif %}" src="{% if user.avatar %}/images/{{ user.avatar }}{% else %}/static/images/default_avi.jpg{% endif %}" {% if ariaHide %}aria-hidden="true"{% endif %} alt="{{ user.alt_text }}">
{% load static %}
<img class="avatar image {% if large %}is-96x96{% elif medium %}is-48x48{% else %}is-32x32{% endif %}" src="{% if user.avatar %}{% get_media_prefix %}{{ user.avatar }}{% else %}{% static "images/default_avi.jpg" %}{% endif %}" {% if ariaHide %}aria-hidden="true"{% endif %} alt="{{ user.alt_text }}">

View File

@ -1,6 +1,7 @@
{% spaceless %}
{% load i18n %}
{% load static %}
<figure
class="
@ -20,14 +21,14 @@
class="book-cover"
{% if book.cover %}
src="{% if img_path is None %}/images/{% else %}{{ img_path }}{% endif %}{{ book.cover }}"
src="{% if img_path is None %}{% get_media_prefix %}{% else %}{{ img_path }}{% endif %}{{ book.cover }}"
itemprop="thumbnailUrl"
{% if book.alt_text %}
alt="{{ book.alt_text }}"
{% endif %}
{% else %}
src="/static/images/no_cover.jpg"
src="{% static "images/no_cover.jpg" %}"
alt="{% trans "No cover" %}"
{% endif %}
>

View File

@ -1,6 +1,7 @@
{% load bookwyrm_tags %}
{% load markdown %}
{% load i18n %}
{% load static %}
{% with status_type=status.status_type %}
<div
@ -111,12 +112,12 @@
<div class="column is-narrow">
<figure class="image is-128x128">
<a
href="/images/{{ attachment.image }}"
href="{% get_media_prefix %}{{ attachment.image }}"
target="_blank"
aria-label="{% trans 'Open image in new window' %}"
>
<img
src="/images/{{ attachment.image }}"
src="{% get_media_prefix %}{{ attachment.image }}"
{% if attachment.caption %}
alt="{{ attachment.caption }}"

View File

@ -2,6 +2,7 @@
{% load status_display %}
{% load i18n %}
{% load humanize %}
{% load static %}
<div class="media">
<figure class="media-left" aria-hidden="true">
@ -18,7 +19,7 @@
itemtype="https://schema.org/Person"
>
{% if status.user.avatar %}
<meta itemprop="image" content="/images/{{ status.user.avatar }}">
<meta itemprop="image" content="{% get_media_prefix %}{{ status.user.avatar }}">
{% endif %}
<a