fix twig assets
continuous-integration/drone/push Build is passing Details

pull/24/head
Override-6 1 year ago committed by maxime.batista
parent 1147ad114f
commit fffb520dbf

@ -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/

@ -0,0 +1 @@
../front/assets

@ -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;
}

@ -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");
}
}

@ -17,7 +17,7 @@
<body>
<button onclick="location.pathname='{{ basePath }}/home'">Retour</button>
<button onclick="location.pathname='{{ path('/home') }}'">Retour</button>
<h1>Paramètres</h1>
</body>
</html>

@ -73,7 +73,7 @@
<div class="container">
<h2>Ajouter un membre à votre équipe</h2>
<form action="{{ basePath }}/team/members/add" method="POST">
<form action="{{ path('/team/members/add') }}" method="POST">
<div class="form-group">
<label for="team">Team où ajouter le membre :</label>
<input type="text" id="team" name="team" required>

@ -56,7 +56,7 @@
<div class="container">
<h2>Supprimez un membre de votre équipe</h2>
<form action="{{ basePath }}/team/members/remove" method="POST">
<form action="{{ path('/team/members/remove') }}" method="POST">
<div class="form-group">
<label for="team">Team où supprimer le membre :</label>
<input type="text" id="team" name="team" required>

@ -72,7 +72,7 @@
<div class="container">
<center><h2>Se connecter</h2></center>
<form action="{{ basePath }}/login" method="post">
<form action="{{ path('/login') }}" method="post">
<div class="form-group">
{% for name in fails %}

@ -74,7 +74,7 @@
<div class="container">
<center><h2>S'enregistrer</h2></center>
<form action="{{ basePath }}/register" method="post">
<form action="{{ path('/register') }}" method="post">
<div class="form-group">
{% for name in fails %}

@ -57,7 +57,7 @@
</head>
<body>
<header>
<h1><a href="{{ basePath }}/">IQBall</a></h1>
<h1><a href="{{ path('/') }}">IQBall</a></h1>
</header>
<section class="container">

@ -10,7 +10,7 @@
<p>Aucune équipe n'a été trouvée</p>
<div class="container">
<h2>Chercher une équipe</h2>
<form action="{{ basePath }}/team/search" method="post">
<form action="{{ path('/team/search') }}" method="post">
<div class="form-group">
<label for="name">Nom de l'équipe :</label>
<input type="text" id="name" name="name" required>
@ -22,7 +22,7 @@
</div>
{% else %}
{% for t in teams %}
<div class="team" onclick="window.location.href = '{{ basePath }}/team/{{ t.id }}'">
<div class="team" onclick="window.location.href = '{{ path("/team/#{t.id}") }}'">
<p>Nom de l'équipe : {{ t.name }}</p>
<img src="{{ t.picture }}" alt="logo de l'équipe">
</div>

@ -51,7 +51,7 @@
{% endfor %}
<button class="button" onclick="location.href='{{ basePath }}/home'" type="button">Retour à la page d'accueil</button>
<button class="button" onclick="location.href='{{ path('/home') }}'" type="button">Retour à la page d'accueil</button>
</body>
</html>

@ -52,9 +52,9 @@
<body>
<div id="bandeau">
<h1>IQ Ball</h1>
<div id="account" onclick="location.pathname='/settings'">
<div id="account" onclick="location.pathname='{{ path('/settings') }}'">
<img
src="{{ basePath }}/front/assets/icon/account.svg"
src="{{ path('/assets/icon/account.svg') }}"
alt="Account logo"
/>
<p>Mon profil
@ -64,7 +64,7 @@
<h2>Mes équipes</h2>
<button onclick="location.pathname='{{ basePath }}/team/new'"> Créer une nouvelle équipe</button>
<button onclick="location.pathname='{{ path('/team/new') }}'"> Créer une nouvelle équipe</button>
{% if recentTeam != null %}
{% for team in recentTeam %}
@ -78,13 +78,13 @@
<h2> Mes strategies </h2>
<button onclick="location.pathname='{{ basePath }}/tactic/new'"> Créer une nouvelle tactique</button>
<button onclick="location.pathname='{{ path('/tactic/new') }}'"> Créer une nouvelle tactique</button>
{% if recentTactic != null %}
{% for tactic in recentTactic %}
<div onclick="location.pathname={{ basePath }}/tactic/{{ strategie.id }}/edit">
<div onclick="location.pathname='{{ path("/tactic/#{strategie.id}/edit") }}'">
<p> {{ tactic.id }} - {{ tactic.name }} - {{ tactic.creation_date }} </p>
<button onclick="location.pathname='{{ basePath }}/tactic/{{ tactic.id }}/edit'"> Editer la
<button onclick="location.pathname='{{ path("/tactic/#{tactic.id}/edit") }}'"> Editer la
stratégie {{ tactic.id }} </button>
</div>
{% endfor %}

@ -61,7 +61,7 @@
<div class="container">
<h2>Créer une équipe</h2>
<form action="{{ basePath }}/team/new" method="post">
<form action="{{ path('/team/new') }}" method="post">
<div class="form-group">
<label for="name">Nom de l'équipe :</label>
<input type="text" id="name" name="name" required>

@ -59,7 +59,7 @@
<div class="container">
<h2>Chercher une équipe</h2>
<form action="{{ basePath }}/team/search" method="post">
<form action="{{ path('/team/search') }}" method="post">
<div class="form-group">
<label for="name">Nom de l'équipe :</label>
<input type="text" id="name" name="name" required>

Loading…
Cancel
Save