[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 [ return [
'_template' => $template, '_template' => $template,
'tag_name' => $canonical,
'results' => $results, 'results' => $results,
'page' => $page, 'page' => $page,
]; ];

View File

@ -1,6 +1,13 @@
{% extends 'base.html.twig' %} {% 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 %} {% block body %}
<h2>{{ 'Notes containing tag:' | trans }} {{ tag_name }}</h2>
{% for pinned in handle_event('AddPinnedFeedContent', app.request) %} {% for pinned in handle_event('AddPinnedFeedContent', app.request) %}
{% include pinned['template'] with { 'actor_tags': pinned['vars']} only %} {% include pinned['template'] with { 'actor_tags': pinned['vars']} only %}
{% endfor %} {% endfor %}
@ -9,5 +16,7 @@
{% block profile_view %}{% include 'cards/profile/view.html.twig' %}{% endblock profile_view %} {% block profile_view %}{% include 'cards/profile/view.html.twig' %}{% endblock profile_view %}
{% endfor %} {% endfor %}
{{ "Page: " ~ page }} <div class="section-widget section-widget-padded">
{{ "Page: " ~ page }}
</div>
{% endblock %} {% endblock %}

View File

@ -1,18 +1,25 @@
{% extends 'base.html.twig' %} {% extends 'base.html.twig' %}
{% import '/cards/note/view.html.twig' as noteView %} {% 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 %} {% block body %}
<h2>{{ 'Notes containing tag:' | trans }} {{ tag_name }}</h2>
{% for pinned in handle_event('AddPinnedFeedContent', app.request) %} {% for pinned in handle_event('AddPinnedFeedContent', app.request) %}
{% include pinned['template'] with { 'note_tags': pinned['vars']} only %} {% include pinned['template'] with { 'note_tags': pinned['vars']} only %}
{% endfor %} {% endfor %}
{% for note in results %} {% for note in results %}
{% block current_note %} {% block current_note %}
<div class="section-widget">
{{ noteView.macro_note(note) }} {{ noteView.macro_note(note) }}
</div>
{% endblock current_note %} {% endblock current_note %}
{% endfor %} {% endfor %}
{{ "Page: " ~ page }} <div class="section-widget section-widget-padded section-widget-paging">
{{ "Page " ~ page }}
</div>
{% endblock %} {% endblock %}

View File

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

View File

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

View File

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