Skip to content

Commit

Permalink
move rendering of name to SpecimenSummary
Browse files Browse the repository at this point in the history
  • Loading branch information
wbbaker committed Sep 12, 2024
1 parent e8519c2 commit 95ebfbb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
<p v-if="typeof inventoryDWC === 'string'" v-html="inventoryDWC"/>
<ul v-else class="tree ml-2">
<li v-for="specimen in inventoryDWC" :key="specimen.id" class="mt-1">
<span v-html="nameAndAuthor(specimen)"/>
<SpecimenSummary :specimen="specimen" :otu-id="otuId"/>
</li>
</ul>
Expand Down Expand Up @@ -64,12 +63,4 @@ watch(
{immediate: true}
)
function genusSpecies(specimen) {
return [specimen.genus, specimen.specificEpithet].filter(Boolean).join(' ')
}
function nameAndAuthor(specimen) {
return [`<em>${genusSpecies(specimen)}</em>`, specimen.scientificNameAuthorship].filter(Boolean).join(' ')
}
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ For further reference see https://dwc.tdwg.org/terms/.
-->
<template>
<!-- <ul class="tree m-2 ml-6 list-disc">-->
<div v-html="nameAndAuthor(specimen)"/>
<ul class="tree m-2 ml-6 relative">
<li class="my-2">{{ describeSpecimen(specimen) }}</li>
<li class="my-2">{{describeDetails(specimen).join(', ')}}</li>
Expand Down Expand Up @@ -32,7 +33,15 @@ const props = defineProps({
}
})

/** Based on taxonpages-orthoptera PanelSpecimenRecords. */
function genusSpecies(specimen) {
return [specimen.genus, specimen.specificEpithet].filter(Boolean).join(' ')
}

function nameAndAuthor(specimen) {
return [`<em>${genusSpecies(specimen)}</em>`, specimen.scientificNameAuthorship].filter(Boolean).join(' ')
}

/** Inspired by taxonpages-orthoptera PanelSpecimenRecords. */
function describeSpecimen(specimen) {
return [
specimen.catalogNumber,
Expand Down

0 comments on commit 95ebfbb

Please sign in to comment.