Improves status template performance
Reduces queries about about 65
This commit is contained in:
@ -3,14 +3,31 @@
|
||||
{% load i18n %}
|
||||
|
||||
{% with status.id|uuid as uuid %}
|
||||
<form name="boost" action="/boost/{{ status.id }}" method="post" class="interaction boost-{{ status.id }}-{{ uuid }} {% if request.user|boosted:status %}is-hidden{% endif %}" data-id="boost-{{ status.id }}-{{ uuid }}">
|
||||
{% with request.user|boosted:status as boosted %}
|
||||
<form
|
||||
name="boost"
|
||||
action="/boost/{{ status.id }}"
|
||||
method="post"
|
||||
class="interaction boost-{{ status.id }}-{{ uuid }} {% if boosted %}is-hidden{% endif %}"
|
||||
data-id="boost-{{ status.id }}-{{ uuid }}"
|
||||
>
|
||||
{% csrf_token %}
|
||||
<button class="button is-small is-light is-transparent" type="submit" {% if not status.boostable %}disabled{% endif %}>
|
||||
<button
|
||||
class="button is-small is-light is-transparent"
|
||||
type="submit"
|
||||
{% if not status.boostable %}disabled{% endif %}
|
||||
>
|
||||
<span class="icon icon-boost m-0-mobile" title="{% trans 'Boost' %}"></span>
|
||||
<span class="is-sr-only-mobile">{% trans "Boost" %}</span>
|
||||
</button>
|
||||
</form>
|
||||
<form name="unboost" action="/unboost/{{ status.id }}" method="post" class="interaction boost-{{ status.id }}-{{ uuid }} active {% if not request.user|boosted:status %}is-hidden{% endif %}" data-id="boost-{{ status.id }}-{{ uuid }}">
|
||||
<form
|
||||
name="unboost"
|
||||
action="/unboost/{{ status.id }}"
|
||||
method="post"
|
||||
class="interaction boost-{{ status.id }}-{{ uuid }} active {% if not boosted %}is-hidden{% endif %}"
|
||||
data-id="boost-{{ status.id }}-{{ uuid }}"
|
||||
>
|
||||
{% csrf_token %}
|
||||
<button class="button is-small is-light is-transparent" type="submit">
|
||||
<span class="icon icon-boost has-text-primary m-0-mobile" title="{% trans 'Un-boost' %}"></span>
|
||||
@ -18,3 +35,4 @@
|
||||
</button>
|
||||
</form>
|
||||
{% endwith %}
|
||||
{% endwith %}
|
||||
|
Reference in New Issue
Block a user