@93 - Wantlist

This commit is contained in:
Damien Broqua 2024-06-15 10:13:22 +02:00
parent bed5139a27
commit a4a3933c6d
24 changed files with 1137 additions and 70 deletions

View file

@ -200,4 +200,5 @@
<script>
const canPublish = <%- (user.mastodon && user.mastodon.publish) || false %>;
const action = "<%- page.action %>";
</script>

View file

@ -3,19 +3,23 @@
%>
<main class="layout-maxed collection" id="collection">
<h1>
<% if ( pageType === 'private' ) {
__append('Ma collection <i class="icon-share" @click="toggleModalShare" aria-label="Partager ma collection" title="Votre collection sera visible en lecture aux personnes ayant le lien de partage"></i>');
} else {
__append(`Collection de ${page.username}`);
} %>
</h1>
<% if ( pageType === 'private' ) { %>
<div>
<a :href="shareLink" v-if="isPublicCollection" target="_blank">
<i class="icon-share"></i> Voir ma collection partagée
</a>
</div>
<% if (page.action === 'albums') { %>
<h1>
<% if ( pageType === 'private' ) {
__append('Ma collection <i class="icon-share" @click="toggleModalShare" aria-label="Partager ma collection" title="Votre collection sera visible en lecture aux personnes ayant le lien de partage"></i>');
} else {
__append(`Collection de ${page.username}`);
} %>
</h1>
<% if ( pageType === 'private' ) { %>
<div>
<a :href="shareLink" v-if="isPublicCollection" target="_blank">
<i class="icon-share"></i> Voir ma collection partagée
</a>
</div>
<% } %>
<% } else { %>
<h1>Ma liste de souhaits</h1>
<% } %>
<%- include('../components/filters/index') %>
@ -30,7 +34,7 @@
<div class="item" v-if="!loading" v-for="item in items">
<span class="title">
<% if ( pageType === 'private' ) { %>
<a :href="'/ma-collection/' + item._id">{{ renderAlbumTitle(item) }}</a>
<a :href="'/<%= page.action === 'albums' ? 'ma-collection' : 'ma-liste-de-souhaits' %>/' + item._id">{{ renderAlbumTitle(item) }}</a>
<i class="icon-trash" @click="showConfirmDelete(item._id)"></i>
<% } else { %>
{{ item.artists_sort}} - {{ item.title }}
@ -39,7 +43,7 @@
<div class="grid grid-cols-2 md:grid-cols-4">
<div>
<% if ( pageType === 'private' ) { %>
<a :href="'/ma-collection/' + item._id"><img :src="item.thumb" :alt="item.title" /></a>
<a :href="'/<%= page.action === 'albums' ? 'ma-collection' : 'ma-liste-de-souhaits' %>/' + item._id"><img :src="item.thumb" :alt="item.title" /></a>
<% } else { %>
<img :src="item.thumb" :alt="item.title" />
<% } %>
@ -147,6 +151,7 @@
<script>
const vueType = "<%= pageType %>";
const query = <%- JSON.stringify(query) %>;
const action = "<%- page.action %>";
<% if ( pageType === 'private' ) { %>
const isPublicCollection = <%= user.isPublicCollection ? 'true' : 'false' %>;
const userId = "<%= user._id %>";

View file

@ -110,6 +110,12 @@
id="mastodon.message"
v-model="formData.mastodon.message"
></textarea>
<label for="mastodon.wantlist">Message pour la liste de souhaits</label>
<textarea
name="mastodon.wantlist"
id="mastodon.wantlist"
v-model="formData.mastodon.wantlist"
></textarea>
<small>
Variables possibles :
<ul>

View file

@ -2,7 +2,7 @@
<h1>
<template v-for="artist in item.artists">
<a :href="`/ma-collection?page=1&limit=16&sort=year&order=asc&artist=${artist.name}`">{{artist.name}}</a>
<a :href="`/<%= page.action === 'album' ? 'ma-collection' : 'ma-liste-de-souhaits' %>?page=1&limit=16&sort=year&order=asc&artist=${artist.name}`">{{artist.name}}</a>
<template v-if="artist.join">&nbsp;{{artist.join}}&nbsp;</template>
</template>
- {{item.title}}
@ -96,5 +96,6 @@
<script>
const item = <%- JSON.stringify(page.item) %>;
const action = "<%- page.action %>";
const canShareItem = <%= user.mastodon?.publish || false %>;
</script>

View file

@ -1,5 +1,9 @@
<main class="layout-maxed" id="exporter">
<h1>Exporter ma collection</h1>
<% if (page.action === 'albums') { %>
<h1>Exporter ma collection</h1>
<% } else { %>
<h1>Exporter ma liste de souhaits</h1>
<% } %>
<p>
Les formats CSV et Excel sont facilement lisiblent par un humain. Dans ces 2 formats vous trouverez seulement les informations principales de vos albums, à savoir :
</p>
@ -44,4 +48,8 @@
Exporter
</button>
</form>
</main>
</main>
<script>
const action = "<%- page.action %>";
</script>

View file

@ -1,7 +1,11 @@
<main class="layout-maxed" id="importer">
<h1>Importer une collection</h1>
<% if (page.action === 'albums') { %>
<h1>Importer une collection</h1>
<% } else { %>
<h1>Importer une liste de souhaits</h1>
<% } %>
<p>
Il est actuellement possible d'importer une collection provenant de discogs.
Il est actuellement possible d'importer <%= page.action === 'albums' ? "une collection" : "une liste de souhaits" %> provenant de discogs.
<br />
Vous devez dans un premier temps vous rendre sur la page <a href="https://www.discogs.com/fr/users/export" target="_blank" rel="noopener noreferrer">Exporter</a> de discogs.
<br />
@ -40,4 +44,8 @@
<span v-if="state === 'done'">Importatation terminée</span>
</button>
</form>
</main>
</main>
<script>
const action = "<%- page.action %>";
</script>