discourse/app/assets/javascripts/admin/templates/search-logs-index.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

39 lines
1.3 KiB
Handlebars

<div class="admin-title">
{{period-chooser period=period onChange=(action (mut period))}}
{{combo-box
content=searchTypeOptions
value=searchType
class="search-logs-filter"
onChange=(action (mut searchType))
}}
</div>
{{#conditional-loading-spinner condition=loading}}
{{#if model.length}}
<table class='search-logs-list grid'>
<thead>
<th class="col heading term">{{i18n 'admin.logs.search_logs.term'}}</th>
<th class="col heading">{{i18n 'admin.logs.search_logs.searches'}}</th>
<th class="col heading">{{i18n 'admin.logs.search_logs.click_through_rate'}}</th>
</thead>
<tbody>
{{#each model as |item|}}
<tr class="admin-list-item">
<td class="col term">
{{#link-to 'adminSearchLogs.term' (query-params term=item.term period=period) class="test"}}
{{item.term}}
{{/link-to}}
</td>
<td class="col"><div class="label">{{i18n 'admin.logs.search_logs.searches'}}</div>{{item.searches}}</td>
<td class="col"><div class="label">{{i18n 'admin.logs.search_logs.click_through_rate'}}</div>{{item.ctr}}%</td>
</tr>
{{/each}}
</tbody>
</table>
{{else}}
{{i18n 'search.no_results'}}
{{/if}}
{{/conditional-loading-spinner}}