diff --git a/jig-core/src/main/resources/templates/assets/package.js b/jig-core/src/main/resources/templates/assets/package.js index 3ee31da21..59a2f8c55 100644 --- a/jig-core/src/main/resources/templates/assets/package.js +++ b/jig-core/src/main/resources/templates/assets/package.js @@ -450,6 +450,19 @@ function buildPackageTableRowElement(spec, applyFilter, applyRelatedFilterForRow nameTd.textContent = spec.name; tr.appendChild(nameTd); + const glossaryTd = document.createElement('td'); + glossaryTd.className = 'glossary-cell'; + const glossaryLink = document.createElement('a'); + glossaryLink.className = 'glossary-link-icon'; + glossaryLink.href = `glossary.html#${encodeURIComponent(spec.fqn)}`; + glossaryLink.setAttribute('aria-label', '用語集'); + const glossaryText = document.createElement('span'); + glossaryText.className = 'screen-reader-only'; + glossaryText.textContent = '用語集'; + glossaryLink.appendChild(glossaryText); + glossaryTd.appendChild(glossaryLink); + tr.appendChild(glossaryTd); + const classCountTd = document.createElement('td'); classCountTd.textContent = String(spec.classCount); classCountTd.className = 'number'; diff --git a/jig-core/src/main/resources/templates/assets/style.css b/jig-core/src/main/resources/templates/assets/style.css index 7a8b31583..71630dae4 100644 --- a/jig-core/src/main/resources/templates/assets/style.css +++ b/jig-core/src/main/resources/templates/assets/style.css @@ -351,6 +351,21 @@ label { .package-list button.related-icon:hover { background-color: #f5f5f5; } +.package-list a.glossary-link-icon { + display: inline-block; + width: 1.8em; + height: 1.8em; + box-sizing: border-box; + border-radius: 999px; + border: 1px solid #999; + background: #fff no-repeat center; + background-image: url("data:image/svg+xml;utf8,"); + text-decoration: none; + vertical-align: middle; +} +.package-list a.glossary-link-icon:hover { + background-color: #f5f5f5; +} .package-list .mutual-dependencies { margin: 12px 0 16px 0; padding: 8px 12px; @@ -378,6 +393,12 @@ label { .package-list table .col-action { width: 2.5em; } +.package-list table .col-glossary { + width: 2.5em; +} +.package-list td.glossary-cell { + text-align: center; +} .package-list table th.no-sort { cursor: default; } diff --git a/jig-core/src/main/resources/templates/package.html b/jig-core/src/main/resources/templates/package.html index 3b84be2e1..011ea4740 100644 --- a/jig-core/src/main/resources/templates/package.html +++ b/jig-core/src/main/resources/templates/package.html @@ -82,6 +82,7 @@