-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: add WIP of affected document list item
Currently not integrated in the application, but will be used for displaying affected documents and linking to the metadata editor. Unit tests to be done. RISDEV-3126
- Loading branch information
1 parent
8549b03
commit bff8173
Showing
2 changed files
with
66 additions
and
3 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
59 changes: 57 additions & 2 deletions
59
frontend/src/components/affectedDocuments/RisAffectedDocumentPanel.vue
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,3 +1,58 @@ | ||
<script setup lang="ts"></script> | ||
<script setup lang="ts"> | ||
import RisTextButton from "@/components/controls/RisTextButton.vue" | ||
import { computed } from "vue" | ||
import IcOutlineModeEdit from "~icons/ic/outline-mode-edit" | ||
<template>Hello world</template> | ||
const props = defineProps<{ | ||
/** | ||
* When set, the panel will render as a list item so it can be included in | ||
* ordered or unordered lists. By default, the panel will be rendered as an | ||
* unsemantic div element and you'll need to ensure correct semantics by | ||
* yourself. | ||
*/ | ||
asListItem: boolean | ||
/** FNA number of the affected document. */ | ||
fna?: string | ||
/** Abbreviated title of the affected document. */ | ||
shortTitle?: string | ||
/** Full title of the affected document. */ | ||
title: string | ||
/** | ||
* ELI of the affected document. This is needed both for display as well | ||
* as linking to the correct page for metadata editing. | ||
*/ | ||
eli: string | ||
}>() | ||
const tag = computed<"li" | "div">(() => (props.asListItem ? "li" : "div")) | ||
</script> | ||
|
||
<template> | ||
<component :is="tag" :class="{ 'list-none': tag === 'li' }"> | ||
<div class="flex gap-24 bg-blue-200 p-24"> | ||
<div class="flex flex-1 flex-col gap-8"> | ||
<div v-if="fna || shortTitle"> | ||
<template v-if="fna"> | ||
FNA <span class="font-bold">{{ fna }}</span> | ||
</template> | ||
<span v-if="fna && shortTitle" class="mx-4 font-bold">-</span> | ||
<span v-if="shortTitle" class="font-bold">{{ shortTitle }}</span> | ||
</div> | ||
<div v-if="title">{{ title }}</div> | ||
<div v-if="eli">{{ eli }}</div> | ||
</div> | ||
|
||
<div class="flex flex-none items-center"> | ||
<RisTextButton | ||
label="Metadaten bearbeiten" | ||
:icon="IcOutlineModeEdit" | ||
variant="ghost" | ||
/> | ||
</div> | ||
</div> | ||
</component> | ||
</template> |