(mustRead)
| 1181 | } |
| 1182 | |
| 1183 | function renderMustRead(mustRead) { |
| 1184 | const groups = [ |
| 1185 | ["作者", "authors"], |
| 1186 | ["机构", "institutions"], |
| 1187 | ["关键词", "keywords"], |
| 1188 | ]; |
| 1189 | $("mustReadList").className = "must-grid"; |
| 1190 | $("mustReadList").innerHTML = groups.map(([label, key]) => { |
| 1191 | const values = mustRead[key] || []; |
| 1192 | const body = values.length |
| 1193 | ? values.map((value) => `<span class="pill">${escapeHtml(value)}</span>`).join("") |
| 1194 | : `<span class="empty">空</span>`; |
| 1195 | return ` |
| 1196 | <div class="must-card"> |
| 1197 | <h4>${label}</h4> |
| 1198 | <div class="pill-list">${body}</div> |
| 1199 | </div> |
| 1200 | `; |
| 1201 | }).join(""); |
| 1202 | } |
| 1203 | |
| 1204 | async function updateMustRead(action) { |
| 1205 | const userId = ensureUser(); |
no test coverage detected