mirror of
https://github.com/discourse/discourse.git
synced 2024-12-12 18:23:43 +08:00
5835d4e5ed
... rather than just the category id. In order for the user to have selected a category, the category must have been loaded and it's useful for the category chooser to provide this fetched category so that it doesn't need to be refetched. In the future, it would be better to store the categories that the chooser knows about in local component state, so that the category doesn't need to be fetched from the id map, but this, at least, puts the API in place.
62 lines
1.6 KiB
Handlebars
62 lines
1.6 KiB
Handlebars
{{#if this.editing}}
|
|
<td class="editing-input">
|
|
<div class="label">{{i18n "admin.embedding.host"}}</div>
|
|
<Input
|
|
@value={{this.buffered.host}}
|
|
placeholder="example.com"
|
|
@enter={{this.save}}
|
|
class="host-name"
|
|
autofocus={{true}}
|
|
/>
|
|
</td>
|
|
<td class="editing-input">
|
|
<div class="label">{{i18n "admin.embedding.allowed_paths"}}</div>
|
|
<Input
|
|
@value={{this.buffered.allowed_paths}}
|
|
placeholder="/blog/.*"
|
|
@enter={{this.save}}
|
|
class="path-allowlist"
|
|
/>
|
|
</td>
|
|
<td class="editing-input">
|
|
<div class="label">{{i18n "admin.embedding.category"}}</div>
|
|
<CategoryChooser
|
|
@value={{this.category.id}}
|
|
@onChangeCategory={{fn (mut this.category)}}
|
|
class="small"
|
|
/>
|
|
</td>
|
|
<td class="editing-controls">
|
|
<DButton
|
|
@icon="check"
|
|
@action={{this.save}}
|
|
@disabled={{this.cantSave}}
|
|
class="btn-primary"
|
|
/>
|
|
<DButton
|
|
@icon="times"
|
|
@action={{this.cancel}}
|
|
@disabled={{this.host.isSaving}}
|
|
class="btn-danger"
|
|
/>
|
|
</td>
|
|
{{else}}
|
|
<td>
|
|
<div class="label">{{i18n "admin.embedding.host"}}</div>
|
|
{{this.host.host}}
|
|
</td>
|
|
<td>
|
|
<div class="label">
|
|
{{i18n "admin.embedding.allowed_paths"}}
|
|
</div>
|
|
{{this.host.allowed_paths}}
|
|
</td>
|
|
<td>
|
|
<div class="label">{{i18n "admin.embedding.category"}}</div>
|
|
{{category-badge this.category allowUncategorized=true}}
|
|
</td>
|
|
<td class="controls">
|
|
<DButton @icon="pencil-alt" @action={{this.edit}} />
|
|
<DButton @icon="far-trash-alt" @action={{this.delete}} class="btn-danger" />
|
|
</td>
|
|
{{/if}} |