Jarek Radosz 36a9b5d0fa
DEV: Introduce a helper for handling events (#25433)
Instead of

```hbs
{{on "input" (action this.foo value="target.value")}}
{{on "input" (action (mut this.bar) value="target.value")}}
```

you can use:

```hbs
{{on "input" (with-event-value this.foo)}}
{{on "input" (with-event-value (fn (mut this.bar)))}}
```

or in gjs:

```gjs
import { fn } from "@ember/helper";
import { on } from "@ember/modifier";
import withEventValue from "discourse/helpers/with-event-value";
…
{{on "input" (withEventValue (fn (mut this.bar)))}}
```
2024-02-28 14:00:53 +01:00

33 lines
1012 B
Handlebars

<ConditionalLoadingSpinner @condition={{this.isLoading}}>
<div class="reports-index section">
<div class="section-title">
<h2>{{i18n "admin.reports.title"}}</h2>
<Input
class="filter-reports-input"
placeholder={{i18n "admin.dashboard.filter_reports"}}
autofocus={{true}}
{{on "input" (with-event-value this.filterReports)}}
/>
</div>
<div class="alert alert-info">
{{d-icon "book"}}
{{html-safe (i18n "admin.reports.meta_doc")}}
</div>
<ul class="reports-list">
{{#each this.filteredReports as |report|}}
<li class="report">
<LinkTo @route="adminReports.show" @model={{report.type}}>
<h3 class="report-title">{{report.title}}</h3>
{{#if report.description}}
<p class="report-description">
{{report.description}}
</p>
{{/if}}
</LinkTo>
</li>
{{/each}}
</ul>
</div>
</ConditionalLoadingSpinner>