|
1 | 1 | <template> |
2 | 2 | <div class="border border-gray-default fr-p-1w"> |
3 | 3 | <div class="fr-grid-row fr-grid-row--middle flex-nowrap md:flex-wrap justify-between"> |
4 | | - <div class="fr-col-auto min-width-0"> |
| 4 | + <div class="fr-col-auto min-w-0"> |
5 | 5 | <div class="flex items-center mb-1"> |
6 | 6 | <ResourceIcon |
7 | 7 | :resource="resourceForm" |
8 | 8 | class="size-4 mr-1" |
9 | 9 | /> |
10 | | - <h4 class="fr-m-0 text-base/6 overflow-wrap-anywhere truncate"> |
| 10 | + <h4 class="m-0 text-base/6 overflow-wrap-anywhere truncate"> |
11 | 11 | {{ resourceForm.title || $t('Fichier sans nom') }} |
12 | 12 | </h4> |
13 | 13 | </div> |
14 | | - <div class="fr-my-0 text-gray-medium fr-grid-row fr-grid-row--middle"> |
| 14 | + <div class="my-0 text-gray-medium flex flex-wrap items-center gap-1"> |
15 | 15 | <div |
16 | 16 | v-if="resourceForm.schema?.name" |
17 | | - class="flex items-center space-x-1 text-sm fr-m-0 overflow-wrap-anywhere truncate dash-after" |
| 17 | + class="flex items-center space-x-1 text-sm m-0 overflow-wrap-anywhere truncate" |
18 | 18 | > |
19 | | - <RiInformationLine class="size-3 shrink-0" /> |
| 19 | + <RiInformationLine |
| 20 | + aria-hidden="true" |
| 21 | + class="size-3 shrink-0" |
| 22 | + /> |
20 | 23 | <span class="truncate">{{ $t('Schéma : {schema}', { schema: resourceForm.schema?.name }) }}</span> |
21 | 24 | </div> |
22 | | - <p |
23 | | - v-if="resourceForm.filetype === 'file' && resourceForm.file && resourceForm.file.raw.name != resourceForm.title" |
24 | | - class="text-sm fr-m-0 overflow-wrap-anywhere truncate dash-after" |
25 | | - > |
26 | | - {{ resourceForm.file.raw.name }} |
27 | | - </p> |
28 | | - <p |
29 | | - v-if="resourceForm.resource" |
30 | | - class="text-sm fr-m-0 dash-after" |
31 | | - > |
32 | | - <!-- Not sure if this date is useful, since it's about modification on a ressource --> |
33 | | - {{ $t('Mis à jour {date}', { date: formatRelativeIfRecentDate(resourceForm.resource.last_modified) }) }} |
34 | | - </p> |
35 | | - <p |
36 | | - v-if="guessFormat(resourceForm, extensions)" |
37 | | - class="text-sm fr-m-0" |
38 | | - > |
39 | | - {{ guessFormat(resourceForm, extensions) }} |
40 | | - <template v-if="filesize"> |
41 | | - ({{ formatFilesize(filesize) }}) |
42 | | - </template> |
43 | | - </p> |
| 25 | + <template v-if="resourceForm.filetype === 'file' && resourceForm.file && resourceForm.file.raw.name != resourceForm.title"> |
| 26 | + <RiSubtractLine |
| 27 | + aria-hidden="true" |
| 28 | + class="first:hidden size-3 mt-0.5" |
| 29 | + /> |
| 30 | + <p class="text-sm m-0 overflow-wrap-anywhere truncate"> |
| 31 | + {{ resourceForm.file.raw.name }} |
| 32 | + </p> |
| 33 | + </template> |
| 34 | + |
| 35 | + <template v-if="resourceForm.resource"> |
| 36 | + <RiSubtractLine |
| 37 | + aria-hidden="true" |
| 38 | + class="first:hidden size-3 mt-0.5" |
| 39 | + /> |
| 40 | + <p class="text-sm m-0"> |
| 41 | + <!-- Not sure if this date is useful, since it's about modification on a ressource --> |
| 42 | + {{ $t('Mis à jour {date}', { date: formatRelativeIfRecentDate(resourceForm.resource.last_modified) }) }} |
| 43 | + </p> |
| 44 | + </template> |
| 45 | + |
| 46 | + <template v-if="guessFormat(resourceForm, extensions)"> |
| 47 | + <RiSubtractLine |
| 48 | + aria-hidden="true" |
| 49 | + class="first:hidden size-3 mt-0.5" |
| 50 | + /> |
| 51 | + <p class="text-sm m-0"> |
| 52 | + {{ guessFormat(resourceForm, extensions) }} |
| 53 | + <template v-if="filesize"> |
| 54 | + ({{ formatFilesize(filesize) }}) |
| 55 | + </template> |
| 56 | + </p> |
| 57 | + </template> |
44 | 58 | </div> |
45 | 59 | <div |
46 | 60 | v-if="resourceForm.filetype === 'file'" |
|
148 | 162 | <script setup lang="ts"> |
149 | 163 | import { BrandedButton, filesize as formatFilesize, useFormatDate, ResourceIcon } from '@datagouv/components-next' |
150 | 164 | import { computed } from 'vue' |
151 | | -import { RiCodeSSlashLine, RiDeleteBinLine, RiInformationLine, RiLink, RiMapPin2Line } from '@remixicon/vue' |
| 165 | +import { RiCodeSSlashLine, RiDeleteBinLine, RiInformationLine, RiLink, RiMapPin2Line, RiSubtractLine } from '@remixicon/vue' |
152 | 166 | import FileEditModal from '../Datasets/FileEditModal.vue' |
153 | 167 | import FileLoader from './FileLoader.vue' |
154 | 168 | import type { CommunityResourceForm, ResourceForm } from '~/types/types' |
|
0 commit comments