[CARDS][Note] Minimize calls between different tables

For instance, the actor_url was set using note.getActor().getUrl() instead of using the actor from the start (since actor was needed in other setters as well).
This commit is contained in:
Eliseu Amaro 2021-12-26 23:56:50 +00:00 committed by Diogo Peralta Cordeiro
parent 65676d3980
commit fd44bc3ac5
Signed by: diogo
GPG Key ID: 18D2D35001FBFAB0

View File

@ -91,7 +91,7 @@
{% block note_sidebar %}
<aside class="note-sidebar">
{% set actor_avatar_dimensions = note.getActor().getAvatarDimensions() %}
{% set actor_avatar_dimensions = actor.getAvatarDimensions() %}
<img class="u-logo avatar" src="{{ note.getActorAvatarUrl() }}" alt="{{ nickname }}'s avatar" width="{{actor_avatar_dimensions['width']}}" height="{{actor_avatar_dimensions['height']}}">
</aside>
{% endblock note_sidebar %}
@ -111,9 +111,9 @@
{% endblock note_info %}
{% macro macro_note(note, replies) %}
{% set nickname = note.getActorNickname() %}
{% set fullname = note.getActorFullname() %}
{% set actor = note.getActor() %}
{% set nickname = actor.getNickname() %}
{% set fullname = actor.getFullname() %}
{% set actor_url = actor.getUrl() %}
{% set note_language = note.getNoteLanguageShortDisplay() %}
@ -144,9 +144,10 @@
{% endmacro macro_note %}
{% macro macro_note_minimal(note) %}
{% set nickname = note.getActorNickname() %}
{% set fullname = note.getActorFullname() %}
{% set actor_url = note.getActor().getUrl() %}
{% set actor = note.getActor() %}
{% set nickname = actor.getNickname() %}
{% set fullname = actor.getFullname() %}
{% set actor_url = actor.getUrl() %}
<article class="h-entry hentry note">
{{ block('note_sidebar') }}