Skip to content

Commit

Permalink
Merge pull request #420 from iTrooz/site_count
Browse files Browse the repository at this point in the history
Show site count in profiles
  • Loading branch information
filips123 authored Nov 17, 2023
2 parents 1fb74e6 + bd3b003 commit 23afed3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
3 changes: 2 additions & 1 deletion extension/src/sites/manage.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@
<template id="profiles-list-template">
<div class="list-group-item d-flex justify-content-between align-items-start">
<div class="me-2 text-overflow-hide">
<div class="list-group-item-name" id="profiles-list-template-name"></div>
<span class="list-group-item-name" id="profiles-list-template-name"></span>
<span class="list-group-item-count text-secondary" id="profiles-list-template-count"></span>
<div class="list-group-item-description" id="profiles-list-template-description"></div>
</div>
<div class="btn-group my-auto">
Expand Down
11 changes: 11 additions & 0 deletions extension/src/sites/manage.js
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,17 @@ async function createProfileList () {
nameElement.innerText = profile.name || 'Unnamed'
nameElement.removeAttribute('id')

const countElement = profileElement.querySelector('#profiles-list-template-count')
if (profile.sites.length === 1) {
countElement.innerText = '(1 site)'
} else {
countElement.innerText = `(${profile.sites.length} sites)`
}
if (profile.sites.length === 0) {
countElement.classList.add('text-opacity-50')
}
countElement.removeAttribute('id')

const descriptionElement = profileElement.querySelector('#profiles-list-template-description')
descriptionElement.innerText = profile.description || ''
descriptionElement.removeAttribute('id')
Expand Down

0 comments on commit 23afed3

Please sign in to comment.