fixed conflict
continuous-integration/drone/push Build is failing Details

pull/93/head
Maël DAIM 1 year ago
commit 14eaf110d2

@ -1,63 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
version="1.1"
width="100"
height="50"
viewBox="7.5 18.5 85.5 56"
style="enable-background:new 7.5 18.5 85.5 56;"
xml:space="preserve">
<style type="text/css">
.st0{fill:none;stroke:#000000;stroke-miterlimit:10;}
.st1{fill:none;stroke:#000000;stroke-miterlimit:10;stroke-dasharray:1.4358,1.4358;}
.st2{fill:none;stroke:#000000;stroke-width:0.5;stroke-miterlimit:10;}
.st3{fill:none;stroke:#000000;stroke-miterlimit:10;stroke-dasharray:1.4407,1.4407;}
</style>
<polygon class="st0" points="92.1,72.1 50.1,72.1 8.1,72.1 8.1,21.2 50.1,21.2 92.1,21.2 "/>
<line class="st0" x1="50.1" y1="21.2" x2="50.1" y2="72.1"/>
<circle class="st0" cx="50.1" cy="46.6" r="6.4"/>
<path class="st0" d="M8.1,66h7.2c10.1,0,18.2-8.7,18.2-19.3s-8.2-19.3-18.2-19.3H8.1"/>
<path class="st0" d="M8.1,40.2h19c3.6,0,6.4,2.9,6.4,6.4s-2.9,6.4-6.4,6.4h-19"/>
<line class="st0" x1="27.1" y1="40.2" x2="27.1" y2="53.1"/>
<g>
<g><path class="st0" d="M27.4,40.3c-0.3,0-0.5,0-0.7,0"/>
<path class="st1"
d="M25.3,40.7c-2.5,0.9-4.3,3.3-4.3,6.1c0,3,2.2,5.6,5,6.2"/>
<path
class="st0" d="M26.7,53c0.2,0,0.5,0,0.7,0"/>
</g>
</g>
<line class="st0" x1="16.2" y1="53.1" x2="16.2" y2="54.1"/>
<line class="st2" x1="19.3" y1="53.1" x2="19.3" y2="54.1"/>
<line class="st2" x1="22.4" y1="53.1" x2="22.4" y2="54.1"/>
<line class="st2" x1="25.7" y1="53.1" x2="25.7" y2="54.1"/>
<line class="st0" x1="16.1" y1="39.2" x2="16.1" y2="40.2"/>
<line class="st2" x1="19.2" y1="39.2" x2="19.2" y2="40.2"/>
<line class="st2" x1="22.3" y1="39.2" x2="22.3" y2="40.2"/>
<line class="st2" x1="25.6" y1="39.2" x2="25.6" y2="40.2"/>
<line class="st0" x1="27.1" y1="40.2" x2="27.1" y2="53.1"/>
<path class="st0" d="M92.1,66.1h-7.2c-10.1,0-18.2-8.7-18.2-19.3s8.2-19.3,18.2-19.3h7.2"/>
<path class="st0" d="M92.1,40.3h-19c-3.6,0-6.4,2.9-6.4,6.4s2.9,6.4,6.4,6.4h19"/>
<line class="st0" x1="84" y1="53.2" x2="84" y2="54.1"/>
<line class="st2" x1="80.9" y1="53.2" x2="80.9" y2="54.1"/>
<line class="st2" x1="77.9" y1="53.2" x2="77.9" y2="54.1"/>
<line class="st2" x1="74.5" y1="53.2" x2="74.5" y2="54.1"/>
<line class="st0" x1="84.1" y1="39.3" x2="84.1" y2="40.3"/>
<line class="st2" x1="81" y1="39.3" x2="81" y2="40.3"/>
<line class="st2" x1="77.9" y1="39.3" x2="77.9" y2="40.3"/>
<line class="st2" x1="74.6" y1="39.3" x2="74.6" y2="40.3"/>
<line class="st0" x1="73.1" y1="40.3" x2="73.1" y2="53.2"/>
<line class="st2" x1="36.2" y1="70" x2="36.2" y2="74.1"/>
<line class="st2" x1="63.5" y1="70" x2="63.5" y2="74.1"/>
<line class="st2" x1="36.2" y1="19.1" x2="36.2" y2="23.2"/>
<line class="st2" x1="63.5" y1="19.1" x2="63.5" y2="23.2"/>
<g xmlns="http://www.w3.org/2000/svg">
<g>
<path class="st0" d="M72.9,40.3c0.3,0,0.5,0,0.7,0"/>
<path class="st3"
d="M75,40.7c2.5,0.9,4.3,3.3,4.3,6.1c0,3-2.2,5.6-5.1,6.2"/>
<path
class="st0" d="M73.5,53.1c-0.2,0-0.5,0-0.7,0"/>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 3.2 KiB

@ -32,7 +32,7 @@ import { CourtAction } from "./editor/CourtAction"
import { BasketCourt } from "../components/editor/BasketCourt" import { BasketCourt } from "../components/editor/BasketCourt"
import { ratioWithinBase } from "../components/arrows/Pos" import { ratioWithinBase } from "../components/arrows/Pos"
import { Action, ActionKind } from "../model/tactic/Action" import { Action, ActionKind } from "../model/tactic/Action"
import {BASE} from "../Constants"; import { BASE } from "../Constants"
const ERROR_STYLE: CSSProperties = { const ERROR_STYLE: CSSProperties = {
borderColor: "red", borderColor: "red",
@ -399,7 +399,7 @@ function EditorView({
Home Home
</button> </button>
<div id="topbar-left"> <div id="topbar-left">
<SavingState state={saveState}/> <SavingState state={saveState} />
</div> </div>
<div id="title-input-div"> <div id="title-input-div">
<TitleInput <TitleInput

@ -1,8 +1,8 @@
import "../style/home/home.css" import "../style/home/home.css"
// import AccountSvg from "../assets/account.svg?react" // import AccountSvg from "../assets/account.svg?react"
import {Header} from "./template/Header" import { Header } from "./template/Header"
import {BASE} from "../Constants"; import { BASE } from "../Constants"
interface Tactic { interface Tactic {
id: number id: number

@ -1,5 +1,5 @@
import {BASE} from "../../Constants"; import { BASE } from "../../Constants"
import accountSvg from "../../assets/account.svg"
/** /**
* *
* @param param0 username * @param param0 username
@ -25,7 +25,7 @@ export function Header({ username }: { username: string }) {
{/* <AccountSvg id="img-account" /> */} {/* <AccountSvg id="img-account" /> */}
<img <img
id="img-account" id="img-account"
src="account.svg" src={accountSvg}
onClick={() => { onClick={() => {
location.pathname = BASE + "/settings" location.pathname = BASE + "/settings"
}} }}

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="M234-276q51-39 114-61.5T480-360q69 0 132 22.5T726-276q35-41 54.5-93T800-480q0-133-93.5-226.5T480-800q-133 0-226.5 93.5T160-480q0 59 19.5 111t54.5 93Zm246-164q-59 0-99.5-40.5T340-580q0-59 40.5-99.5T480-720q59 0 99.5 40.5T620-580q0 59-40.5 99.5T480-440Zm0 360q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q53 0 100-15.5t86-44.5q-39-29-86-44.5T480-280q-53 0-100 15.5T294-220q39 29 86 44.5T480-160Zm0-360q26 0 43-17t17-43q0-26-17-43t-43-17q-26 0-43 17t-17 43q0 26 17 43t43 17Zm0-60Zm0 360Z" fill="#e6edf3"/></svg>

Before

Width:  |  Height:  |  Size: 747 B

@ -31,24 +31,31 @@ class AuthController {
*/ */
public function register(array $request, MutableSessionHandle $session): HttpResponse { public function register(array $request, MutableSessionHandle $session): HttpResponse {
$fails = []; $fails = [];
$request = HttpRequest::from($request, $fails, [ HttpRequest::from($request, $fails, [
"username" => [DefaultValidators::name(), DefaultValidators::lenBetween(2, 32)], "username" => [Validators::name(), Validators::lenBetween(2, 32)],
"password" => [DefaultValidators::lenBetween(6, 256)], "password" => [Validators::lenBetween(6, 256)],
"confirmpassword" => [DefaultValidators::lenBetween(6, 256)], "confirmpassword" => [Validators::lenBetween(6, 256)],
"email" => [DefaultValidators::email(), DefaultValidators::lenBetween(5, 256)], "email" => [Validators::email(), Validators::lenBetween(5, 256)],
]); ]);
if (!empty($fails)) { if (!empty($fails)) {
return ViewHttpResponse::twig("display_register.html.twig", ['fails' => $fails]); if (!(in_array($request['username'], $fails)) or !(in_array($request['email'], $fails))) {
return ViewHttpResponse::twig("display_register.html.twig", ['fails' => $fails,'username' => $request['username'],'email' => $request['email']]);
}
} }
$account = $this->model->register($request['username'], $request["password"], $request['confirmpassword'], $request['email'], $fails); $account = $this->model->register($request['username'], $request["password"], $request['confirmpassword'], $request['email'], $fails);
if (!empty($fails)) { if (!empty($fails)) {
return ViewHttpResponse::twig("display_register.html.twig", ['fails' => $fails]); return ViewHttpResponse::twig("display_register.html.twig", ['fails' => $fails]);
} }
$session->setAccount($account); $session->setAccount($account);
$target_url = $session->getInitialTarget(); $target_url = $session->getInitialTarget();
return HttpResponse::redirect($target_url ?? "/home"); if ($target_url != null) {
return HttpResponse::redirect_absolute($target_url);
}
return HttpResponse::redirect("/home");
} }
@ -73,7 +80,11 @@ class AuthController {
$target_url = $session->getInitialTarget(); $target_url = $session->getInitialTarget();
$session->setInitialTarget(null); $session->setInitialTarget(null);
return HttpResponse::redirect($target_url ?? "/home"); if ($target_url != null) {
return HttpResponse::redirect_absolute($target_url);
}
return HttpResponse::redirect("/home");
} }
} }

@ -62,6 +62,10 @@
text-align: right; text-align: right;
} }
.consentement{
font-size: small;
}
#buttons{ #buttons{
display: flex; display: flex;
justify-content: center; justify-content: center;
@ -95,15 +99,18 @@
{% endfor %} {% endfor %}
<label for="username">Nom d'utilisateur :</label> <label for="username">Nom d'utilisateur :</label>
<input type="text" id="username" name="username" required> <input type="text" id="username" name="username" value="{{ username }}"required>
<label for="password">Mot de passe :</label> <label for="password">Mot de passe :</label>
<input type="password" id="password" name="password" required> <input type="password" id="password" name="password" required>
<label for="confirmpassword">Confirmer le mot de passe :</label> <label for="confirmpassword">Confirmer le mot de passe :</label>
<input type="password" id="confirmpassword" name="confirmpassword" required> <input type="password" id="confirmpassword" name="confirmpassword" required>
<label for="email">Email :</label> <label for="email">Email :</label>
<input type="text" id="email" name="email" required> <input type="text" id="email" name="email" value="{{ email }}"required><br><br>
<label class="consentement">
<input type="checkbox" name="consentement" required>
En cochant cette case, j'accepte que mes données personnelles, tel que mon adresse e-mail, soient collectées et traitées conformément à la politique de confidentialité de Sportify.
</label><br>
<a href="{{ path('/login') }}" class="inscr">Vous avez déjà un compte ?</a> <a href="{{ path('/login') }}" class="inscr">Vous avez déjà un compte ?</a>
</div> </div>
<div id = "buttons"> <div id = "buttons">
<input class = "button" type="submit" value="Créer votre compte"> <input class = "button" type="submit" value="Créer votre compte">

@ -31,7 +31,6 @@
height: 100%; height: 100%;
width: 100%; width: 100%;
margin: 0; margin: 0;
overflow: hidden;
} }
</style> </style>

@ -123,13 +123,19 @@ class TeamGateway {
); );
} }
/** /**
* Get all the user's teams * @param int $user
* @param integer $user * @return array<string, mixed>
* @return array<array<string, mixed>>
*/ */
public function getAll(int $user): array { public function getAll(int $user): array {
return $this->con->fetch("SELECT * FROM Team", []); return $this->con->fetch(
"SELECT t.* FROM team t,Member m WHERE m.id_team = t.id AND m.id_user= :idUser ",
[
"idUser" => [$user, PDO::PARAM_INT],
]
);
} }
} }

@ -42,11 +42,24 @@ class HttpResponse {
* @param int $code only HTTP 3XX codes are accepted. * @param int $code only HTTP 3XX codes are accepted.
* @return HttpResponse a response that will redirect client to given url * @return HttpResponse a response that will redirect client to given url
*/ */
public static function redirect(string $url, int $code = HttpCodes::FOUND): HttpResponse { public static function redirect(string $url, int $code = HttpCodes::FOUND): HttpResponse {
global $basePath;
return self::redirect_absolute($basePath . $url, $code);
}
/**
* @param string $url the url to redirect
* @param int $code only HTTP 3XX codes are accepted.
* @return HttpResponse a response that will redirect client to given url
*/
public static function redirect_absolute(string $url, int $code = HttpCodes::FOUND): HttpResponse {
if ($code < 300 || $code >= 400) { if ($code < 300 || $code >= 400) {
throw new \InvalidArgumentException("given code is not a redirection http code"); throw new \InvalidArgumentException("given code is not a redirection http code");
} }
return new HttpResponse($code, ["Location" => $url]); return new HttpResponse($code, ["Location" => $url]);
} }
} }

Loading…
Cancel
Save