[COMPONENTS][Tag] Actor/Note tag template polished

[PLUGINS][RelatedTags] Disable rendering of template when no results are found
This commit is contained in:
2021-12-06 22:22:23 +00:00
parent ef435b824b
commit 546c5c84fd
6 changed files with 44 additions and 12 deletions

View File

@@ -36,6 +36,7 @@ class Tag extends Controller
return [
'_template' => $template,
'tag_name' => $canonical,
'results' => $results,
'page' => $page,
];

View File

@@ -1,6 +1,13 @@
{% extends 'base.html.twig' %}
{% block stylesheets %}
{{ parent() }}
<link rel="stylesheet" href="{{ asset('assets/default_theme/css/pages/feeds.css') }}" type="text/css">
{% endblock stylesheets %}
{% block body %}
<h2>{{ 'Notes containing tag:' | trans }} {{ tag_name }}</h2>
{% for pinned in handle_event('AddPinnedFeedContent', app.request) %}
{% include pinned['template'] with { 'actor_tags': pinned['vars']} only %}
{% endfor %}
@@ -9,5 +16,7 @@
{% block profile_view %}{% include 'cards/profile/view.html.twig' %}{% endblock profile_view %}
{% endfor %}
{{ "Page: " ~ page }}
<div class="section-widget section-widget-padded">
{{ "Page: " ~ page }}
</div>
{% endblock %}

View File

@@ -1,18 +1,25 @@
{% extends 'base.html.twig' %}
{% import '/cards/note/view.html.twig' as noteView %}
{% block stylesheets %}
{{ parent() }}
<link rel="stylesheet" href="{{ asset('assets/default_theme/css/pages/feeds.css') }}" type="text/css">
{% endblock stylesheets %}
{% block body %}
<h2>{{ 'Notes containing tag:' | trans }} {{ tag_name }}</h2>
{% for pinned in handle_event('AddPinnedFeedContent', app.request) %}
{% include pinned['template'] with { 'note_tags': pinned['vars']} only %}
{% endfor %}
{% for note in results %}
{% block current_note %}
<div class="section-widget">
{{ noteView.macro_note(note) }}
</div>
{% endblock current_note %}
{% endfor %}
{{ "Page: " ~ page }}
<div class="section-widget section-widget-padded section-widget-paging">
{{ "Page " ~ page }}
</div>
{% endblock %}