Change logic for colorization of followed corpora in corpus Lists

This commit is contained in:
Patrick Jentsch 2023-05-08 11:32:28 +02:00
parent 47b9a90cb6
commit c3306563f0
2 changed files with 14 additions and 17 deletions

View File

@ -20,8 +20,9 @@ class CorpusList extends ResourceList {
// #region Mandatory getters and methods to implement // #region Mandatory getters and methods to implement
get item() { get item() {
return (values) => {
return ` return `
<tr class="list-item clickable hoverable"> <tr class="${values['is-owner'] ? '' : 'deep-purple lighten-5'} list-item clickable hoverable">
<td><a class="btn-floating disabled"><i class="material-icons service-color darken" data-service="corpus-analysis">book</i></a></td> <td><a class="btn-floating disabled"><i class="material-icons service-color darken" data-service="corpus-analysis">book</i></a></td>
<td><b class="title"></b><br><i class="description"></i></td> <td><b class="title"></b><br><i class="description"></i></td>
<td><span class="owner"></span></td> <td><span class="owner"></span></td>
@ -32,6 +33,7 @@ class CorpusList extends ResourceList {
</td> </td>
</tr> </tr>
`.trim(); `.trim();
};
} }
get valueNames() { get valueNames() {
@ -42,7 +44,6 @@ class CorpusList extends ResourceList {
'description', 'description',
'title', 'title',
'owner', 'owner',
{data: ['is-owner']}
]; ];
} }

View File

@ -147,9 +147,5 @@
{% endfor %} {% endfor %}
] ]
); );
corpusItems = document.querySelectorAll('[data-is-owner="false"]');
corpusItems.forEach((item) => {
item.classList.add('deep-purple', 'lighten-5');
});
</script> </script>
{% endblock scripts %} {% endblock scripts %}