${windowDef.icon}
${windowDef.name}
${windowDef.range}
${sealed.length}/${instances.length}
${repeat(
open,
(instance) => instance.id,
(instance) => this._renderQuest(instance, false, 0)
)}
${repeat(
sealed,
(instance) => instance.id,
(instance, index) => this._renderQuest(instance, true, index)
)}
${windowDef.key === "afternoon" ? this._renderRollup() : nothing}
`;
}
private _renderQuest(
instance: PanelInstance,
sealed: boolean,
sealedIndex: number
) {
if (sealed) {
const rotation = SEAL_ROTATIONS[sealedIndex % SEAL_ROTATIONS.length];
const claimedAt = instance.completed_at
? formatInstant(instance.completed_at, this._timeZone())
: "";
return html`
this._openConfirm(instance.id)}
@keydown=${(event: KeyboardEvent) => {
if (event.key === "Enter" || event.key === " ") {
event.preventDefault();
this._openConfirm(instance.id);
}
}}
>
${renderQuestIcon(instance.icon, ICON_STAR)}
${instance.title}
${meta.text}
`;
}
private _renderRollup() {
const others = this._otherChildren();
if (others.length === 0) {
return nothing;
}
const sentences = others.slice(0, 2).map((child) => {
if (!child.present) {
return child.returnsWeekday
? `${child.name} is on travels until ${child.returnsWeekday}.`
: `${child.name} is on travels.`;
}
if (child.due > 0 && child.completed >= child.due) {
return `${child.name} has finished their log.`;
}
if (child.due > child.completed) {
return `${child.name} has ${child.due - child.completed} quests left.`;
}
return `${child.name} has no quests today.`;
});
return html`