[Plugins][Components] Fixed issue where right panel form was rendered multiple times in actors plugin page. Actors page done.

This commit is contained in:
2021-09-17 21:51:55 +01:00
committed by Diogo Peralta Cordeiro
parent e4b650be46
commit 6c899b7b61
6 changed files with 35 additions and 37 deletions

View File

@@ -1,37 +1,32 @@
{% extends 'stdgrid.html.twig' %}
{% set nickname = note.getActorNickname() %}
{% block title %}{{ nickname }}'s profile{% endblock %}
{% set actor_nickname = actor.nickname() %}
{% set actor_tags = actor.getSelfTags() %}
{% set actor_bio = actor.getBio() %}
{% block body %}
<section class="section-widget section-widget-padded">
<div class="section-title">
<img class="icon icon-avatar" src="{{ actor.getAvatarUrl() }}" alt="{{ nickname }}'s avatar">{{ nickname }}
</div>
<section class='section-widget section-widget-padded' title="{{ 'Your profile information.' | trans }}">
<a id="user" href="{{ path('actor_view_nickname', {'nickname' : actor_nickname}) }}">
<img src='{{ user_avatar }}' class="icon icon-avatar" alt="{{ 'Your account\'s avatar.' | trans }}">
<div class="user-info">
<strong id="user-nickname" title="{{ 'Your account\' nickname.' | trans }}">{{ actor_nickname }}</strong>
<div class="actor-nickname-and-tags">
{% set actor_tags = actor.getSelfTags() %}
<div class="tags">
{% if actor_tags %}
{% for tag in actor_tags %}
<a href='#'><i> #{{ tag }} </i></a>
{% endfor %}
{% else %}
<i> {{ '(No tags)' | trans }} </i>
{% endif %}
</div>
</div>
{% set actor_bio = actor.getBio() %}
<div class="actor-bio">
{% if actor_bio %}
<p>{{ actor_bio }}</p>
{% else %}
<p>{{ '(No bio)' | trans }}</p>
{% endif %}
</div>
<nav class="user-tags">
{% if actor_tags %}
{% for tag in actor_tags %}
<a href='#'><i> #{{ tag }} </i></a>
{% endfor %}
{% else %}
<i> {{ '(No tags)' | trans }} </i>
{% endif %}
</nav>
<section class="user-bio">
{% if actor_bio %}
<p>{{ actor_bio }}</p>
{% else %}
<p>{{ '(No bio)' | trans }}</p>
{% endif %}
</section>
</div>
</a>
</section>
{% endblock body %}

View File

@@ -4,10 +4,12 @@
{% block body %}
<section class="section-widget section-widget-padded">
<div class="actors">
<h2 class="section-title">{{ "Actors" | trans }}</h2>
<div class="section-widget-padded">
{% if actors is defined and actors is not empty %}
{% for actor in actors %}
{% include 'directory/actor.html.twig' with {'actor': actor, 'have_user': have_user} only %}
{% include 'directory/actor.html.twig' %}
{% endfor %}
{% else %}
<h1>{% trans %}No actors here.{% endtrans %}</h1>