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

[PLUGINS][RelatedTags] Disable rendering of template when no results are found
This commit is contained in:
Eliseu Amaro 2021-12-06 22:22:23 +00:00
parent ef435b824b
commit 546c5c84fd
Signed by: eliseuamaro
GPG Key ID: 96DA09D4B97BC2D5
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 %}

View File

@ -1,7 +1,9 @@
<div class="section-widget">
<p>Related tags:</p>
{% if note_tags is not empty %}
<div class="section-widget section-widget-padded">
<h2>Related tags:</h2>
{% for at in actor_tags %}
{% include 'cards/tag/actor_tag.html.twig' with { 'tag': at, 'actor': null } %}
{% endfor %}
</div>
{% endif %}

View File

@ -1,6 +1,9 @@
<div class="section-widget">
<p>Related tags:</p>
{% for nt in note_tags %}
{% include 'cards/tag/note_tag.html.twig' with { 'tag': nt } %}
{% endfor %}
</div>
{% if note_tags is not empty %}
<div class="section-widget section-widget-padded">
<h2>Related tags:</h2>
{% for nt in note_tags %}
{% include 'cards/tag/note_tag.html.twig' with { 'tag': nt } %}
{% endfor %}
</div>
{% endif %}

View File

@ -38,6 +38,10 @@
margin-top: var(--smaller);
}
.profile-info-bio {
word-break: break-all;
}
.profile-avatar {
max-width: 4rem;
max-height: 4rem;
@ -66,6 +70,12 @@
padding: var(--smaller);
}
.section-widget-paging {
display: block;
margin-top: var(--smaller);
margin-left: auto;
}
.section-title {
font-size: var(--small);
font-weight: 700;