MODIF CONFIGS DRUPAL centre de ressources: tri par étape + ressources mis en avant
This commit is contained in:
@@ -83,6 +83,9 @@ const ressourcesByType = (type) => {
|
||||
searchQuery.value === '' ||
|
||||
ressource.title.toLowerCase().includes(searchQuery.value.toLowerCase())
|
||||
).sort((a, b) => {
|
||||
if (a.promoted && !b.promoted) return -1;
|
||||
if (!a.promoted && b.promoted) return 1;
|
||||
|
||||
const dateA = useParseDate(a.date);
|
||||
const dateB = useParseDate(b.date);
|
||||
|
||||
|
@@ -1,7 +1,8 @@
|
||||
<template>
|
||||
<div
|
||||
:data-href="ressource.url"
|
||||
:id="`ressource-${index}`">
|
||||
:id="`ressource-${index}`"
|
||||
:class="ressource.promoted ? 'promoted' : ''">
|
||||
<figure>
|
||||
<img :src="ressource.vignette.url" :alt="ressource.vignette.alt" />
|
||||
</figure>
|
||||
@@ -45,4 +46,4 @@ const props = defineProps({
|
||||
ressource: Object,
|
||||
index: String,
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user