@@ -158,10 +176,77 @@
data() {
return {
q: '',
+ year: '',
+ country: '',
+ format: '',
loading: false,
items: [],
details: {},
modalIsVisible: false,
+ formats: [
+ 'Vinyl',
+ 'Acetate',
+ 'Flexi-disc',
+ 'Lathe Cut',
+ 'Mighty Tiny',
+ 'Shellac',
+ 'Sopic',
+ 'Pathé Disc',
+ 'Edison Disc',
+ 'Cylinder',
+ 'CD',
+ 'CDr',
+ 'CDV',
+ 'DVD',
+ 'DVDr',
+ 'HD DVD',
+ 'HD DVD-R',
+ 'Blu-ray',
+ 'Blu-ray-R',
+ 'Ultra HD Blu-ray',
+ 'SACD',
+ '4-Track Cartridge',
+ '8-Track Cartridge',
+ 'Cassette',
+ 'DC-International',
+ 'Elcaset',
+ 'PlayTape',
+ 'RCA Tape Cartridge',
+ 'DAT',
+ 'DCC',
+ 'Microcassette',
+ 'NT Cassette',
+ 'Pocket Rocker',
+ 'Revere Magnetic Stereo Tape Ca',
+ 'Tefifon',
+ 'Reel-To-Reel',
+ 'Sabamobil',
+ 'Betacam',
+ 'Betacam SP',
+ 'Betamax',
+ 'Cartrivision',
+ 'MiniDV',
+ 'Super VHS',
+ 'U-matic',
+ 'VHS',
+ 'Video 2000',
+ 'Video8',
+ 'Film Reel',
+ 'HitClips',
+ 'Laserdisc',
+ 'SelectaVision',
+ 'VHD',
+ 'Wire Recording',
+ 'Minidisc',
+ 'MVD',
+ 'UMD',
+ 'Floppy Disk',
+ 'File',
+ 'Memory Stick',
+ 'Hybrid',
+ 'All Media',
+ 'Box Set',
+ ]
}
},
methods: {
@@ -173,8 +258,19 @@
}
this.loading = true;
+ let url = `/api/v1/search?q=${this.q}`;
- axios.get(`/api/v1/search?q=${this.q}`)
+ if ( this.year ) {
+ url += `&year=${this.year}`;
+ }
+ if ( this.country ) {
+ url += `&country=${this.country}`;
+ }
+ if ( this.format ) {
+ url += `&format=${this.format}`;
+ }
+
+ axios.get(url)
.then( response => {
const {
results,
@@ -242,6 +338,9 @@
showToastr(err.response?.data?.message || "Impossible d'ajouter cet album pour le moment…");
});
},
+ orderedItems(items) {
+ return items.sort();
+ }
}
}).mount('#app');
diff --git a/views/pages/collection.ejs b/views/pages/collection.ejs
index 8ba62cd..a558cd7 100644
--- a/views/pages/collection.ejs
+++ b/views/pages/collection.ejs
@@ -85,6 +85,12 @@
+
+
+
+ Chargement des données en cours…
+
+
{{ item.artists_sort}} - {{ item.title }}
@@ -172,8 +178,55 @@
methods: {
fetch() {
this.loading = true;
+ this.total = 0;
+
+ const queryString = window.location.search;
+ const urlParams = new URLSearchParams(queryString);
+ const entries = urlParams.entries();
+
+ for(const entry of entries) {
+ switch(entry[0]) {
+ case 'artists_sort':
+ this.artist = entry[1];
+ break;
+ default:
+ this[entry[0]] = entry[1];
+ }
+ }
let url = `/api/v1/albums?userId=${this.userId}&page=${this.page}&limit=${this.limit}&sort=${this.sort}&order=${this.order}`;
+ if ( this.artist ) {
+ url += `&artists_sort=${this.artist}`;
+ }
+ if ( this.format ) {
+ url += `&format=${this.format}`;
+ }
+ if ( this.year ) {
+ url += `&year=${this.year}`;
+ }
+ if ( this.genre ) {
+ url += `&genre=${this.genre}`;
+ }
+ if ( this.style ) {
+ url += `&style=${this.style}`;
+ }
+
+ axios.get(url)
+ .then( response => {
+ this.items = response.data.rows;
+ this.total = response.data.count || 0;
+ this.totalPages = parseInt(response.data.count / this.limit) + (response.data.count % this.limit > 0 ? 1 : 0);
+
+ })
+ .catch((err) => {
+ showToastr(err.response?.data?.message || "Impossible de charger cette collection");
+ })
+ .finally(() => {
+ this.loading = false;
+ });
+ },
+ changeUrl() {
+ let url = `?page=${this.page}&limit=${this.limit}&sort=${this.sort}&order=${this.order}`;
if ( this.artist ) {
url += `&artists_sort=${this.artist.replace('&', '%26')}`;
}
@@ -190,38 +243,26 @@
url += `&style=${this.style.replace('&', '%26')}`;
}
- axios.get(url)
- .then( response => {
- this.items = response.data.rows;
- this.total = response.data.count;
- this.totalPages = parseInt(response.data.count / this.limit) + (response.data.count % this.limit > 0 ? 1 : 0);
-
- })
- .catch((err) => {
- showToastr(err.response?.data?.message || "Impossible de charger cette collection");
- })
- .finally(() => {
- this.loading = false;
- });
+ location.href = url;
},
next(event) {
event.preventDefault();
this.page += 1;
- this.fetch();
+ this.changeUrl();
},
previous(event) {
event.preventDefault();
this.page -= 1;
- this.fetch();
+ this.changeUrl();
},
goTo(page) {
this.page = page;
- this.fetch();
+ this.changeUrl();
},
changeSort() {
const [sort,order] = this.sortOrder.split('-');
@@ -229,12 +270,12 @@
this.order = order;
this.page = 1;
- this.fetch();
+ this.changeUrl();
},
changeFilter() {
this.page = 1;
- this.fetch();
+ this.changeUrl();
},
showMoreFilters() {
this.moreFilters = !this.moreFilters;
diff --git a/views/pages/composants.ejs b/views/pages/composants.ejs
index 1cba4e5..cdd1776 100644
--- a/views/pages/composants.ejs
+++ b/views/pages/composants.ejs
@@ -355,6 +355,7 @@
.icon-left-open
.icon-right-open
.icon-export
+ .icon-refresh
.icon-share
.icon-spin
.icon-sun
diff --git a/views/pages/mon-compte/ma-collection/details.ejs b/views/pages/mon-compte/ma-collection/details.ejs
index bd97f90..41c0b24 100644
--- a/views/pages/mon-compte/ma-collection/details.ejs
+++ b/views/pages/mon-compte/ma-collection/details.ejs
@@ -1,6 +1,10 @@
- {{item.artists_sort}} - {{item.title}}
+
+ {{item.artists_sort}} - {{item.title}}
+
+
+
![]()
@@ -70,6 +74,9 @@
-
{{format.name}}
+
+ - {{format.text}}
+
(
{{description}},
@@ -153,6 +160,20 @@
+
+
+
+
+
+
+ Êtes-vous sûr de vouloir supprimer cet album ?
+
+
+
+
\ No newline at end of file
diff --git a/views/pages/mon-compte/ma-collection/index.ejs b/views/pages/mon-compte/ma-collection/index.ejs
index f8c5f2e..9ee59fc 100644
--- a/views/pages/mon-compte/ma-collection/index.ejs
+++ b/views/pages/mon-compte/ma-collection/index.ejs
@@ -89,6 +89,12 @@
+
+
+
+ Chargement des données en cours…
+
+
{{ item.artists_sort}} - {{ item.title }}
@@ -226,8 +232,54 @@
methods: {
fetch() {
this.loading = true;
+ this.total = 0;
+
+ const queryString = window.location.search;
+ const urlParams = new URLSearchParams(queryString);
+ const entries = urlParams.entries();
+
+ for(const entry of entries) {
+ switch(entry[0]) {
+ case 'artists_sort':
+ this.artist = entry[1];
+ break;
+ default:
+ this[entry[0]] = entry[1];
+ }
+ }
let url = `/api/v1/albums?page=${this.page}&limit=${this.limit}&sort=${this.sort}&order=${this.order}`;
+ if ( this.artist ) {
+ url += `&artists_sort=${this.artist}`;
+ }
+ if ( this.format ) {
+ url += `&format=${this.format}`;
+ }
+ if ( this.year ) {
+ url += `&year=${this.year}`;
+ }
+ if ( this.genre ) {
+ url += `&genre=${this.genre}`;
+ }
+ if ( this.style ) {
+ url += `&style=${this.style}`;
+ }
+
+ axios.get(url)
+ .then( response => {
+ this.items = response.data.rows;
+ this.total = response.data.count || 0;
+ this.totalPages = parseInt(response.data.count / this.limit) + (response.data.count % this.limit > 0 ? 1 : 0);
+ })
+ .catch((err) => {
+ showToastr(err.response?.data?.message || "Impossible de charger votre collection");
+ })
+ .finally(() => {
+ this.loading = false;
+ });
+ },
+ changeUrl() {
+ let url = `?page=${this.page}&limit=${this.limit}&sort=${this.sort}&order=${this.order}`;
if ( this.artist ) {
url += `&artists_sort=${this.artist.replace('&', '%26')}`;
}
@@ -244,38 +296,26 @@
url += `&style=${this.style.replace('&', '%26')}`;
}
- axios.get(url)
- .then( response => {
- this.items = response.data.rows;
- this.total = response.data.count;
- this.totalPages = parseInt(response.data.count / this.limit) + (response.data.count % this.limit > 0 ? 1 : 0);
-
- })
- .catch((err) => {
- showToastr(err.response?.data?.message || "Impossible de charger votre collection");
- })
- .finally(() => {
- this.loading = false;
- });
+ location.href = url;
},
next(event) {
event.preventDefault();
this.page += 1;
- this.fetch();
+ this.changeUrl();
},
previous(event) {
event.preventDefault();
this.page -= 1;
- this.fetch();
+ this.changeUrl();
},
goTo(page) {
this.page = page;
- this.fetch();
+ this.changeUrl();
},
changeSort() {
const [sort,order] = this.sortOrder.split('-');
@@ -283,12 +323,12 @@
this.order = order;
this.page = 1;
- this.fetch();
+ this.changeUrl();
},
changeFilter() {
this.page = 1;
- this.fetch();
+ this.changeUrl();
},
showMoreFilters() {
this.moreFilters = !this.moreFilters;
diff --git a/views/pages/nous-contacter.ejs b/views/pages/nous-contacter.ejs
index d35455e..276b6f4 100644
--- a/views/pages/nous-contacter.ejs
+++ b/views/pages/nous-contacter.ejs
@@ -1,22 +1,80 @@
-
+
\ No newline at end of file
+
+
+<% if (config.mailMethod === 'smtp' ) { %>
+
+<% } %>
\ No newline at end of file