mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-11-26 21:58:31 +00:00
Compare commits
3 Commits
459-invita
...
474-improv
| Author | SHA1 | Date | |
|---|---|---|---|
| a15c2aedd4 | |||
| 23d067fffe | |||
| 330b8fddb3 |
@@ -1,6 +0,0 @@
|
||||
kind: Feature
|
||||
body: Add a counter for invitations awaiting reply
|
||||
time: 2025-11-25T16:58:11.780678466+01:00
|
||||
custom:
|
||||
Issue: "459"
|
||||
SchemaChange: No schema change
|
||||
6
.changes/unreleased/UX-20251126-133910.yaml
Normal file
6
.changes/unreleased/UX-20251126-133910.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
kind: UX
|
||||
body: Improve accessibility of event form
|
||||
time: 2025-11-26T13:39:10.462348982+01:00
|
||||
custom:
|
||||
Issue: "474"
|
||||
SchemaChange: No schema change
|
||||
@@ -11,7 +11,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace Chill\CalendarBundle\Menu;
|
||||
|
||||
use Chill\CalendarBundle\Repository\InviteRepository;
|
||||
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
||||
use Knp\Menu\MenuItem;
|
||||
use Symfony\Component\Security\Core\Security;
|
||||
@@ -19,12 +18,10 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
class UserMenuBuilder implements LocalMenuBuilderInterface
|
||||
{
|
||||
public function __construct(private readonly Security $security, public TranslatorInterface $translator, private readonly InviteRepository $inviteRepository) {}
|
||||
public function __construct(private readonly Security $security, public TranslatorInterface $translator) {}
|
||||
|
||||
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
||||
{
|
||||
$invitationsPending = $this->inviteRepository->countPendingInvitesByUser($this->security->getUser());
|
||||
|
||||
if ($this->security->isGranted('ROLE_USER')) {
|
||||
$menu->addChild('My calendar list', [
|
||||
'route' => 'chill_calendar_calendar_list_my',
|
||||
@@ -33,14 +30,12 @@ class UserMenuBuilder implements LocalMenuBuilderInterface
|
||||
'order' => 8,
|
||||
'icon' => 'tasks',
|
||||
]);
|
||||
$menu->addChild(
|
||||
$this->translator->trans('invite.menu with counter', ['nb' => $invitationsPending]),
|
||||
['route' => 'chill_calendar_invitations_list_my']
|
||||
)
|
||||
$menu->addChild('invite.list.title', [
|
||||
'route' => 'chill_calendar_invitations_list_my',
|
||||
])
|
||||
->setExtras([
|
||||
'order' => 9,
|
||||
'icon' => 'tasks',
|
||||
'counter' => 0 < $invitationsPending ? $invitationsPending : null,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,25 +75,6 @@ class InviteRepository implements ObjectRepository
|
||||
->getSingleScalarResult();
|
||||
}
|
||||
|
||||
public function countPendingInvitesByUser(User $user): int
|
||||
{
|
||||
$qb = $this->entityRepository->createQueryBuilder('i');
|
||||
|
||||
$qb->select('COUNT(i)')
|
||||
->where(
|
||||
$qb->expr()->andX(
|
||||
$qb->expr()->eq('i.user', ':user'),
|
||||
$qb->expr()->eq('i.status', ':status')
|
||||
)
|
||||
)
|
||||
->setParameters([
|
||||
'user' => $user,
|
||||
'status' => Invite::PENDING,
|
||||
]);
|
||||
|
||||
return $qb->getQuery()->getSingleScalarResult();
|
||||
}
|
||||
|
||||
public function buildAcceptedInviteByUserAndDateRangeQuery(User $user, \DateTimeImmutable $from, \DateTimeImmutable $to)
|
||||
{
|
||||
$qb = $this->entityRepository->createQueryBuilder('i');
|
||||
|
||||
@@ -6,11 +6,3 @@ chill_calendar:
|
||||
few {# rendez-vous sont ignorés par le filtre de date. Modifiez le filtre de date pour les voir apparaitre.}
|
||||
other {# rendez-vous sont ignorés par le filtre de date. Modifiez le filtre de date pour les voir apparaitre.}
|
||||
}
|
||||
invite:
|
||||
menu with counter: >-
|
||||
{nb, plural,
|
||||
=0 {Mes invitations}
|
||||
one {# invitation}
|
||||
few {# invitations}
|
||||
other {# invitations}
|
||||
}
|
||||
|
||||
@@ -96,7 +96,6 @@ invite:
|
||||
list:
|
||||
none: Il n'y aucun invitation
|
||||
title: Mes invitations
|
||||
number of invitations waiting: Invitations en attente
|
||||
|
||||
# exports
|
||||
Exports of calendar: Exports des rendez-vous
|
||||
|
||||
@@ -486,7 +486,7 @@ final class ParticipationController extends AbstractController
|
||||
|
||||
return $this->redirectToRoute(
|
||||
'chill_event__event_show',
|
||||
['event_id' => $event->getId()]
|
||||
['id' => $event->getId()]
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
{{ form_row(edit_form.circle) }}
|
||||
{{ form_row(edit_form.name) }}
|
||||
{{ form_row(edit_form.date) }}
|
||||
|
||||
{{ form_row(edit_form.type, { label: "Event type" }) }}
|
||||
{{ form_row(edit_form.themes) }}
|
||||
{{ form_row(edit_form.moderator) }}
|
||||
|
||||
@@ -37,4 +37,9 @@ class ChillDateTimeType extends AbstractType
|
||||
{
|
||||
return DateTimeType::class;
|
||||
}
|
||||
|
||||
public function getBlockPrefix(): string
|
||||
{
|
||||
return 'chill_datetime';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -311,3 +311,32 @@
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block chill_datetime_label %}
|
||||
<label for="{{ form.date.vars.id }}" class="col-form-label col-sm-4 required">
|
||||
{{ "Date"|trans }}
|
||||
</label>
|
||||
{% endblock %}
|
||||
|
||||
{% block chill_datetime_widget %}
|
||||
<div class="col-sm-8 d-flex align-items-start gap-2">
|
||||
{#date#}
|
||||
{{ form_widget(form.date, {
|
||||
attr: { class: 'form-control', style: 'flex: 1 1 auto;' }
|
||||
}) }}
|
||||
{#time#}
|
||||
{{ form_widget(form.time, {
|
||||
attr: {
|
||||
class: 'form-select',
|
||||
style: 'flex: 0 0 200px; max-width: 200px; white-space: nowrap; padding:0;'
|
||||
}
|
||||
}) }}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block chill_datetime_row %}
|
||||
<div class="mb-3 row">
|
||||
{{ block('chill_datetime_label') }}
|
||||
{{ block('chill_datetime_widget') }}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user