143 lines
6.4 KiB
Text
143 lines
6.4 KiB
Text
<main class="layout-maxed collection" id="mon-compte">
|
|
<h1>
|
|
Mon compte
|
|
</h1>
|
|
|
|
<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>
|
|
</div>
|
|
<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>
|
|
<textarea
|
|
name="mastodon.message"
|
|
id="mastodon.message"
|
|
v-model="formData.mastodon.message"
|
|
></textarea>
|
|
<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>
|
|
</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>
|
|
|
|
</div>
|
|
</form>
|
|
</main>
|
|
|
|
<script>
|
|
const email = '<%= user.email %>';
|
|
const username = '<%= user.username %>';
|
|
const mastodon = <%- JSON.stringify(user.mastodon || {publish: false, url: '', token: '', message: ''}) %>;
|
|
</script>
|