forked from LaconicNetwork/cosmos-explorer
support metadata
This commit is contained in:
@@ -185,14 +185,18 @@ function pageload(p: number) {
|
||||
pageResponse.value = x.pagination;
|
||||
});
|
||||
}
|
||||
|
||||
function metaItem(metadata: string|undefined): { title: string; summary: string } {
|
||||
return metadata ? JSON.parse(metadata) : {}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<div class="bg-base-100 px-4 pt-3 pb-4 rounded mb-4 shadow">
|
||||
<h2 class="card-title flex flex-col md:!justify-between md:!flex-row">
|
||||
<h2 class="card-title flex flex-col md:!justify-between md:!flex-row mb-2">
|
||||
<p class="truncate w-full">
|
||||
{{ proposal_id }}. {{ proposal.title || proposal.content?.title }}
|
||||
{{ proposal_id }}. {{ proposal.title || proposal.content?.title || metaItem(proposal?.metadata)?.title }}
|
||||
</p>
|
||||
<div
|
||||
class="badge badge-ghost"
|
||||
@@ -210,9 +214,9 @@ function pageload(p: number) {
|
||||
<div class="">
|
||||
<ObjectElement :value="proposal.content" />
|
||||
</div>
|
||||
<div v-if="proposal.summary && !proposal.content?.description">
|
||||
<div v-if="proposal.summary && !proposal.content?.description || metaItem(proposal?.metadata)?.summary ">
|
||||
<MdEditor
|
||||
:model-value="format.multiLine(proposal.summary)"
|
||||
:model-value="format.multiLine(proposal.summary || metaItem(proposal?.metadata)?.summary)"
|
||||
previewOnly
|
||||
class="md-editor-recover"
|
||||
></MdEditor>
|
||||
|
||||
Reference in New Issue
Block a user