Fix some issues
This commit is contained in:
@@ -48,12 +48,22 @@ class AdminController extends AbstractController
|
|||||||
): Response {
|
): Response {
|
||||||
return $this->render('admin/index.html.twig', [
|
return $this->render('admin/index.html.twig', [
|
||||||
'controller_name' => 'AdminController',
|
'controller_name' => 'AdminController',
|
||||||
'documents' => $DocumentRepository->findAll(),
|
'documents' => $DocumentRepository->list()->order(['createdAt' => 'DESC'])->limit(5)->getResult(),
|
||||||
'users' => $UserRepository->findAll(),
|
'users' => $UserRepository->getAll()->order(['createdAt' => 'DESC'])->limit(5)->getResult(),
|
||||||
'directories' => $DirectoryRepository->findAll(),
|
'directories' => $DirectoryRepository->list()->order(['createdAt' => 'DESC'])->limit(5)->getResult(),
|
||||||
'folders' => $DocumentRepository->list()->limitType("Folder")->getResult(),
|
'folders' => $DocumentRepository
|
||||||
'gangs' => $DocumentRepository->list()->limitType("Gang")->getResult(),
|
->list()
|
||||||
'groups' => $GroupRepository->findAll(),
|
->limitType("Folder")
|
||||||
|
->order(['createdAt' => 'DESC'])
|
||||||
|
->limit(5)
|
||||||
|
->getResult(),
|
||||||
|
'gangs' => $DocumentRepository
|
||||||
|
->list()
|
||||||
|
->limitType("Gang")
|
||||||
|
->order(['createdAt' => 'DESC'])
|
||||||
|
->limit(5)
|
||||||
|
->getResult(),
|
||||||
|
'groups' => $GroupRepository->getAll()->order(['createdAt' => 'DESC'])->limit(5)->getResult(),
|
||||||
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -91,7 +91,11 @@ class DirectoryController extends AbstractController
|
|||||||
* @var CertificateRepository $repo
|
* @var CertificateRepository $repo
|
||||||
*/
|
*/
|
||||||
$repo = $entityManager->getRepository('App\Entity\\' . $dType);
|
$repo = $entityManager->getRepository('App\Entity\\' . $dType);
|
||||||
$RenderArray[$dType] = $repo->listForUser($this->getUser())->limitDirectory($Directory)->getResult();
|
$RenderArray[$dType] = $repo->listForUser($this->getUser())
|
||||||
|
->limitDirectory($Directory)
|
||||||
|
->order(['createdAt' => 'DESC'])
|
||||||
|
->limit(4)
|
||||||
|
->getResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ class AdminUserType extends AbstractType
|
|||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if (!$UserGroup->getSubGroups()->isEmpty()) {
|
if ($UserGroup != null && !$UserGroup->getSubGroups()->isEmpty()) {
|
||||||
$builder
|
$builder
|
||||||
->add('subGroups', EntityType::class, [
|
->add('subGroups', EntityType::class, [
|
||||||
'class' => SubGroup::class,
|
'class' => SubGroup::class,
|
||||||
|
|||||||
@@ -87,8 +87,8 @@
|
|||||||
<hr>
|
<hr>
|
||||||
<div class="border-start p-3">
|
<div class="border-start p-3">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-body">{{ app.user.mainGroup.motd | raw }}</div>
|
<div class="card-body">{{ group.motd | raw }}</div>
|
||||||
<div class="card-footer">{% trans %}title_last_update{% endtrans %} : {{ app.user.mainGroup.motdUpdatedAt | date('_datetime.format'|trans) }}</div>
|
<div class="card-footer">{% trans %}title_last_update{% endtrans %} : {{ group.motdUpdatedAt | date('_datetime.format'|trans) }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{% extends 'base.html.twig' %}
|
{% extends 'base.html.twig' %}
|
||||||
|
|
||||||
{% block title %}{% trans %}title_directory_list{% endtrans %}{% endblock %}
|
{% block title %}{% trans %}title_directory_list{% endtrans %}{% endblock %}
|
||||||
{% block subtitle %}{% trans %}title_directory_list{% endtrans %}{% if app.user.hasPermission('group_administrate') %} <a href="{{ path('directory_create') }}"><span class="badge rounded-pill bg-success"><i class="fa fa-plus"></i> {% trans %}button_create{% endtrans %}</span></a>{% endif %}{% endblock %}
|
{% block subtitle %}{% trans %}title_directory_list{% endtrans %}{% if app.user.hasPermission('directory_create') %} <a href="{{ path('directory_create') }}"><span class="badge rounded-pill bg-success"><i class="fa fa-plus"></i> {% trans %}button_create{% endtrans %}</span></a>{% endif %}{% endblock %}
|
||||||
|
|
||||||
{% block body %}
|
{% block body %}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|||||||
Reference in New Issue
Block a user