Skip to content

Commit

Permalink
project list: add tags column
Browse files Browse the repository at this point in the history
Signed-off-by: Valentijn Scholten <valentijnscholten@gmail.com>
  • Loading branch information
valentijnscholten committed Apr 15, 2023
1 parent 25acb78 commit 9e74d9e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/views/portfolio/projects/ProjectList.vue
Expand Up @@ -185,12 +185,15 @@
sortable: false,
visible: false,
formatter(value, row, index) {
let tag_string = row.tags.slice(0, 2)?.map(tag => common.formatProjectTagLabel(tag)).join(' ') || '';
if (row.tags.length > 2) {
tag_string += ` <span class="d-none">`
let tag_string = ""
if (row.tags) {
tag_string = row.tags?.slice(0, 2).map(tag => common.formatProjectTagLabel(tag)).join(' ') || '';
if (row.tags.length > 2) {
tag_string += ` <span class="d-none">`
tag_string += row.tags.slice(2)?.map(tag => common.formatProjectTagLabel(tag)).join(' ');
tag_string += `</span>`
tag_string += `<a href="#" title="show all tags" class="badge badge-tag" onclick="this.previousElementSibling.classList.toggle('d-none')">…</a>`
}
}
return tag_string;
}
Expand Down

0 comments on commit 9e74d9e

Please sign in to comment.