discourse/app/assets/javascripts/admin/templates/logs/staff-action-logs.hbs
2018-07-03 11:14:53 +08:00

99 lines
3.7 KiB
Handlebars

<div class="staff-action-logs-controls">
{{#if filtersExists}}
<div class='staff-action-logs-filters'>
<a {{action "clearAllFilters"}} class="clear-filters filter">
<span class="label">{{i18n 'admin.logs.staff_actions.clear_filters'}}</span>
</a>
{{#if actionFilter}}
<a {{action "clearFilter" "actionFilter"}} class="filter">
<span class="label">{{i18n 'admin.logs.action'}}</span>: {{actionFilter}}
{{d-icon "times-circle"}}
</a>
{{/if}}
{{#if filters.acting_user}}
<a {{action "clearFilter" "acting_user"}} class="filter">
<span class="label">{{i18n 'admin.logs.staff_actions.staff_user'}}</span>: {{filters.acting_user}}
{{d-icon "times-circle"}}
</a>
{{/if}}
{{#if filters.target_user}}
<a {{action "clearFilter" "target_user"}} class="filter">
<span class="label">{{i18n 'admin.logs.staff_actions.target_user'}}</span>: {{filters.target_user}}
{{d-icon "times-circle"}}
</a>
{{/if}}
{{#if filters.subject}}
<a {{action "clearFilter" "subject"}} class="filter">
<span class="label">{{i18n 'admin.logs.staff_actions.subject'}}</span>: {{filters.subject}}
{{d-icon "times-circle"}}
</a>
{{/if}}
</div>
{{else}}
{{i18n "admin.logs.staff_actions.filter"}} {{combo-box content=userHistoryActions value=filterActionId none="admin.logs.staff_actions.all"}}
{{/if}}
{{d-button action="exportStaffActionLogs" label="admin.export_csv.button_text" icon="download"}}
</div>
<div class="clearfix"></div>
{{#staff-actions}}
{{#conditional-loading-spinner condition=loading}}
<table class='table staff-logs grid'>
<thead>
<th>{{i18n 'admin.logs.staff_actions.staff_user'}}</th>
<th>{{i18n 'admin.logs.action'}}</th>
<th>{{i18n 'admin.logs.staff_actions.subject'}}</th>
<th>{{i18n 'admin.logs.staff_actions.when'}}</th>
<th>{{i18n 'admin.logs.staff_actions.details'}}</th>
<th>{{i18n 'admin.logs.staff_actions.context'}}</th>
</thead>
<tbody>
{{#each model as |item|}}
<tr class='admin-list-item'>
<td class="staff-users">
<div class="staff-user">
{{#link-to 'adminUser' item.acting_user}}{{avatar item.acting_user imageSize="tiny"}}{{/link-to}}
<a {{action "filterByStaffUser" item.acting_user}}>{{item.acting_user.username}}</a>
</div>
</td>
<td class="col value action">
<a {{action "filterByAction" item}}>{{item.actionName}}</a>
</td>
<td class="col value subject">
<div class="subject">
{{#if item.target_user}}
{{#link-to 'adminUser' item.target_user}}{{avatar item.target_user imageSize="tiny"}}{{/link-to}}
<a {{action "filterByTargetUser" item.target_user}}>{{item.target_user.username}}</a>
{{/if}}
{{#if item.subject}}
<a {{action "filterBySubject" item.subject}} title={{item.subject}}>{{item.subject}}</a>
{{/if}}
</div>
</td>
<td class="col value created-at">{{age-with-tooltip item.created_at}}</td>
<td class="col value details">
{{{item.formattedDetails}}}
{{#if item.useCustomModalForDetails}}
<a {{action "showCustomDetailsModal" item}}>{{d-icon "info-circle"}} {{i18n 'admin.logs.staff_actions.show'}}</a>
{{/if}}
{{#if item.useModalForDetails}}
<a {{action "showDetailsModal" item}}>{{d-icon "info-circle"}} {{i18n 'admin.logs.staff_actions.show'}}</a>
{{/if}}
</td>
<td class="col value context">{{item.context}}</td>
</tr>
{{else}}
{{i18n 'search.no_results'}}
{{/each}}
</tbody>
</table>
{{/conditional-loading-spinner}}
{{/staff-actions}}