[Directory] Finished implementing groups stream using Directory plugin

This commit is contained in:
Angelo D. Moura 2020-12-01 03:05:10 +00:00 committed by Hugo Sales
parent 08fe5fb23f
commit 66875e93f8
9 changed files with 54 additions and 94 deletions

View File

@ -40,6 +40,6 @@ class Directory
public function groups(Request $request) public function groups(Request $request)
{ {
return ['_template' => 'directory/group.html.twig', 'groups' => DB::dql('select g from App\Entity\Group g order by g.nickname ASC')]; return ['_template' => 'directory/groups.html.twig', 'groups' => DB::dql('select g from App\Entity\Group g order by g.nickname ASC')];
} }
} }

View File

@ -412,22 +412,27 @@
z-index: 0; z-index: 0;
} }
/*actors stream*/
.actors{ /*groups stream*/
.groups{
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
} }
.notes-wrap .timeline .actors > div { .groups > h1 {
padding: var(--unit-size);
}
.notes-wrap .timeline .groups > div {
margin: var(--unit-size) var(--unit-size) 0 var(--unit-size); margin: var(--unit-size) var(--unit-size) 0 var(--unit-size);
border-radius: var(--unit-size); border-radius: var(--unit-size);
width: 100%; width: 100%;
} }
.notes-wrap .timeline .actors > div:last-child { .notes-wrap .timeline .groups > div:last-child {
margin: var(--unit-size) var(--unit-size) var(--unit-size) var(--unit-size); margin: var(--unit-size) var(--unit-size) var(--unit-size) var(--unit-size);
} }
.actor{ .group{
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
border: solid 2px var(--accent-low); border: solid 2px var(--accent-low);
@ -436,7 +441,7 @@
margin-bottom: var(--unit-size); margin-bottom: var(--unit-size);
} }
.actor-content { .group-content {
order: 3; order: 3;
word-break: break-word; word-break: break-word;
padding: var(--small-size); padding: var(--small-size);
@ -447,13 +452,13 @@
justify-content: space-between; justify-content: space-between;
} }
.actor-info{ .group-info {
order: 3; order: 3;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
} }
.actor-bio{ .group-description {
order: 3; order: 3;
word-break: break-word; word-break: break-word;
padding: var(--small-size); padding: var(--small-size);
@ -461,4 +466,4 @@
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
justify-content: right; justify-content: right;
} }

View File

@ -411,22 +411,27 @@
z-index: 0; z-index: 0;
} }
/*actors stream*/ /*groups stream*/
.actors{ .groups{
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
} }
.notes-wrap .timeline .actors > div { .groups > h1 {
padding: var(--unit-size);
}
.notes-wrap .timeline .groups > div {
margin: var(--unit-size) var(--unit-size) 0 var(--unit-size); margin: var(--unit-size) var(--unit-size) 0 var(--unit-size);
border-radius: var(--unit-size); border-radius: var(--unit-size);
width: 100%; width: 100%;
} }
.notes-wrap .timeline .actors > div:last-child {
.notes-wrap .timeline .groups > div:last-child {
margin: var(--unit-size) var(--unit-size) var(--unit-size) var(--unit-size); margin: var(--unit-size) var(--unit-size) var(--unit-size) var(--unit-size);
} }
.actor{ .group{
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
border: solid 2px var(--accent-low); border: solid 2px var(--accent-low);
@ -435,7 +440,7 @@
margin-bottom: var(--unit-size); margin-bottom: var(--unit-size);
} }
.actor-content { .group-content {
order: 3; order: 3;
word-break: break-word; word-break: break-word;
padding: var(--small-size); padding: var(--small-size);
@ -446,13 +451,13 @@
justify-content: space-between; justify-content: space-between;
} }
.actor-info{ .group-info {
order: 3; order: 3;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
} }
.actor-bio{ .group-description {
order: 3; order: 3;
word-break: break-word; word-break: break-word;
padding: var(--small-size); padding: var(--small-size);
@ -460,4 +465,4 @@
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
justify-content: right; justify-content: right;
} }

View File

@ -409,54 +409,3 @@
cursor: pointer; cursor: pointer;
z-index: 0; z-index: 0;
} }
/*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);
display: flex;
flex-wrap: wrap;
justify-content: right;
}

View File

@ -138,22 +138,4 @@ END;
'order by f.created DESC', ['id' => $actor_id]), 'order by f.created DESC', ['id' => $actor_id]),
]; ];
} }
public function actors(Request $request)
{
return [
'_template' => 'network/actors.html.twig',
'actors' => DB::dql('select a from App\Entity\GSActor a ' .
'order by a.nickname ASC'),
];
}
public function groups(Request $request)
{
return [
'_template' => 'network/groups.html.twig',
'groups' => DB::dql('select g from App\Entity\Group g ' .
'order by g.nickname ASC'),
];
}
} }

View File

@ -53,10 +53,6 @@ abstract class Main
$r->connect('replies', '/{nickname<' . Nickname::DISPLAY_FMT . '>}/replies', [C\Network::class, 'replies']); $r->connect('replies', '/{nickname<' . Nickname::DISPLAY_FMT . '>}/replies', [C\Network::class, 'replies']);
$r->connect('favourites', '/{nickname<' . Nickname::DISPLAY_FMT . '>}/favourites', [C\Network::class, 'favourites']); $r->connect('favourites', '/{nickname<' . Nickname::DISPLAY_FMT . '>}/favourites', [C\Network::class, 'favourites']);
$r->connect('actors', '/actors', [C\Network::class, 'actors']);
$r->connect('groups', '/groups', [C\Network::class, 'groups']);
$r->connect('groups_stream', '/groups/stream', [C\Network::class, 'groups']);
$r->connect('panel', '/panel', [C\AdminPanel::class, 'site']); $r->connect('panel', '/panel', [C\AdminPanel::class, 'site']);
$r->connect('panel_site', '/panel/site', [C\AdminPanel::class, 'site']); $r->connect('panel_site', '/panel/site', [C\AdminPanel::class, 'site']);

View File

@ -0,0 +1,23 @@
<div class="group">
<div class="group-content">
<a href="{{ group.getHomepage() }}">
<div class="group-info">
{% set nickname = group.getNickname() %}
<div class="group-img">
<img class="icon icon-group" src="{{ asset(group.getStreamLogo()) }}" alt="{{ nickname }}'s logo">
</div>
<div class="group-nickname">
<b id="nick">{{ nickname }}</b>
</div>
</div>
</a>
{% set group_description = group.getDescription() %}
<div class="group-description">
{% if group_description %}
<p>{{ group_description }}</p>
{% else %}
<p>{{ '(No description)' | trans }}</p>
{% endif %}
</div>
</div>
</div>

View File

@ -91,7 +91,7 @@
<a href="{{ path('main_all') }}" class='hover-effect {{ active('main_all') }}'>Network</a> <a href="{{ path('main_all') }}" class='hover-effect {{ active('main_all') }}'>Network</a>
</li> </li>
<li> <li>
<a href="{{ path('groups_stream') }}" class='hover-effect {{ active('groups_stream') }}'>Groups</a> <a href="{{ path('groups') }}" class='hover-effect {{ active('groups') }}'>Groups</a>
</li> </li>
</ul> </ul>
</nav> </nav>
@ -99,7 +99,7 @@
<div class="groups"> <div class="groups">
{% if groups is defined and groups is not empty %} {% if groups is defined and groups is not empty %}
{% for group in groups %} {% for group in groups %}
{% include '/group/group.html.twig' with {'group': group, 'have_user': have_user} only %} {% include '/directory/group.html.twig' with {'group': group, 'have_user': have_user} only %}
{% endfor %} {% endfor %}
{% else %} {% else %}
<h1>{% trans %}No groups here.{% endtrans %}</h1> <h1>{% trans %}No groups here.{% endtrans %}</h1>