diff --git a/public/assets/css/azia.css b/public/assets/css/azia.css index 636e96f..807382b 100755 --- a/public/assets/css/azia.css +++ b/public/assets/css/azia.css @@ -8932,7 +8932,7 @@ a.text-dark:hover, a.text-dark:focus { margin-bottom: 20px; } @media (min-width: 992px) { .az-content-title { - margin-bottom: 40px; } } + margin-bottom: 30px; } } .az-content-label { color: #1c273c; diff --git a/src/Controller/BroadcastController.php b/src/Controller/BroadcastController.php index ee6a206..96287b3 100644 --- a/src/Controller/BroadcastController.php +++ b/src/Controller/BroadcastController.php @@ -75,6 +75,8 @@ final class BroadcastController extends AbstractController $this->stateRepository->addState($investigation, 3, 1, $broadcast); + $this->addFlash('danger', " Well done! You successfully read this important alert message."); + return $this->redirectToRoute('app_broadcast_index'); } diff --git a/src/Controller/DemoController.php b/src/Controller/DemoController.php index a8113e1..8160c86 100644 --- a/src/Controller/DemoController.php +++ b/src/Controller/DemoController.php @@ -6,6 +6,8 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Attribute\Route; +use Symfony\Contracts\Translation\TranslatorInterface; + final class DemoController extends AbstractController { #[Route('/demo/index', name: 'app_demo_index')] @@ -18,6 +20,9 @@ final class DemoController extends AbstractController #[Route('/demo/empty', name: 'app_demo_empty')] public function empty(): Response { + $this->addFlash('danger', " Well done! You successfully read this important alert message."); + + //$this->addFlash('success', $this->translator->trans('conference.success_create_message', array(), 'Admin')); return $this->render('demo/empty.html.twig', []); } diff --git a/src/Controller/InvestigationController.php b/src/Controller/InvestigationController.php index 16417e7..774c021 100644 --- a/src/Controller/InvestigationController.php +++ b/src/Controller/InvestigationController.php @@ -9,6 +9,8 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Attribute\Route; +use Symfony\Contracts\Translation\TranslatorInterface; + use Doctrine\ORM\EntityManagerInterface; use App\Entity\State; @@ -24,16 +26,19 @@ final class InvestigationController extends AbstractController { /** * @param EntityManagerInterface $em + * @param TranslatorInterface $translator * @param StateRepository $stateRepository * @param InvestigationRepository $investigationRepository * @return $this */ public function __construct( private EntityManagerInterface $em, + private TranslatorInterface $translator, private StateRepository $stateRepository, private InvestigationRepository $investigationRepository, ) { $this->em = $em; + $this->translator = $translator; $this->stateRepository = $stateRepository; $this->investigationRepository = $investigationRepository; } @@ -41,7 +46,7 @@ final class InvestigationController extends AbstractController #[Route('/index', name: 'app_investigation_index')] public function index(): Response { - $investigations = $this->investigationRepository->findBy(['create_by' => $this->getUser()], ["id" => 'DESC']); + $investigations = $this->investigationRepository->findBy(['create_by' => $this->getUser(), 'last_state' => [10, 11, 12, 20, 21, 22]], ["id" => 'DESC']); $invesAdmins = $this->investigationRepository->findBy(['create_by' => $this->getUser(), 'last_state' => 21], ["id" => 'DESC']); @@ -65,6 +70,9 @@ final class InvestigationController extends AbstractController $this->em->persist($investigation); $this->em->flush(); + + $this->addFlash('success', $this->translator->trans('alert_sucess_add', [], 'investigation')); + return $this->redirectToRoute('app_investigation_index'); } return $this->render('investigation/add-index.html.twig', [ @@ -86,10 +94,13 @@ final class InvestigationController extends AbstractController $form = $this->createForm(InvestigationType::class, $investigation); $form->handleRequest($request); - if ($form->isSubmitted() && $form->isValid()) { + if ($form->isSubmitted() && $form->isValid()) + { $investigation = $form->getData(); $this->em->persist($investigation); $this->em->flush(); + + $this->addFlash('success', $this->translator->trans('alert_sucess_add', [], 'investigation')); } return $this->render('investigation/add-index.html.twig', [ @@ -133,6 +144,8 @@ final class InvestigationController extends AbstractController $this->stateRepository->addState($investigation, 2, 1); + $this->addFlash('success', $this->translator->trans('alert_sucess_send_validation', [], 'investigation')); + return $this->redirectToRoute('app_investigation_index'); } @@ -153,8 +166,11 @@ final class InvestigationController extends AbstractController { $investigations = $this->investigationRepository->findBy(['last_state' => 21], ["id" => 'DESC']); - $id = $request->request->get('id'); + $this->addFlash('success', $this->translator->trans('alert_sucess', array(), 'active')); + + $id = $request->query->get('id'); if ($id) { + $investigation = $this->investigationRepository->find($id); $investigation->setLastState(20); @@ -162,6 +178,7 @@ final class InvestigationController extends AbstractController $this->em->flush(); $this->stateRepository->addState($investigation, 2, 0); + } return $this->render('investigation/admin-active.html.twig', [ diff --git a/src/Entity/User.php b/src/Entity/User.php index 3383ee9..b30c27c 100644 --- a/src/Entity/User.php +++ b/src/Entity/User.php @@ -180,6 +180,11 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface return $this->lastLogin; } + public function getLastLoginFormat($format): string + { + return $this->lastLogin->format($format); + } + public function setLastLogin(\DateTimeInterface $lastLogin): self { $this->lastLogin = $lastLogin; diff --git a/templates/basic/alert.html.twig b/templates/basic/alert.html.twig new file mode 100644 index 0000000..0aa2263 --- /dev/null +++ b/templates/basic/alert.html.twig @@ -0,0 +1,10 @@ +{% for label, messages in app.flashes %} + {% for message in messages %} + + {% endfor %} +{% endfor %} \ No newline at end of file diff --git a/templates/broadcast/index.html.twig b/templates/broadcast/index.html.twig index 5b99369..f88a5c0 100644 --- a/templates/broadcast/index.html.twig +++ b/templates/broadcast/index.html.twig @@ -46,6 +46,7 @@ +
en cours de divusion

Liste des enquêtes en cours de divusion

@@ -66,7 +67,7 @@ {% for broadcast in broadcasts %} - {{ broadcast.getId() }} + {{ broadcast.getInvestigation().getId() }} {{ broadcast.getInvestigation().getNameEn() }} {{ broadcast.getDateCreate()|date("d/m/Y") }} {{ broadcast.getDateEnd()|date("d/m/Y") }} diff --git a/templates/demo/empty.html.twig b/templates/demo/empty.html.twig index 5f0774b..8e3b092 100644 --- a/templates/demo/empty.html.twig +++ b/templates/demo/empty.html.twig @@ -20,11 +20,7 @@

Liste des -----

- - - - - + {% include 'basic/alert.html.twig' %} diff --git a/templates/home/index.html.twig b/templates/home/index.html.twig index 377a947..2dc39db 100644 --- a/templates/home/index.html.twig +++ b/templates/home/index.html.twig @@ -1,11 +1,9 @@ {% extends 'base.html.twig' %} -{% block title %}Page d'accueil{% endblock %} +{% trans_default_domain 'home' %} + +{% block title %} {{ 'home'|trans }} {% endblock %} -{% set navbarTitle = "Page d'accueil" %} -{# -{% set navbarPages = [{'page':"Page d'accueil", 'url':null }] %} -#} {% block content %} @@ -14,641 +12,25 @@
-

Hi, welcome back!

-

Your web analytics dashboard template.

+

{{ 'welcome'|trans }}

+

{{ app.user.getPseudo() }}

- -
Oct 10, 2018
+ +
{{ app.user.getLastLoginFormat('d/m/Y H:i') }}
- -
-
- -
Oct 23, 2018
-
- -
- -
-
- -
All Categories
-
- -
- - Export
- -
- - -
-
-
-
-
-
-
Website Audience Metrics
-

Audience to which the users belonged while on the current date range.

-
-
- - - -
-
- -
-
-
- -

13,956

-
-
- -

33.50%

-
-
- -

83,123

-
-
- -

16,869

-
-
- -
-
-
- -
- -
- -
- -
-
-
-
-
-
33.50% 18.02%
-

Bounce Rate

-
- -
-
-
-
- -
- -
- -
- -
-
-
-
86k 0.86%
-

Total Users

-
- -
-
-
-
- -
- -
- -
- -
-
-
-

All Sessions

-
16,869 2.87%
- The total number of sessions within the date range. It is the period time a user is actively engaged with your website, page or app, etc. -
- -
-
- -
-
-
-
-
- -
- -
- -
-
-
-
-
Page Views by Page Title
-

This report is based on 100% of sessions.

-
- -
-
-
-
Admin Home
- /demo/admin/{{ path('app_demo_index') }} -
-
-
7,755
- 31.74% (-100.00%) -
-
- -
-
-
Form Elements
- /demo/admin/forms.html -
-
-
5,215
- 28.53% (-100.00%) -
-
- -
-
-
Utilities
- /demo/admin/util.html -
-
-
4,848
- 25.35% (-100.00%) -
-
- -
-
-
Form Validation
- /demo/admin/validation.html -
-
-
3,275
- 23.17% (-100.00%) -
-
- -
-
-
Modals
- /demo/admin/modals.html -
-
-
3,003
- 22.21% (-100.00%) -
-
- -
- -
- -
- -
-
-
-
Sessions by Channel
-
- -
-
-
- -
-
- -
-
-
- Organic Search - 1,320 (25%) -
-
-
-
- -
-
-
- Email - 987 (20%) -
-
-
-
- -
-
-
- Referral - 2,010 (30%) -
-
-
-
- -
-
-
- Social - 654 (15%) -
-
-
-
- -
-
-
- Other - 400 (10%) -
-
-
-
- -
-
- -
- -
- -
- -
- -
-
-
-
-
-
-
Acquisition
- Tells you where your visitors originated from, such as search engines, social networks or website referrals. -
- -
-
-
- 6,4,7,5,7 -
-
- -

33.50%

-
-
- -
-
- 7,4,5,7,2 -
-
- -

9,065

-
-
- -
- -
- -
- -
-
-
-
Sessions
- A session is the period time a user is actively engaged with your website, app, etc. -
- -
-
-
- 4/7 -
-
- -

26.80%

-
-
- -
-
- 2/7 -
-
- -

1,005

-
-
- -
- -
- -
- -
- -
- -
-
-
What pages do your users visit
-

Part of this date range occurs before the new users metric had been calculated, so the old users metric is displayed.

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 CountryEntrancesBounce RateExits
United States134 (1.51%)33.58%15.47%
United Kingdom290 (3.30%)9.22%7.99%
India250 (3.00%)20.75%2.40%
Canada216 (2.79%)32.07%15.09%
France216 (2.79%)32.07%15.09%
Philippines197 (2.12%)32.07%15.09%
-
- -
- -
- -
{% block javascripts %} - - - - - {% endblock %} + + {% endblock %} {% endblock %} \ No newline at end of file diff --git a/templates/investigation/admin-active.html.twig b/templates/investigation/admin-active.html.twig index 16837cb..6311d46 100644 --- a/templates/investigation/admin-active.html.twig +++ b/templates/investigation/admin-active.html.twig @@ -1,75 +1,70 @@ {% extends 'base.html.twig' %} -{% block title %}Enquête{% endblock %} +{% block title %}Admin Validation{% endblock %} + -{% set navbarTitle = "Enquête" %} -{% set navbarPages = [{'page':"Gestion", 'url':null }] %} {% block content %} - - -
-
-
-
-
-

Liste des enquêtes à activer

-
+ + +
+
+
+ + +
+ Admin + Enquête
-
-
- - - - - - - - - - - - - {% for investigation in investigations %} - - - - - - - - - {% endfor %} - -
IdNameDate CreateQuestionsStatusAction
{{ investigation.getId() }}{{ investigation.getNameEn() }}{{ investigation.getDateCreate()|date("d/m/Y H:i") }}{{ investigation.getNbrQuestions() }} - {% if investigation.getLastState() == 10 %} -
Création Terminer
- {% elseif investigation.getLastState() == 11 %} -
Encour de Création
- {% elseif investigation.getLastState() == 12 %} -
Dupliquer
- {% elseif investigation.getLastState() == 20 %} -
Demande Valider
- {% elseif investigation.getLastState() == 21 %} -
Demande Envoyer
- {% elseif investigation.getLastState() == 22 %} -
Demande Rejeter
- {% else %} - -- - {% endif %} -
- activer - -
-
-
-
+

Validation

+ + + {% include 'basic/alert.html.twig' %} + +

Liste des Enquête a valider par l'admin

+ + +
+ + + + + + + + + + + + + {% for investigation in investigations %} + + + + + + + + + + {% endfor %} + +
IdNameDate CreateQuestionsAfficherAction
{{ investigation.getId() }}{{ investigation.getNameEn() }}{{ investigation.getDateCreate()|date("d/m/Y H:i") }}{{ investigation.getNbrQuestions() }} + + Afficher l'enquête + + + Activer + Réfuser +
+
+ + + + +
- - - - {% endblock %} \ No newline at end of file diff --git a/templates/investigation/index.html.twig b/templates/investigation/index.html.twig index 7f7e7ec..2696cc5 100644 --- a/templates/investigation/index.html.twig +++ b/templates/investigation/index.html.twig @@ -16,6 +16,8 @@

Enquête

+ {% include 'basic/alert.html.twig' %} +

Liste des enquêtes prêt a envoyer à l’administration pour valider

@@ -23,9 +25,9 @@ - - - + + + @@ -84,10 +86,25 @@ @@ -102,4 +119,43 @@ + + + + + {% block javascripts %} + + {% endblock %} + {% endblock %} \ No newline at end of file diff --git a/translations/home.ar.yaml b/translations/home.ar.yaml new file mode 100644 index 0000000..596a986 --- /dev/null +++ b/translations/home.ar.yaml @@ -0,0 +1,3 @@ +home: "الصفحة الرئيسية" +welcome: "مرحبًا، أهلاً بعودتك!" +last_login: "تاريخ آخر اتصال" \ No newline at end of file diff --git a/translations/home.en.yaml b/translations/home.en.yaml new file mode 100644 index 0000000..584fa63 --- /dev/null +++ b/translations/home.en.yaml @@ -0,0 +1,3 @@ +home: "Home" +welcome: "Hi, welcome back!" +last_login: "Last login date" \ No newline at end of file diff --git a/translations/home.fr.yaml b/translations/home.fr.yaml new file mode 100644 index 0000000..3002207 --- /dev/null +++ b/translations/home.fr.yaml @@ -0,0 +1,3 @@ +home: "Accueil" +welcome: "Bonjour, bienvenue à nouveau !" +last_login: "Date dernière connection" \ No newline at end of file diff --git a/translations/investigation.ar.yaml b/translations/investigation.ar.yaml new file mode 100644 index 0000000..c40b01d --- /dev/null +++ b/translations/investigation.ar.yaml @@ -0,0 +1,3 @@ +alert_sucess_add: "النجاح" +alert_sucess_edit: "النجاح" +alert_sucess_send_validation: "النجاح" \ No newline at end of file diff --git a/translations/investigation.en.yaml b/translations/investigation.en.yaml new file mode 100644 index 0000000..2c2adb8 --- /dev/null +++ b/translations/investigation.en.yaml @@ -0,0 +1,3 @@ +alert_sucess_add: "sucess" +alert_sucess_edit: "" +alert_sucess_send_validation: "sucess" \ No newline at end of file diff --git a/translations/investigation.fr.yaml b/translations/investigation.fr.yaml new file mode 100644 index 0000000..ab09377 --- /dev/null +++ b/translations/investigation.fr.yaml @@ -0,0 +1,3 @@ +alert_sucess_add: "succès" +alert_sucess_edit: "" +alert_sucess_send_validation: "succès " \ No newline at end of file diff --git a/translations/menus.ar.yaml b/translations/menus.ar.yaml index 66d7aa2..62fa71d 100644 --- a/translations/menus.ar.yaml +++ b/translations/menus.ar.yaml @@ -1,10 +1,11 @@ -home: "" -investigation_create: "" -investigation_liste: "" -rroadcast: "" -rapport: "" +home: "الصفحة الرئيسية" +investigation: "التحقيق" +investigation_create: "إنشاء" +investigation_liste: "القائمة" +broadcast: "البث" +rapport: "تقرير" -profile: "" -profile_edit: "" -account_settings: "" -sign_out: "" \ No newline at end of file +profile: "الملف الشخصي" +profile_edit: "تحرير الملف الشخصي" +account_settings: "إعدادات الحساب" +sign_out: "تسجيل الخروج" \ No newline at end of file diff --git a/translations/menus.fr.yaml b/translations/menus.fr.yaml index 4fd1ca0..0c9adca 100644 --- a/translations/menus.fr.yaml +++ b/translations/menus.fr.yaml @@ -7,5 +7,5 @@ rapport: "Rapport" profile: "Profile" profile_edit: "Modifier mon profile" -account_settings: "Account Settings" -sign_out: "Sign Out" \ No newline at end of file +account_settings: "Paramètres du compte" +sign_out: "Se déconnecter" \ No newline at end of file
IDNameDemande de validationIDNameDemande de validation
- - + {% if investigation.getLastState() != 12 %} + + {% endif %} + + {% if investigation.getLastState() not in [20, 21] %} + + {% endif %} - + + {% if investigation.getLastState() in [10, 11, 12] %} + + {% endif %} +