added author info to method list

This commit is contained in:
dcore94 2022-07-21 12:35:21 +02:00
parent cdae1583f1
commit 6ee7bda28e
1 changed files with 35 additions and 4 deletions

View File

@ -88,16 +88,39 @@ class CCPMethodList extends HTMLElement{
.process_list_item_header{
margin: 0;
}
ul.author_list{
list-style: none;
display: flex;
flex-direction: row;
gap:2px;
padding-left: 0;
font-size: small;
font-weight: 300;
}
li.author_list_item{
display: inline-block;
padding: 0.25em 0.4em;
line-height: 1;
text-align: center;
white-space: nowrap;
vertical-align: baseline;
border-radius: 0.25rem;
background-color: #eeffff;
color: #9900CC;
border: solid 1px #9900CC;
}
</style>
<template id="PROCESS_LIST_TEMPLATE">
<ul class="process_list" name="process_list">
<li class="process_list_item" draggable="true">
<h4 class="process_list_item_header"></h4>
<i></i>
<ul name="authors" class="author_list">
<li class="author_list_item"></li>
</ul>
<ul name="keywords" class="keyword_list">
<li class="keyword_list_item"></li>
</ul>
<i></i>
</li>
</ul>
</template>
@ -174,14 +197,22 @@ class CCPMethodList extends HTMLElement{
recurse : [
{
target : "h4",
apply : (e,d)=>{ e.textContent = d.title }
apply : (e,d)=>{ e.textContent = `${d.title} v. ${d.version}` }
},
{
target : "i",
apply : (e,d)=>{ e.textContent = d.description }
},
{
target : "ul",
target : "ul[name=authors]",
recurse : {
target : "li",
"in" : (e,d)=>d.metadata.filter(md=>md.role === "author"),
apply : (e,d)=>{ e.textContent = d.title }
}
},
{
target : "ul[name=keywords]",
recurse : {
target : "li",
"in" : (e,d)=>d.keywords,