discourse/app/assets/javascripts/admin/addon/templates/site-settings.hbs
Joffrey JAFFEUX c197daa04c
DEV: allows to alter category name/description (#28263)
This commit adds two new getters to the category model:
- `displayName`
- `descriptionText`

These getters are used instead of `name` and `description_text` where appropriate.

On top of this two transformers have been added to allow plugins to alter these getters:

```javascript
api.registerValueTransformer(
  "category-display-name",
  ({ value, context }) =>
    value + "-" + context.category.id + "-transformed"
);
```

```javascript
api.registerValueTransformer(
  "category-description-text",
  ({ value, context }) =>
    value + "-" + context.category.id + "-transformed"
);
```
2024-08-08 17:33:23 +02:00

37 lines
948 B
Handlebars

<AdminSiteSettingsFilterControls
@initialFilter={{this.filter}}
@onChangeFilter={{this.filterChanged}}
@showMenu={{true}}
@onToggleMenu={{this.toggleMenu}}
/>
<div class="admin-nav admin-site-settings-category-nav pull-left">
<ul class="nav nav-stacked">
{{#each this.visibleSiteSettings as |category|}}
<li
class={{concat-class
"admin-site-settings-category-nav__item"
category.nameKey
}}
>
<LinkTo
@route="adminSiteSettingsCategory"
@model={{category.nameKey}}
class={{category.nameKey}}
title={{category.displayName}}
>
{{category.displayName}}
{{#if category.count}}
<span class="count">({{category.count}})</span>
{{/if}}
</LinkTo>
</li>
{{/each}}
</ul>
</div>
<div class="admin-detail pull-left mobile-closed">
{{outlet}}
</div>
<div class="clearfix"></div>