forked from cory/tildefriends
Format about messages. Todo fixes. Add a collapse button to complement more.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4077 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
@ -185,7 +185,7 @@ class TfMessageElement extends LitElement {
|
||||
if (this.collapsed && this.message.child_messages?.length) {
|
||||
return html`<input type="button" value=${this.message.child_messages?.length + ' More'} @click=${() => self.collapsed = false}></input>`;
|
||||
} else {
|
||||
return html`${(this.message.child_messages || []).map(x => html`<tf-message .message=${x} whoami=${this.whoami} .users=${this.users}></tf-message>`)}`;
|
||||
return html`<input type="button" value="Collapse" @click=${() => self.collapsed = true}></input>${(this.message.child_messages || []).map(x => html`<tf-message .message=${x} whoami=${this.whoami} .users=${this.users}></tf-message>`)}`;
|
||||
}
|
||||
}
|
||||
|
||||
@ -217,9 +217,29 @@ class TfMessageElement extends LitElement {
|
||||
</div>`;
|
||||
} else if (typeof(content?.type === 'string')) {
|
||||
if (content.type == 'about') {
|
||||
let name;
|
||||
let image;
|
||||
let description;
|
||||
if (content.name !== undefined) {
|
||||
name = html`<div><b>Name:</b> ${content.name}</div>`;
|
||||
}
|
||||
if (content.image !== undefined) {
|
||||
image = html`
|
||||
<div><img src=${'/' + content.image + '/view'} style="width: 256px; height: auto"></img></div>
|
||||
`;
|
||||
}
|
||||
if (content.description !== undefined) {
|
||||
description = html`
|
||||
<div style="flex: 1 0 50%">
|
||||
<div>${unsafeHTML(tfutils.markdown(content.description))}</div>
|
||||
</div>
|
||||
`
|
||||
}
|
||||
return small_frame(html`
|
||||
<div style="font-weight: bold">Updated profile:</div>
|
||||
<pre style="white-space: pre-wrap; overflow-wrap: anywhere">${JSON.stringify(content, null, 2)}</pre>
|
||||
<div style="font-weight: bold">Updated profile.</div>
|
||||
${name}
|
||||
${image}
|
||||
${description}
|
||||
`);
|
||||
} else if (content.type == 'contact') {
|
||||
return small_frame(html`
|
||||
|
Reference in New Issue
Block a user