-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3565c06
commit a8a5290
Showing
13 changed files
with
155 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<template> | ||
<BannerSticky | ||
v-if="config.public.readOnlyMode" | ||
type="warning" | ||
> | ||
{{ $t('Due to security reasons, the creation of new content is currently disabled.') }} | ||
</BannerSticky> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
const config = useRuntimeConfig() | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<template> | ||
<div | ||
class="group flex items-center justify-between rounded group-data-[with-container=true]/layout:!px-0 p-4 md:px-6" | ||
:data-banner-action-type="type" | ||
:class="{ | ||
'bg-datagouv-lightest text-datagouv-dark': type === 'info', | ||
'bg-danger-lightest text-danger-dark': type === 'error', | ||
'bg-warning-lightest text-warning-dark': type === 'warning', | ||
'bg-success-lighter text-success-darker': type === 'success', | ||
}" | ||
> | ||
<div class="group-data-[with-container=true]/layout:container flex items-center"> | ||
<component | ||
:is="icon" | ||
class="size-4 mr-2" | ||
/> | ||
<div class="flex-1"> | ||
<slot /> | ||
</div> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { RiAlertLine, RiCheckDoubleLine, RiInformationLine, RiSpamLine } from '@remixicon/vue' | ||
const props = defineProps<{ | ||
type: 'info' | 'error' | 'warning' | 'success' | ||
}>() | ||
const icon = computed(() => { | ||
switch (props.type) { | ||
case 'info': | ||
return RiInformationLine | ||
case 'error': | ||
return RiSpamLine | ||
case 'warning': | ||
return RiAlertLine | ||
case 'success': | ||
return RiCheckDoubleLine | ||
default: | ||
return throwOnNever(props.type as never, 'Unknown banner type') | ||
} | ||
}) | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<template> | ||
<div> | ||
<BannerSticky | ||
v-for="type in ['info', 'error', 'warning', 'success']" | ||
:key="type" | ||
:type | ||
class="mb-4" | ||
> | ||
Ces ressources sont publiées par la communauté et ne sont pas sous la responsabilité du producteur des données. | ||
</BannerSticky> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
<template> | ||
<div> | ||
<div | ||
class="group/layout" | ||
:data-with-container="true" | ||
> | ||
<SiteHeader /> | ||
<BannerReadOnly /> | ||
<slot /> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
<template> | ||
<div class="flex flex-col"> | ||
<div | ||
class="group/layout flex flex-col" | ||
:data-with-container="false" | ||
> | ||
<SiteHeader :fluid="true" /> | ||
<BannerReadOnly :fluid="true" /> | ||
<slot /> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
export function throwOnNever(_: never, message: string): never { | ||
throw new Error(message); | ||
} | ||
|
||
throw new Error(message) | ||
} |