feat(wiki): improvements to the wiki's UI

This commit is contained in:
2024-02-22 18:11:13 +01:00
parent a4bf3542e0
commit 1d5cdf9607
4 changed files with 39 additions and 11 deletions

View File

@ -5,6 +5,7 @@ class TfCollectionElement extends LitElement {
static get properties() {
return {
whoami: {type: String},
category: {type: String},
collection: {type: Object},
selected_id: {type: String},
is_creating: {type: Boolean},
@ -68,7 +69,7 @@ class TfCollectionElement extends LitElement {
<link rel="stylesheet" href="tildefriends.css"/>
<span class="inline-flex-row">
<select class="button" @change=${this.on_selected} id="select" value=${this.selected_id}>
<option value="" ?selected=${this.selected_id === ''} disabled hidden>(select)</option>
<option value="" ?selected=${this.selected_id === ''} disabled hidden>(select ${this.category})</option>
${Object.values(this.collection ?? {}).sort((x, y) => x.name.localeCompare(y.name)).map(x => html`<option value=${x.id} ?selected=${this.selected_id === x.id}>${x.name}</option>`)}
</select>
<span ?hidden=${!this.is_renaming || !this.whoami}>