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

This commit is contained in:
Hugo Sales 2022-03-01 11:23:39 +00:00
parent a9a60bbd92
commit 0b864e85fd
No known key found for this signature in database
GPG Key ID: 7D0C7EAFC9D835A0
4 changed files with 16 additions and 12 deletions

View File

@ -1,9 +1,9 @@
{% extends 'base.html.twig' %}
{% import '/cards/macros/note.html.twig' as noteView %}
{% import "/cards/macros/note/factory.html.twig" as NoteFactory %}
{% 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 %}
@ -22,7 +22,8 @@
{% for note in results %}
{% block current_note %}
{{ noteView.note_vanilla(note) }}
{% set args = { 'type': 'vanilla_full', 'note': note, 'extra': { 'depth': 0 } } %}
{{ NoteFactory.constructor(args) }}
{% endblock current_note %}
{% endfor %}

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>

View File

@ -1,16 +1,17 @@
{% extends 'base.html.twig' %}
{% import '/cards/macros/note.html.twig' as noteView %}
{% import "/cards/macros/note/factory.html.twig" as NoteFactory %}
{% 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 %}
{% if note is defined or actor is defined %}
<div class="frame-section-padding">
{% if note is defined and note is not null %}
{{ noteView.note_vanilla(note, {}) }}
{% set args = { 'type': 'vanilla_full', 'note': note, 'extra': { 'depth': 0 } } %}
{{ NoteFactory.constructor(args) }}
{% elseif actor is defined and actor is not null %}
{% include 'cards/blocks/profile.html.twig' with {'actor': actor} only %}
{% endif %}