Compare commits

..

No commits in common. "bf2e9be3b797e112bf3501c8aafec4000197a4e3" and "0ea6a21b902356fbe516d7b940102f2719893b2d" have entirely different histories.

13 changed files with 43 additions and 86 deletions

View file

@ -7,8 +7,8 @@ Vue.createApp({
total: 0, total: 0,
// eslint-disable-next-line no-undef // eslint-disable-next-line no-undef
page: query.page || 1, page: query.page || 1,
limit: 16,
totalPages: 1, totalPages: 1,
limit: 24,
artist: "", artist: "",
format: "", format: "",
year: "", year: "",
@ -69,7 +69,7 @@ Vue.createApp({
this.sortOrder = `${sortOrder.sort}-${sortOrder.order}`; this.sortOrder = `${sortOrder.sort}-${sortOrder.order}`;
let url = `/api/v1/albums?page=${this.page}&sort=${this.sort}&order=${this.order}`; let url = `/api/v1/albums?page=${this.page}&limit=${this.limit}&sort=${this.sort}&order=${this.order}`;
if (this.artist) { if (this.artist) {
url += `&artist=${this.formatParams(this.artist)}`; url += `&artist=${this.formatParams(this.artist)}`;
} }
@ -94,7 +94,6 @@ Vue.createApp({
.get(url) .get(url)
.then((response) => { .then((response) => {
this.items = response.data.rows; this.items = response.data.rows;
this.limit = response.data.limit;
this.total = response.data.count || 0; this.total = response.data.count || 0;
this.totalPages = this.totalPages =
parseInt(response.data.count / this.limit, 10) + parseInt(response.data.count / this.limit, 10) +

View file

@ -11,8 +11,6 @@ if (typeof email !== "undefined" && typeof username !== "undefined") {
password: "", password: "",
passwordConfirm: "", passwordConfirm: "",
// eslint-disable-next-line no-undef // eslint-disable-next-line no-undef
pagination,
// eslint-disable-next-line no-undef
mastodon: mastodon || { mastodon: mastodon || {
publish: false, publish: false,
url: "", url: "",
@ -58,7 +56,7 @@ if (typeof email !== "undefined" && typeof username !== "undefined") {
// eslint-disable-next-line no-unused-vars // eslint-disable-next-line no-unused-vars
async updateProfil() { async updateProfil() {
this.errors = []; this.errors = [];
const { oldPassword, password, passwordConfirm, mastodon, pagination } = const { oldPassword, password, passwordConfirm, mastodon } =
this.formData; this.formData;
if (password && !oldPassword) { if (password && !oldPassword) {
@ -84,8 +82,6 @@ if (typeof email !== "undefined" && typeof username !== "undefined") {
data.oldPassword = oldPassword; data.oldPassword = oldPassword;
} }
data.pagination = pagination;
try { try {
await axios.patch(`/api/v1/me`, data); await axios.patch(`/api/v1/me`, data);

View file

@ -5,12 +5,9 @@
color: var(--font-color); color: var(--font-color);
display: block; display: block;
padding: 1.25rem; padding: 1.25rem;
@include transition() {}
&.mini {
margin: auto;
width: calc(100% - 2rem); width: calc(100% - 2rem);
margin: auto;
@include transition() {}
@include respond-to("small-up") { @include respond-to("small-up") {
width: 65%; width: 65%;
@ -18,7 +15,6 @@
@include respond-to("medium-up") { @include respond-to("medium-up") {
width: 35%; width: 35%;
} }
}
h1 { h1 {
margin-top: 0; margin-top: 0;

View file

@ -45,7 +45,6 @@ $close-background-dark: rgba(240,240,240,.6);
--bg-color: #{darken($white, 5%)}; --bg-color: #{darken($white, 5%)};
--bg-alternate-color: #{darken($white, 8%)}; --bg-alternate-color: #{darken($white, 8%)};
--font-color: #{$nord3}; --font-color: #{$nord3};
--hover-font-color: #{lighten($nord3, 16%)};
--footer-color: #{$darken-white}; --footer-color: #{$darken-white};
--link-color: #{$nord1}; --link-color: #{$nord1};
@ -89,7 +88,6 @@ $close-background-dark: rgba(240,240,240,.6);
--bg-color: #{lighten($nord0, 2%)}; --bg-color: #{lighten($nord0, 2%)};
--bg-alternate-color: #{lighten($nord3, 8%)}; --bg-alternate-color: #{lighten($nord3, 8%)};
--font-color: #{$nord6}; --font-color: #{$nord6};
--hover-font-color: #{darken($nord6, 16%)};
--footer-color: #{$nord1}; --footer-color: #{$nord1};
--link-color: #{$nord4}; --link-color: #{$nord4};

View file

@ -117,6 +117,7 @@
@include respond-to("medium-up") { @include respond-to("medium-up") {
display: flex; display: flex;
align-items: stretch; align-items: stretch;
color: rgba(0,0,0,.7);
.navbar-dropdown { .navbar-dropdown {
background-color: var(--default-color); background-color: var(--default-color);
@ -126,6 +127,7 @@
box-shadow: 0 8px 8px rgba(10,10,10,.1); box-shadow: 0 8px 8px rgba(10,10,10,.1);
display: none; display: none;
font-size: .875rem; font-size: .875rem;
left: 0;
min-width: 100%; min-width: 100%;
position: absolute; position: absolute;
top: 100%; top: 100%;
@ -136,7 +138,7 @@
.navbar-link { .navbar-link {
background-color: var(--default-hl-color); background-color: var(--default-hl-color);
color: var(--hover-font-color); color: rgba(0,0,0,.7);
} }
.navbar-dropdown { .navbar-dropdown {
@ -165,6 +167,15 @@
@include respond-to("medium-up") { @include respond-to("medium-up") {
display: flex; display: flex;
align-items: center; align-items: center;
}
.icon {
align-items: center;
display: inline-flex;
justify-content: center;
height: 1.5rem;
width: 1.5rem;
}
&::after { &::after {
border: 3px solid transparent; border: 3px solid transparent;
@ -185,22 +196,11 @@
right: 1.125em; right: 1.125em;
@include respond-to("medium-up") { @include respond-to("medium-up") {
border-color: var(--font-color); border-color: rgba(0,0,0,.7);
} }
} }
} }
.icon {
align-items: center;
display: inline-flex;
justify-content: center;
height: 1.5rem;
width: 1.5rem;
}
}
.navbar-menu { .navbar-menu {
display: none; display: none;
background-color: var(--default-color); background-color: var(--default-color);
@ -260,7 +260,7 @@
background-color: var(--font-color); background-color: var(--font-color);
border: none; border: none;
height: 2px; height: 2px;
margin: .5rem 0 0 1.5rem; margin: .5rem 0;
} }
.navbar-item { .navbar-item {
@ -277,15 +277,11 @@
box-shadow: 0 8px 8px rgba(10,10,10,.1); box-shadow: 0 8px 8px rgba(10,10,10,.1);
display: none; display: none;
font-size: .875rem; font-size: .875rem;
right: 0; left: 0;
min-width: 100%; min-width: 100%;
position: absolute; position: absolute;
top: 100%; top: 100%;
hr {
margin: 0.5rem 0;
}
.navbar-item { .navbar-item {
white-space: nowrap; white-space: nowrap;
padding: .375rem 1rem; padding: .375rem 1rem;

View file

@ -192,6 +192,7 @@ Publié automatiquement via #musictopus`;
async getAll() { async getAll() {
const { const {
page, page,
limit,
exportFormat = "json", exportFormat = "json",
sort = "artists_sort", sort = "artists_sort",
order = "asc", order = "asc",
@ -205,8 +206,6 @@ Publié automatiquement via #musictopus`;
discogsId, discogsId,
} = this.req.query; } = this.req.query;
const limit = this.req.user?.pagination || 16;
let userId = this.req.user?._id; let userId = this.req.user?._id;
const where = {}; const where = {};
@ -304,7 +303,6 @@ Publié automatiquement via #musictopus`;
default: default:
return { return {
rows, rows,
limit,
count, count,
}; };
} }

View file

@ -16,7 +16,6 @@ class Me extends Pages {
const { _id } = this.req.user; const { _id } = this.req.user;
const schema = Joi.object({ const schema = Joi.object({
pagination: Joi.number(),
isPublicCollection: Joi.boolean(), isPublicCollection: Joi.boolean(),
oldPassword: Joi.string(), oldPassword: Joi.string(),
password: Joi.string(), password: Joi.string(),
@ -46,10 +45,6 @@ class Me extends Pages {
user.salt = value.password; user.salt = value.password;
} }
if (value.pagination) {
user.pagination = value.pagination;
}
if (value.isPublicCollection !== undefined) { if (value.isPublicCollection !== undefined) {
user.isPublicCollection = value.isPublicCollection; user.isPublicCollection = value.isPublicCollection;
} }

View file

@ -25,10 +25,6 @@ const UserSchema = new mongoose.Schema(
}, },
hash: String, hash: String,
salt: String, salt: String,
pagination: {
type: Number,
default: 16,
},
isPublicCollection: { isPublicCollection: {
type: Boolean, type: Boolean,
default: false, default: false,

View file

@ -238,7 +238,7 @@
</div> </div>
<h2 id="boites">Les boites</h2> <h2 id="boites">Les boites</h2>
<div class="box mini"> <div class="box">
<form method="POST"> <form method="POST">
<h1> <h1>
Connexion Connexion

View file

@ -1,4 +1,4 @@
<div class="box mini"> <div class="box">
<form method="POST"> <form method="POST">
<h1> <h1>
Connexion Connexion

View file

@ -1,4 +1,4 @@
<div class="box mini"> <div class="box">
<form method="POST"> <form method="POST">
<h1> <h1>
Inscription Inscription

View file

@ -5,7 +5,7 @@
<form method="POST" @submit.prevent="updateProfil"> <form method="POST" @submit.prevent="updateProfil">
<div class="grid grid-cols-1 md:grid-cols-2 gap-10"> <div class="grid grid-cols-1 md:grid-cols-2 gap-10">
<div class="box"> <div>
<h2>Mes données personnelles</h2> <h2>Mes données personnelles</h2>
<div> <div>
<div class="field"> <div class="field">
@ -68,7 +68,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="box"> <div>
<h2>Mon activité</h2> <h2>Mon activité</h2>
<div> <div>
<div class="field"> <div class="field">
@ -126,22 +126,6 @@
</button> </button>
</div> </div>
</div> </div>
<div class="box">
<h2>Mes préférences</h2>
<div>
<div class="field">
<label for="pagination">Pagination</label>
<select id="pagination" v-model="formData.pagination">
<option value="16">16 albums/page</option>
<option value="24">24 albums/page</option>
<option value="32">32 albums/page</option>
<option value="48">48 albums/page</option>
</select>
</div>
</div>
</div>
<div></div>
<button type="submit" class="button is-primary mt-10" :disabled="loading"> <button type="submit" class="button is-primary mt-10" :disabled="loading">
<span v-if="!loading">Mettre à jour</span> <span v-if="!loading">Mettre à jour</span>
@ -155,6 +139,5 @@
<script> <script>
const email = '<%= user.email %>'; const email = '<%= user.email %>';
const username = '<%= user.username %>'; const username = '<%= user.username %>';
const pagination = "<%= user.pagination || 16 %>";
const mastodon = <%- JSON.stringify(user.mastodon || {publish: false, url: '', token: '', message: ''}) %>; const mastodon = <%- JSON.stringify(user.mastodon || {publish: false, url: '', token: '', message: ''}) %>;
</script> </script>

View file

@ -1,4 +1,4 @@
<section class="box mini" id="contact"> <section class="box" id="contact">
<h1>Nous contacter</h1> <h1>Nous contacter</h1>
<form @submit="send" <% if (config.mailMethod === 'formspree' ) { %> id="contact" method="POST" action="https://formspree.io/f/<%= config.formspreeId %>" <% } %>> <form @submit="send" <% if (config.mailMethod === 'formspree' ) { %> id="contact" method="POST" action="https://formspree.io/f/<%= config.formspreeId %>" <% } %>>
<div class="grid grid-cols-1 lg:grid-cols-2 gap-16"> <div class="grid grid-cols-1 lg:grid-cols-2 gap-16">