[Directory] Actors are no longer related with notes, and the logged in user now shows on the stream

This commit is contained in:
Angelo D. Moura 2020-11-30 01:39:32 +00:00 committed by Hugo Sales
parent 2d91f3d0b3
commit 505e60d89f
Signed by: someonewithpc
GPG Key ID: 7D0C7EAFC9D835A0
7 changed files with 159 additions and 51 deletions

View File

@ -413,13 +413,52 @@
}
/*actors stream*/
.actors{
display: flex;
flex-wrap: wrap;
}
.notes-wrap .timeline .actors > div {
margin: var(--unit-size) var(--unit-size) 0 var(--unit-size);
border-radius: var(--unit-size);
width: 100%;
}
.notes-wrap .timeline .actors > div:last-child {
margin: var(--unit-size) var(--unit-size) var(--unit-size) var(--unit-size);
}
.actor{
display: flex;
flex-wrap: wrap;
border: solid 2px var(--accent-low);
border-radius: var(--unit-size);
box-shadow: var(--shadow);
margin-bottom: var(--unit-size);
}
.actor-content {
order: 3;
word-break: break-word;
padding: var(--small-size);
border-radius: 0 0 var(--unit-size) var(--unit-size);
width: 100%;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
.actor-info{
order: 3;
display: flex;
flex-wrap: wrap;
}
.actor-bio{
order: 3;
word-break: break-word;
padding: var(--small-size);
border-radius: 0 0 var(--unit-size) var(--unit-size);
width: 70%;
display: flex;
flex-wrap: wrap;
justify-content: right;
justify-content: right;
}

View File

@ -412,12 +412,51 @@
}
/*actors stream*/
.actors{
display: flex;
flex-wrap: wrap;
}
.notes-wrap .timeline .actors > div {
margin: var(--unit-size) var(--unit-size) 0 var(--unit-size);
border-radius: var(--unit-size);
width: 100%;
}
.notes-wrap .timeline .actors > div:last-child {
margin: var(--unit-size) var(--unit-size) var(--unit-size) var(--unit-size);
}
.actor{
display: flex;
flex-wrap: wrap;
border: solid 2px var(--accent-low);
border-radius: var(--unit-size);
box-shadow: var(--shadow);
margin-bottom: var(--unit-size);
}
.actor-content {
order: 3;
word-break: break-word;
padding: var(--small-size);
border-radius: 0 0 var(--unit-size) var(--unit-size);
width: 100%;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
.actor-info{
order: 3;
display: flex;
flex-wrap: wrap;
}
.actor-bio{
order: 3;
word-break: break-word;
padding: var(--small-size);
border-radius: 0 0 var(--unit-size) var(--unit-size);
width: 70%;
display: flex;
flex-wrap: wrap;
justify-content: right;

View File

@ -411,12 +411,51 @@
}
/*actors stream*/
.actors{
display: flex;
flex-wrap: wrap;
}
.notes-wrap .timeline .actors > div {
margin: var(--unit-size) var(--unit-size) 0 var(--unit-size);
border-radius: var(--unit-size);
width: 100%;
}
.notes-wrap .timeline .actors > div:last-child {
margin: var(--unit-size) var(--unit-size) var(--unit-size) var(--unit-size);
}
.actor{
display: flex;
flex-wrap: wrap;
border: solid 2px var(--accent-low);
border-radius: var(--unit-size);
box-shadow: var(--shadow);
margin-bottom: var(--unit-size);
}
.actor-content {
order: 3;
word-break: break-word;
padding: var(--small-size);
border-radius: 0 0 var(--unit-size) var(--unit-size);
width: 100%;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
.actor-info{
order: 3;
display: flex;
flex-wrap: wrap;
}
.actor-bio{
order: 3;
word-break: break-word;
padding: var(--small-size);
border-radius: 0 0 var(--unit-size) var(--unit-size);
width: 70%;
display: flex;
flex-wrap: wrap;
justify-content: right;

View File

@ -141,21 +141,10 @@ END;
public function actors(Request $request)
{
if (Common::isLoggedIn()) {
$user_id = Common::ensureLoggedIn()->getId();
return [
'_template' => 'network/actors.html.twig',
'actors' => DB::dql('select a from App\Entity\GSActor a ' .
'where a.id != :id ' .
'order by a.created DESC', ['id' => $user_id]),
];
} else {
return [
'_template' => 'network/actors.html.twig',
'actors' => DB::dql('select a from App\Entity\GSActor a ' .
'order by a.created DESC'),
];
}
return [
'_template' => 'network/actors.html.twig',
'actors' => DB::dql('select a from App\Entity\GSActor a ' .
'order by a.created DESC'),
];
}
}

View File

@ -0,0 +1,31 @@
<div class="actor">
<div class="actor-content">
<div class="actor-info">
{% set nickname = actor.getNickname() %}
<div class="actor-avatar">
<img class="icon icon-avatar" src="{{ actor.getAvatarUrl() }}" alt="{{ nickname }}'s avatar">
</div>
<div class="actor-nickname-and-tags">
<b id="nick">{{ nickname }}</b>
{% 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>
</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>
</div>
</div>

View File

@ -96,10 +96,10 @@
</ul>
</nav>
<div class="timeline">
<div class="notes actors">
<div class="actors">
{% if actors is defined and actors is not empty %}
{% for actor in actors %}
{% include '/note/actor.html.twig' with {'actor': actor, 'have_user': have_user} only %}
{% include '/actor/actor.html.twig' with {'actor': actor, 'have_user': have_user} only %}
{% endfor %}
{% else %}
<h1>{% trans %}No actors here.{% endtrans %}</h1>

View File

@ -1,29 +0,0 @@
<div class="note actor">
<div class="note-content">
{% set nickname = actor.getNickname() %}
<div class="actor-avatar">
<img class="icon icon-avatar" src="{{ actor.getAvatarUrl() }}" alt="{{ nickname }}'s avatar">
</div>
<div class="actor-info">
<b id="nick">{{ nickname }}</b>
{% 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>
</div>
</div>