[TEMPLATES] Fixup uses of deprecated noteView, in favour of new NoteFactory facility

This commit is contained in:
2022-03-01 11:23:39 +00:00
parent a9a60bbd92
commit 0b864e85fd
4 changed files with 16 additions and 12 deletions

View File

@@ -1,4 +1,4 @@
{% import '/cards/macros/note.html.twig' as noteView %}
{% import "/cards/macros/note/factory.html.twig" as NoteFactory %}
{# Backwards compatibility with hAtom 0.1 #}
{% if pinnednotes is not empty %}
@@ -8,11 +8,12 @@
{% for conversation in pinnednotes %}
{% block current_note %}
{% if conversation is instanceof('array') %}
{{ noteView.note_vanilla(conversation['note'], conversation['replies']) }}
{% set args = conversation | merge({ 'type': 'vanilla_full', 'extra': { 'depth': 0 }}) %}
{{ NoteFactory.constructor(args) }}
{% else %}
{{ noteView.note_vanilla(conversation) }}
{% endif %}
<hr tabindex="0" title="{{ 'End of note and replies.' | trans }}">
<hr tabindex="0" title="{% trans %}End of note and replies{% endtrans %}">
{% endblock current_note %}
{% endfor %}
</div>

View File

@@ -1,18 +1,19 @@
{% extends 'stdgrid.html.twig' %}
{% import "/cards/macros/note.html.twig" as noteView %}
{% import "/cards/macros/note/factory.html.twig" as NoteFactory %}
{% block title %}{{ title }}{% endblock %}
{% block stylesheets %}
{{ parent() }}
<link rel="stylesheet" href="{{ asset('assets/default_theme/pages/feeds.css') }}" type="text/css">
<link rel="stylesheet" href="{{ asset('assets/default_theme/feeds.css') }}" type="text/css">
{% endblock stylesheets %}
{% block body %}
{{ parent() }}
<div class="page">
<div class="main">
{{ noteView.note_compact(note) }}
{% set args = { 'type': 'vanilla_full', 'note': note, 'extra': { 'depth': 0 } } %}
{{ NoteFactory.constructor(args) }}
{{ form(toggle_form) }}
</div>
</div>