Add menu item + CSS

This commit is contained in:
2024-12-05 07:58:47 +01:00
parent e32c695cf2
commit 1b8ef27c1e
3 changed files with 26 additions and 14 deletions

View File

@@ -80,23 +80,23 @@ export class Finding {
* @param {number} recordId
*/
async biblio(recordId) {
let record = await this.fetchData(`${window.API_URL}/finding/${recordId}`);
let finding = await this.fetchData(`${window.API_URL}/finding/${recordId}`);
let citations = '';
if (record.bibliography.length) {
record.bibliography.forEach(biblio => {
if (finding.bibliography.length) {
finding.bibliography.forEach(record => {
citations += `
<span class="is-clickable is-capitalized has-text-link"
data-action="click->biblio#open"
id="cit-${biblio.id}">
${biblio.citation.toLowerCase()}</span>`;
id="cit-${record.id}">
${record.citation.toLowerCase()}</span>`;
citations += biblio.pages?.length ? `, ${biblio.pages};` : ';';
citations += record.pages?.length ? `, ${record.pages};` : ';';
this.biblioElements.push(`
<div class="p-2 mt-2" id="ref-${biblio.id}">
<p class="p-3">${biblio.reference}</p>
<div class="p-2 mt-2" id="ref-${record.id}">
<p class="p-3">${record.reference}</p>
</div>
`);
});