diff --git a/src/Controller/OrganizationController.php b/src/Controller/OrganizationController.php index c0ee87a..dadde71 100644 --- a/src/Controller/OrganizationController.php +++ b/src/Controller/OrganizationController.php @@ -80,6 +80,11 @@ class OrganizationController extends AbstractController $applications = $this->organizationsService->getApplicationsWithAccessStatus($organization); $actions = $organization->getActions()->toArray(); + usort($actions, static function($a, $b) { + return $b->getDate() <=> $a->getDate(); + }); + //get the last 10 activities + $actions = array_slice($actions, 0, 10); $activities = array_map(static function($activity) use ($actionService) { return [ 'date' => $activity->getDate(), // or however you access the date diff --git a/src/Entity/Apps.php b/src/Entity/Apps.php index 19203db..d338949 100644 --- a/src/Entity/Apps.php +++ b/src/Entity/Apps.php @@ -39,6 +39,9 @@ class Apps #[ORM\ManyToMany(targetEntity: organizations::class, inversedBy: 'apps')] private Collection $organization; + #[ORM\Column(length: 255, nullable: true)] + private ?string $descriptionSmall = null; + public function __construct() { $this->organization = new ArrayCollection(); @@ -144,4 +147,16 @@ class Apps return $this; } + + public function getDescriptionSmall(): ?string + { + return $this->descriptionSmall; + } + + public function setDescriptionSmall(?string $descriptionSmall): static + { + $this->descriptionSmall = $descriptionSmall; + + return $this; + } } diff --git a/templates/applications/appSmall.html.twig b/templates/applications/appSmall.html.twig new file mode 100644 index 0000000..e3ebdbd --- /dev/null +++ b/templates/applications/appSmall.html.twig @@ -0,0 +1,19 @@ +{% block body %} + +
{{ application.application.descriptionSmall }}
+ Y accéder + {% if application.has_access %} + Gérer l'application + {% endif %} +