[TEMPLATE] Update uses of NoteFactory macro, to pass the values seperately, rather than inside a converstation key

This commit is contained in:
Hugo Sales 2022-02-28 14:36:02 +00:00
parent d5f90a1206
commit 43ae3add43
No known key found for this signature in database
GPG Key ID: 7D0C7EAFC9D835A0
3 changed files with 7 additions and 10 deletions

View File

@ -39,10 +39,7 @@
{% for conversation in notes %} {% for conversation in notes %}
{% block current_note %} {% block current_note %}
{% if conversation is instanceof('array') %} {% if conversation is instanceof('array') %}
{% set args = { {% set args = conversation | merge({'type': 'vanilla_full'}) %}
'type': 'vanilla_full',
'conversation': conversation
} %}
{{ NoteFactory.constructor(args) }} {{ NoteFactory.constructor(args) }}
{# {% else %} {# {% else %}
{% set args = { 'type': 'vanilla_full', 'note': conversation, 'extra': { 'depth': 0 } } %} {% set args = { 'type': 'vanilla_full', 'note': conversation, 'extra': { 'depth': 0 } } %}

View File

@ -4,7 +4,7 @@
<div class="u-in-reply-to replies"> <div class="u-in-reply-to replies">
{% for reply in conversation.replies %} {% for reply in conversation.replies %}
<span class="note-replies-indicator" role="presentation"></span> <span class="note-replies-indicator" role="presentation"></span>
{% set args = { 'type': 'vanilla_full', 'conversation': reply } %} {% set args = reply | merge({ 'type': 'vanilla_full' }) %}
{{ NoteFactory.constructor(args) }} {{ NoteFactory.constructor(args) }}
{% endfor %} {% endfor %}
{% if conversation.show_more %} {% if conversation.show_more %}

View File

@ -1,6 +1,6 @@
{# args: { 'type': { 'vanilla_full' }, 'note': note, ?'replies': { note, ?replies }, ?'extra': { 'foo': bar } #} {# args: { 'type': { 'vanilla_full' }, 'note': note, ?'replies': { note, ?replies }, ?'extra': { 'foo': bar } #}
{% macro vanilla_full(args) %} {% macro vanilla_full(args) %}
{% set note = args.conversation.note %} {% set note = args.note %}
{% set actor = note.getActor() %} {% set actor = note.getActor() %}
{% set nickname = actor.getNickname() %} {% set nickname = actor.getNickname() %}
@ -32,7 +32,7 @@
{{ block('note_complementary', 'cards/blocks/note.html.twig') }} {{ block('note_complementary', 'cards/blocks/note.html.twig') }}
</article> </article>
{% set additional_blocks = handle_event('AppendNoteBlock', app.request, args.conversation) %} {% set additional_blocks = handle_event('AppendNoteBlock', app.request, args) %}
{% for block in additional_blocks %} {% for block in additional_blocks %}
{{ block | raw }} {{ block | raw }}
{% endfor %} {% endfor %}
@ -80,11 +80,11 @@
{# args: { 'type': { 'page_full' }, 'note': note, ?'replies': { note, ?replies }, ?'extra': { 'foo': bar } #} {# args: { 'type': { 'page_full' }, 'note': note, ?'replies': { note, ?replies }, ?'extra': { 'foo': bar } #}
{% macro page_full(args) %} {% macro page_full(args) %}
{# TODO #} TODO
{% endmacro page_full %} {% endmacro page_full %}
{# args: { 'type': { 'page_compact' }, 'note': note, ?'extra': { 'foo': bar } } #} {# args: { 'type': { 'page_compact' }, 'note': note, ?'extra': { 'foo': bar } } #}
{% macro page_compact(args) %} {% macro page_compact(args) %}
{# TODO #} TODO
{% endmacro page_compact %} {% endmacro page_compact %}