ssb: Bring back the date. Whoops.
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 29m37s

This commit is contained in:
2025-04-05 22:05:26 -04:00
parent 8be354fc49
commit 657f25e22b
6 changed files with 73 additions and 35 deletions

View File

@ -377,9 +377,7 @@ class TfMessageElement extends LitElement {
render_menu() {
let content = this.get_content();
let formats = [
['message', 'Message'],
];
let formats = [['message', 'Message']];
if (content?.type == 'post' || content?.type == 'blog') {
formats.push(['md', 'Markdown']);
}
@ -390,12 +388,33 @@ class TfMessageElement extends LitElement {
return html`
<div class="w3-bar-item w3-right w3-dropdown-hover">
<button class="w3-button w3-theme-d1">%</button>
<div class="w3-dropdown-content w3-bar-block w3-card-4 w3-theme-l1" style="right: 48px">
<a target="_top" class="w3-button w3-bar-item" href=${'#' + encodeURIComponent(this.message?.id)}>${this.message?.id}</a>
<button class="w3-button w3-bar-item w3-border-bottom" @click=${this.copy_id}>Copy ID</button>
${formats.map(([format, name]) => (html`
<button class="w3-button w3-bar-item" style=${format == this.format ? 'font-weight: bold' : ''} @click=${() => (this.format = format)}>${name}</button>
`))}
<div
class="w3-dropdown-content w3-bar-block w3-card-4 w3-theme-l1"
style="right: 48px"
>
<a
target="_top"
class="w3-button w3-bar-item"
href=${'#' + encodeURIComponent(this.message?.id)}
>${this.message?.id}</a
>
<button
class="w3-button w3-bar-item w3-border-bottom"
@click=${this.copy_id}
>
Copy ID
</button>
${formats.map(
([format, name]) => html`
<button
class="w3-button w3-bar-item"
style=${format == this.format ? 'font-weight: bold' : ''}
@click=${() => (this.format = format)}
>
${name}
</button>
`
)}
</div>
</div>
`;
@ -412,11 +431,10 @@ class TfMessageElement extends LitElement {
<span class="w3-bar-item">
<tf-user id=${this.message.author} .users=${this.users}></tf-user>
</span>
${is_encrypted}
${this.render_menu()}
<span class="w3-bar-item w3-right" style="text-wrap: nowrap"
${new Date(this.message.timestamp).toLocaleString()}</span
>
${is_encrypted} ${this.render_menu()}
<div class="w3-bar-item w3-right" style="text-wrap: nowrap">
${new Date(this.message.timestamp).toLocaleString()}
</div>
</header>
`;
}