discourse/app/assets/javascripts/admin/addon/templates/customize-form-templates-index.gjs
David Taylor b29e0b6e1b
DEV: [gjs-codemod] convert admin files to gjs
Updated using `@embroider/template-tag-codemod`, plus some manual fixups.
2025-03-25 16:59:21 +00:00

47 lines
1.4 KiB
Text
Vendored

import RouteTemplate from "ember-route-template";
import DButton from "discourse/components/d-button";
import { i18n } from "discourse-i18n";
import InfoHeader from "admin/components/form-template/info-header";
import RowItem from "admin/components/form-template/row-item";
export default RouteTemplate(
<template>
<div class="form-templates">
<InfoHeader />
{{#if @controller.model}}
<table class="form-templates__table grid">
<thead>
<th class="col heading">
{{i18n "admin.form_templates.list_table.headings.name"}}
</th>
<th class="col heading">
{{i18n
"admin.form_templates.list_table.headings.active_categories"
}}
</th>
<th class="col heading sr-only">
{{i18n "admin.form_templates.list_table.headings.actions"}}
</th>
</thead>
<tbody>
{{#each @controller.model as |template|}}
<RowItem
@template={{template}}
@refreshModel={{@controller.reload}}
/>
{{/each}}
</tbody>
</table>
{{/if}}
<DButton
@label="admin.form_templates.new_template"
@title="admin.form_templates.new_template"
@icon="plus"
@action={{@controller.newTemplate}}
class="btn-primary"
/>
</div>
</template>
);