[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
Signed by untrusted user: someonewithpc
GPG Key ID: 7D0C7EAFC9D835A0
3 changed files with 7 additions and 10 deletions

View File

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

View File

@ -4,7 +4,7 @@
<div class="u-in-reply-to replies">
{% for reply in conversation.replies %}
<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) }}
{% endfor %}
{% if conversation.show_more %}

View File

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