discourse/app/assets/javascripts/admin/templates/components/embeddable-host.hbs
Joffrey JAFFEUX 0431942f3d
DEV: select-kit 2 (#7998)
This new iteration of select-kit focuses on following best principales and disallowing mutations inside select-kit components. A best effort has been made to avoid breaking changes, however if you content was a flat array, eg: ["foo", "bar"] You will need to set valueProperty=null and nameProperty=null on the component.

Also almost every component should have an `onChange` handler now to decide what to do with the updated data. **select-kit will not mutate your data by itself anymore**
2020-02-03 14:22:14 +01:00

36 lines
1.6 KiB
Handlebars

{{#if editing}}
<td class="editing-input">
<div class="label">{{i18n "admin.embedding.host"}}</div>
{{input value=buffered.host placeholder="example.com" enter=(action "save") class="host-name"}}
</td>
<td class="editing-input">
<div class="label">{{i18n "admin.embedding.class_name"}}</div>
{{input value=buffered.class_name placeholder="class" enter=(action "save") class="class-name"}}
</td>
<td class="editing-input">
<div class="label">{{i18n "admin.embedding.path_whitelist"}}</div>
{{input value=buffered.path_whitelist placeholder="/blog/.*" enter=(action "save") class="path-whitelist"}}
</td>
<td class="editing-input">
<div class="label">{{i18n "admin.embedding.category"}}</div>
{{category-chooser
value=categoryId
class="small"
onChange=(action (mut categoryId))
}}
</td>
<td class="editing-controls">
{{d-button icon="check" action=(action "save") class="btn-primary" disabled=cantSave}}
{{d-button icon="times" action=(action "cancel") class="btn-danger" disabled=host.isSaving}}
</td>
{{else}}
<td><div class="label">{{i18n "admin.embedding.host"}}</div>{{host.host}}</td>
<td><div class="label">{{i18n "admin.embedding.class_name"}}</div>{{host.class_name}}</td>
<td><div class="label">{{i18n "admin.embedding.path_whitelist"}}</div>{{host.path_whitelist}}</td>
<td><div class="label">{{i18n "admin.embedding.category"}}</div>{{category-badge host.category}}</td>
<td class="controls">
{{d-button icon="pencil-alt" action=(action "edit")}}
{{d-button icon="far-trash-alt" action=(action "delete") class='btn-danger'}}
</td>
{{/if}}