2022-10-30 21:48:49 +01:00
|
|
|
<main class="layout-maxed collection" id="mon-compte">
|
2022-04-10 15:21:15 +02:00
|
|
|
<h1>
|
|
|
|
Mon compte
|
|
|
|
</h1>
|
|
|
|
|
2023-08-02 16:11:56 +02:00
|
|
|
<form method="POST" @submit.prevent="updateProfil">
|
|
|
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-10">
|
|
|
|
<div>
|
|
|
|
<h2>Mes données personnelles</h2>
|
|
|
|
<div>
|
|
|
|
<div class="field">
|
|
|
|
<label for="email">Adresse e-mail</label>
|
|
|
|
<input
|
|
|
|
type="email"
|
|
|
|
readonly
|
|
|
|
disabled
|
|
|
|
name="email"
|
|
|
|
id="email"
|
|
|
|
v-model="formData.email"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
<div class="field">
|
|
|
|
<label for="username">Nom d'utilisateur</label>
|
|
|
|
<input
|
|
|
|
type="string"
|
|
|
|
readonly
|
|
|
|
disabled
|
|
|
|
name="username"
|
|
|
|
id="username"
|
|
|
|
v-model="formData.username"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
<div class="field">
|
|
|
|
<label for="oldPassword">Mot de passe actuel</label>
|
|
|
|
<input
|
|
|
|
type="password"
|
|
|
|
name="oldPassword"
|
|
|
|
id="oldPassword"
|
|
|
|
placeholder="Saisisssez votre mot de passe actuel"
|
|
|
|
v-model="formData.oldPassword"
|
|
|
|
/>
|
|
|
|
<div class="message error" v-if="errors.includes('emptyPassword')">
|
|
|
|
Pour changer votre mot de passe vous devez saisir votre mot de passe actuel
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="field">
|
|
|
|
<label for="password">Nouveau mot de passe</label>
|
|
|
|
<input
|
|
|
|
type="password"
|
|
|
|
name="password"
|
|
|
|
id="password"
|
|
|
|
placeholder="Saisisssez votre nouveau mot de passe"
|
|
|
|
v-model="formData.password"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
<div class="field">
|
|
|
|
<label for="passwordConfirm">Nouveau mot de passe (confirmation)</label>
|
|
|
|
<input
|
|
|
|
type="password"
|
|
|
|
name="passwordConfirm"
|
|
|
|
id="passwordConfirm"
|
|
|
|
placeholder="Confirmez votre nouveau mot de passe"
|
|
|
|
v-model="formData.passwordConfirm"
|
|
|
|
/>
|
|
|
|
<div class="message error" v-if="errors.includes('passwordsDiffer')">
|
|
|
|
La confirmation ne correspond pas avec votre nouveau mot de passe
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2022-04-10 15:21:15 +02:00
|
|
|
</div>
|
2023-08-02 16:11:56 +02:00
|
|
|
<div>
|
|
|
|
<h2>Mon activité</h2>
|
|
|
|
<div>
|
|
|
|
<div class="field">
|
|
|
|
<label for="mastodon.publish">Publier sur le fédiverse lorsque j'ajoute un album</label>
|
|
|
|
<select id="format" v-model="formData.mastodon.publish">
|
|
|
|
<option value="true">Oui</option>
|
|
|
|
<option value="false">Non</option>
|
|
|
|
</select>
|
|
|
|
<!-- <input
|
|
|
|
type="checkbox"
|
|
|
|
name="mastodon.publish"
|
|
|
|
id="mastodon.publish"
|
|
|
|
v-model="mastodon.publish"
|
|
|
|
/> -->
|
|
|
|
</div>
|
|
|
|
<div class="field">
|
|
|
|
<label for="mastodon.url">Url de l'API de votre instance</label>
|
|
|
|
<input
|
|
|
|
type="text"
|
|
|
|
name="mastodon.url"
|
|
|
|
id="mastodon.url"
|
|
|
|
v-model="formData.mastodon.url"
|
|
|
|
placeholder="https://mastodon.social/api/v1/"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
<div class="field">
|
|
|
|
<label for="mastodon.token">Jeton d'accès (droits nécessaires : write:media et write:statuses)</label>
|
|
|
|
<input
|
|
|
|
type="text"
|
|
|
|
name="mastodon.token"
|
|
|
|
id="mastodon.token"
|
|
|
|
v-model="formData.mastodon.token"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
<div class="field">
|
|
|
|
<label for="mastodon.message">Message</label>
|
2023-08-11 23:13:42 +02:00
|
|
|
<textarea
|
2023-08-02 16:11:56 +02:00
|
|
|
name="mastodon.message"
|
|
|
|
id="mastodon.message"
|
|
|
|
v-model="formData.mastodon.message"
|
2023-08-11 23:13:42 +02:00
|
|
|
></textarea>
|
2023-08-02 16:11:56 +02:00
|
|
|
<small>
|
|
|
|
Variables possibles :
|
|
|
|
<ul>
|
|
|
|
<li>{artist}, exemple : Iron Maiden</li>
|
|
|
|
<li>{album}, exemple : Powerslave</li>
|
|
|
|
<li>{format}, exemple : Cassette</li>
|
|
|
|
<li>{year}, exemple: 1984</li>
|
|
|
|
<li>{video}, exemple : https://www.youtube.com/watch?v=Qx0s8OqgBIw</li>
|
|
|
|
</ul>
|
|
|
|
</small>
|
|
|
|
</div>
|
|
|
|
<button type="button" class="button is-secondary mt-10" :disabled="loading" @click="testMastodon">
|
|
|
|
<span>Tester</span>
|
|
|
|
</button>
|
|
|
|
</div>
|
2022-04-10 15:21:15 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<button type="submit" class="button is-primary mt-10" :disabled="loading">
|
|
|
|
<span v-if="!loading">Mettre à jour</span>
|
|
|
|
<i class="icon-spin animate-spin" v-if="loading"></i>
|
|
|
|
</button>
|
2023-08-02 16:11:56 +02:00
|
|
|
|
|
|
|
</div>
|
|
|
|
</form>
|
2022-04-10 15:21:15 +02:00
|
|
|
</main>
|
|
|
|
|
|
|
|
<script>
|
2022-10-30 21:48:49 +01:00
|
|
|
const email = '<%= user.email %>';
|
|
|
|
const username = '<%= user.username %>';
|
2023-08-02 16:16:27 +02:00
|
|
|
const mastodon = <%- JSON.stringify(user.mastodon || {publish: false, url: '', token: '', message: ''}) %>;
|
2022-04-10 15:21:15 +02:00
|
|
|
</script>
|