This commit is contained in:
parent
a330932f15
commit
3743fef69e
2 changed files with 69 additions and 1 deletions
|
|
@ -9,3 +9,71 @@ hide:
|
|||
Bugs and feature requests should be reported with an issue on https://gitnet.fr/deblan/side_menu/issues.
|
||||
|
||||
You can also join the official room on Matrix: [#custommenu:neutralnetwork.org](https://matrix.to/#/#custommenu:neutralnetwork.org).
|
||||
|
||||
<div id="issues">
|
||||
<h3>Current issue(s)</h3>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const requestHeaders = new Headers({'accept': 'application/json'});
|
||||
const issues = document.querySelector('#issues')
|
||||
const createAdmonition = (type, prefix, item) => {
|
||||
const element = document.createElement('div')
|
||||
element.innerHTML = `
|
||||
<div class="admonition ${type}">
|
||||
<p class="admonition-title">
|
||||
<a href="${item.html_url}" target="_blank">${prefix} #${item.number}</a>
|
||||
</p>
|
||||
<p>
|
||||
${item.title}
|
||||
</p>
|
||||
</div>
|
||||
`
|
||||
return element
|
||||
}
|
||||
|
||||
const createEnhancement = (item) => {
|
||||
return createAdmonition('example', 'Feature', item)
|
||||
}
|
||||
|
||||
const createBug = (item) => {
|
||||
return createAdmonition('bug', 'Bug', item)
|
||||
}
|
||||
|
||||
const createQuestion = (item) => {
|
||||
return createAdmonition('question', 'Issue', item)
|
||||
}
|
||||
|
||||
fetch('https://gitnet.fr/api/v1/repos/deblan/side_menu/issues?state=open', {
|
||||
headers: new Headers({'accept': 'application/json'})
|
||||
})
|
||||
.then((response) => {
|
||||
return response.json()
|
||||
})
|
||||
.then((json) => {
|
||||
if (json.length === 0) {
|
||||
issues.style.display = 'none'
|
||||
}
|
||||
|
||||
json.forEach((item) => {
|
||||
let isBug = false
|
||||
let isEnhancement = false
|
||||
|
||||
item.labels.forEach((label) => {
|
||||
if (label.name === 'bug') {
|
||||
isBug = true
|
||||
} else if (label.name === 'enhancement') {
|
||||
isEnhancement = true
|
||||
}
|
||||
})
|
||||
|
||||
if (isBug) {
|
||||
issues.appendChild(createBug(item))
|
||||
} else if (isEnhancement) {
|
||||
issues.appendChild(createEnhancement(item))
|
||||
} else {
|
||||
issues.appendChild(createQuestion(item))
|
||||
}
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ nav:
|
|||
- Overview: index.md
|
||||
- Screenshots: screenshots.md
|
||||
- Requirements: requirements.md
|
||||
- Install and update: setup.md
|
||||
- Install and upgrade: setup.md
|
||||
- Settings:
|
||||
- User: settings.md
|
||||
- Admin: settings.md
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue