routing : remove panel.js and its redirections
This commit is contained in:
parent
51fca42e35
commit
de2678d79c
3 changed files with 21 additions and 16 deletions
|
|
@ -1,9 +0,0 @@
|
|||
document.addEventListener("DOMContentLoaded", () => {
|
||||
if (location.pathname === "/panel/site") {
|
||||
location.href = "/panel/pages/projects";
|
||||
}
|
||||
if (location.origin.includes("goguely")) {
|
||||
location.href =
|
||||
"https://designtopack.morphozbygroupepochet.com" + location.pathname;
|
||||
}
|
||||
});
|
||||
|
|
@ -23,7 +23,6 @@ return [
|
|||
'panel' => [
|
||||
'language' => 'fr',
|
||||
'css' => 'assets/css/panel.css',
|
||||
'js' => 'assets/js/panel.js',
|
||||
'favicon' => 'favicon.svg',
|
||||
'menu' => require(__DIR__ . '/menu.php'),
|
||||
],
|
||||
|
|
|
|||
|
|
@ -31,14 +31,22 @@
|
|||
class="w-full rounded-md border border-grey-200 px-16 py-12 mt-8"
|
||||
:class="{ invalid: !isEmailValid }"
|
||||
required
|
||||
@keyup.escape="isEditingEmail = false"
|
||||
@keyup.enter="isEmailValid ? updateEmail() : false"
|
||||
/>
|
||||
<input
|
||||
v-else
|
||||
type="email"
|
||||
:value="user.email"
|
||||
id="username"
|
||||
class="w-full rounded-md border border-grey-200 px-16 py-12 mt-8"
|
||||
disabled
|
||||
/>
|
||||
<p v-else>{{ user.email }}</p>
|
||||
<button
|
||||
v-if="isEditingEmail"
|
||||
class="btn | w-full text-md"
|
||||
:class="'btn--' + emailBtn.status"
|
||||
:disabled="!isEmailValid"
|
||||
@click="updateEmail"
|
||||
:disabled="!isEmailValid"
|
||||
>
|
||||
{{ emailBtn.text }}
|
||||
</button>
|
||||
|
|
@ -49,6 +57,13 @@
|
|||
>
|
||||
Modifier
|
||||
</button>
|
||||
<button
|
||||
v-if="isEditingEmail"
|
||||
class="btn btn--secondary | w-full text-md"
|
||||
@click="isEditingEmail = false"
|
||||
>
|
||||
Annuler
|
||||
</button>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
|
@ -234,7 +249,7 @@ const isEmailValid = computed(() => {
|
|||
return emailRegex.test(email.value);
|
||||
});
|
||||
async function updateEmail() {
|
||||
emailBtn.value.text = 'en cours…';
|
||||
emailBtn.value.text = 'En cours…';
|
||||
emailBtn.value.status = 'pending';
|
||||
|
||||
const headers = {
|
||||
|
|
@ -247,13 +262,13 @@ async function updateEmail() {
|
|||
const json = await response.json();
|
||||
|
||||
if (json.status === 'success') {
|
||||
email.value = '';
|
||||
emailBtn.value.text = 'mise à jour réussie';
|
||||
emailBtn.value.text = 'Mise à jour réussie';
|
||||
emailBtn.value.status = 'succeed';
|
||||
|
||||
setTimeout(() => {
|
||||
emailBtn.value.text = 'Mettre à jour';
|
||||
emailBtn.value.status = 'ready';
|
||||
isEditingEmail.value = false;
|
||||
}, 1500);
|
||||
} else {
|
||||
console.log(json.message);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue