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

View File

@ -1,9 +1,9 @@
{% extends 'base.html.twig' %} {% extends 'base.html.twig' %}
{% import '/cards/macros/note.html.twig' as noteView %} {% import "/cards/macros/note/factory.html.twig" as NoteFactory %}
{% block stylesheets %} {% block stylesheets %}
{{ parent() }} {{ 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 %} {% endblock stylesheets %}
{% block body %} {% block body %}
@ -22,7 +22,8 @@
{% for note in results %} {% for note in results %}
{% block current_note %} {% block current_note %}
{{ noteView.note_vanilla(note) }} {% set args = { 'type': 'vanilla_full', 'note': note, 'extra': { 'depth': 0 } } %}
{{ NoteFactory.constructor(args) }}
{% endblock current_note %} {% endblock current_note %}
{% endfor %} {% 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 #} {# Backwards compatibility with hAtom 0.1 #}
{% if pinnednotes is not empty %} {% if pinnednotes is not empty %}
@ -8,11 +8,12 @@
{% for conversation in pinnednotes %} {% for conversation in pinnednotes %}
{% block current_note %} {% block current_note %}
{% if conversation is instanceof('array') %} {% 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 %} {% else %}
{{ noteView.note_vanilla(conversation) }} {{ noteView.note_vanilla(conversation) }}
{% endif %} {% 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 %} {% endblock current_note %}
{% endfor %} {% endfor %}
</div> </div>

View File

@ -1,18 +1,19 @@
{% extends 'stdgrid.html.twig' %} {% 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 title %}{{ title }}{% endblock %}
{% block stylesheets %} {% block stylesheets %}
{{ parent() }} {{ 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 %} {% endblock stylesheets %}
{% block body %} {% block body %}
{{ parent() }} {{ parent() }}
<div class="page"> <div class="page">
<div class="main"> <div class="main">
{{ noteView.note_compact(note) }} {% set args = { 'type': 'vanilla_full', 'note': note, 'extra': { 'depth': 0 } } %}
{{ NoteFactory.constructor(args) }}
{{ form(toggle_form) }} {{ form(toggle_form) }}
</div> </div>
</div> </div>

View File

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