Skip to content

Commit

Permalink
Feat/add breadcrumbs (#251)
Browse files Browse the repository at this point in the history
* feat: added breadcrumbs to pages

* feat: added breadcrumbs for about page

* fix: removed console.log

* fix: removed computed when no necessary
  • Loading branch information
Jorek57 authored Dec 11, 2023
1 parent 5672ccd commit 7984ae7
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/custom/meteo/views/FormMF.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ const selectItems = ref([])
let selectedDataPack = ref(null)
const optionsDataPack = ref(Object.keys(datasetsIds))
const links = [{ to: '/', text: 'Accueil' }, { text: 'Recherche Guidée' }]
const onSelectDataPack = (pack) => {
selectedDataset.value = null
showDep.value = false
Expand Down Expand Up @@ -124,6 +126,9 @@ const showLoader = ref(false)
</script>

<template>
<div class="fr-container">
<DsfrBreadcrumb :links="links" />
</div>
<div class="fr-container fr-mt-4w fr-mb-4w">
<h1>Recherche guidée</h1>
<p>Utiliser ce formulaire pour trouver un fichier en particulier.</p>
Expand Down
7 changes: 7 additions & 0 deletions src/views/SimplePageView.vue
Original file line number Diff line number Diff line change
@@ -1,26 +1,33 @@
<script setup>
import MarkdownIt from 'markdown-it'
import { computed, watchEffect } from 'vue'
import { useRouter } from 'vue-router'
import { pageStore } from '../store/PageStore'
const markdown = new MarkdownIt()
const store = pageStore()
const content = computed(() => store.content)
const title = useRouter().currentRoute.value.meta.title
const props = defineProps({
url: {
type: String,
required: true
}
})
const links = computed(() => [{ to: '/', text: 'Accueil' }, { text: title }])
watchEffect(async () => {
if (!props.url) return
store.getPageFromUrl(props.url)
})
</script>

<template>
<div class="fr-container">
<DsfrBreadcrumb :links="links" />
</div>
<div class="fr-container fr-mt-4w fr-mb-4w">
<!-- eslint-disable-next-line vue/no-v-html -->
<div v-html="markdown.render(content)" />
Expand Down
5 changes: 5 additions & 0 deletions src/views/datasets/DatasetsListView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ const topicOptions = computed(() => {
return [{ value: '', text: 'Toutes les données' }, ...topics]
})
const links = [{ to: '/', text: 'Accueil' }, { text: 'Données' }]
const onSelectTopic = (topicId) => {
selectedTopicId.value = topicId
currentPage.value = 1
Expand Down Expand Up @@ -63,6 +65,9 @@ watchEffect(() => {
</script>
<template>
<div class="fr-container">
<DsfrBreadcrumb :links="links" />
</div>
<div class="fr-container fr-mt-4w fr-mb-4w">
<h1>Jeux de données</h1>
<p v-if="query">Résultats de recherche pour "{{ query }}".</p>
Expand Down
9 changes: 9 additions & 0 deletions src/views/organizations/OrganizationDetailView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ const datasetStore = useDatasetStore()
const org = computed(() => orgStore.get(organizationId) || {})
const links = computed(() => [
{ to: '/', text: 'Accueil' },
{ to: '/organizations', text: 'Organisations' },
{ text: org.value.title }
])
const currentPage = ref(1)
const pages = ref([])
const datasets = ref({})
Expand Down Expand Up @@ -51,6 +57,9 @@ watchEffect(() => {
</script>

<template>
<div class="fr-container">
<DsfrBreadcrumb :links="links" />
</div>
<div class="fr-container fr-mt-4w fr-mb-4w">
<h1>{{ org.name }}</h1>
<div v-html="description"></div>
Expand Down
10 changes: 9 additions & 1 deletion src/views/organizations/OrganizationsListView.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
import { ref, onMounted } from 'vue'
import { computed, ref, onMounted } from 'vue'
import { useLoading } from 'vue-loading-overlay'
import config from '@/config'
Expand All @@ -14,6 +14,11 @@ const currentPage = ref(1)
const pages = store.getPagination()
const organizations = ref([])
const links = computed(() => [
{ to: '/', text: 'Accueil' },
{ text: 'Organisations' }
])
const title = config.website.title
async function onUpdatePage(page) {
Expand All @@ -29,6 +34,9 @@ onMounted(() => {
</script>

<template>
<div class="fr-container">
<DsfrBreadcrumb :links="links" />
</div>
<div class="fr-container fr-mt-4w fr-mb-4w">
<h1>Organisations</h1>
<p>Parcourir toutes les organisations présentes sur {{ title }}.</p>
Expand Down

0 comments on commit 7984ae7

Please sign in to comment.