diff --git a/ci/build_react.msh b/ci/build_react.msh index 64a0cb6..32a5923 100755 --- a/ci/build_react.msh +++ b/ci/build_react.msh @@ -30,6 +30,5 @@ echo "];" >> views-mappings.php chmod +r views-mappings.php -// moshell does not supports file patterns -bash <<< "mv dist/* public/* front/assets/ front/style/ /outputs/public/" +mv dist/* front/assets/ front/style/ public/* /outputs/public/ mv views-mappings.php /outputs/ diff --git a/public/assets b/public/assets new file mode 120000 index 0000000..7b299d9 --- /dev/null +++ b/public/assets @@ -0,0 +1 @@ +../front/assets \ No newline at end of file diff --git a/public/index.php b/public/index.php index 8b4acf7..c31e289 100644 --- a/public/index.php +++ b/public/index.php @@ -31,6 +31,7 @@ use IQBall\Core\Model\TeamModel; use IQBall\Core\Validation\ValidationFail; use Twig\Environment; use Twig\Loader\FilesystemLoader; +use Twig\TwigFunction; function getConnection(): Connection { return new Connection(get_database()); @@ -62,7 +63,7 @@ function getTwig(): Environment { $fl = new FilesystemLoader("../src/App/Views"); $twig = new Environment($fl); - $twig->addGlobal("basePath", $basePath); + $twig->addFunction(new TwigFunction('path', fn(string $str) => "$basePath$str")); return $twig; } diff --git a/src/Api/API.php b/src/Api/API.php index 03daf91..f79e1b5 100644 --- a/src/Api/API.php +++ b/src/Api/API.php @@ -19,6 +19,8 @@ class API { if ($response instanceof JsonHttpResponse) { header('Content-type: application/json'); echo $response->getJson(); + } else if (get_class($response) != HttpResponse::class) { + throw new Exception("API returned unknown Http Response"); } } diff --git a/src/App/Views/account_settings.twig b/src/App/Views/account_settings.twig index 2bdd853..04d7437 100644 --- a/src/App/Views/account_settings.twig +++ b/src/App/Views/account_settings.twig @@ -17,7 +17,7 @@ - +

Paramètres

\ No newline at end of file diff --git a/src/App/Views/add_member.html.twig b/src/App/Views/add_member.html.twig index e083a63..c6bae0e 100644 --- a/src/App/Views/add_member.html.twig +++ b/src/App/Views/add_member.html.twig @@ -73,7 +73,7 @@

Ajouter un membre à votre équipe

-
+
diff --git a/src/App/Views/delete_member.html.twig b/src/App/Views/delete_member.html.twig index 5b161e3..3fa5ccd 100644 --- a/src/App/Views/delete_member.html.twig +++ b/src/App/Views/delete_member.html.twig @@ -56,7 +56,7 @@

Supprimez un membre de votre équipe

- +
diff --git a/src/App/Views/display_login.html.twig b/src/App/Views/display_login.html.twig index 48842c3..cdc11a5 100644 --- a/src/App/Views/display_login.html.twig +++ b/src/App/Views/display_login.html.twig @@ -72,7 +72,7 @@

Se connecter

- +
{% for name in fails %} diff --git a/src/App/Views/display_register.html.twig b/src/App/Views/display_register.html.twig index d83ec9e..8649de8 100644 --- a/src/App/Views/display_register.html.twig +++ b/src/App/Views/display_register.html.twig @@ -74,7 +74,7 @@

S'enregistrer

- +
{% for name in fails %} diff --git a/src/App/Views/display_team.html.twig b/src/App/Views/display_team.html.twig index 06d64fb..7f23b8b 100644 --- a/src/App/Views/display_team.html.twig +++ b/src/App/Views/display_team.html.twig @@ -57,7 +57,7 @@
-

IQBall

+

IQBall

diff --git a/src/App/Views/display_teams.html.twig b/src/App/Views/display_teams.html.twig index be9353d..1e1420a 100644 --- a/src/App/Views/display_teams.html.twig +++ b/src/App/Views/display_teams.html.twig @@ -10,7 +10,7 @@

Aucune équipe n'a été trouvée

Chercher une équipe

- +
@@ -22,7 +22,7 @@
{% else %} {% for t in teams %} -
+

Nom de l'équipe : {{ t.name }}

logo de l'équipe
diff --git a/src/App/Views/error.html.twig b/src/App/Views/error.html.twig index 7be397a..bf90319 100644 --- a/src/App/Views/error.html.twig +++ b/src/App/Views/error.html.twig @@ -51,7 +51,7 @@ {% endfor %} - + \ No newline at end of file diff --git a/src/App/Views/home.twig b/src/App/Views/home.twig index 5515ac9..5d9e8ae 100644 --- a/src/App/Views/home.twig +++ b/src/App/Views/home.twig @@ -52,9 +52,9 @@

IQ Ball

-
+
Account logo

Mon profil @@ -64,7 +64,7 @@

Mes équipes

- + {% if recentTeam != null %} {% for team in recentTeam %} @@ -78,13 +78,13 @@

Mes strategies

- + {% if recentTactic != null %} {% for tactic in recentTactic %} -
+

{{ tactic.id }} - {{ tactic.name }} - {{ tactic.creation_date }}

-
{% endfor %} diff --git a/src/App/Views/insert_team.html.twig b/src/App/Views/insert_team.html.twig index 8174fe6..65cd096 100644 --- a/src/App/Views/insert_team.html.twig +++ b/src/App/Views/insert_team.html.twig @@ -61,7 +61,7 @@

Créer une équipe

- +
diff --git a/src/App/Views/list_team_by_name.html.twig b/src/App/Views/list_team_by_name.html.twig index 858f4c6..eca5e19 100644 --- a/src/App/Views/list_team_by_name.html.twig +++ b/src/App/Views/list_team_by_name.html.twig @@ -59,7 +59,7 @@

Chercher une équipe

- +