UX: do not show filter controls for PM admin reports

This commit is contained in:
Arpit Jalan 2016-04-21 13:03:23 +05:30
parent cd4ffccb4a
commit 89a7a90208
2 changed files with 13 additions and 6 deletions

View File

@ -26,6 +26,11 @@ export default Ember.Controller.extend({
return arr.concat(this.site.groups.map((i) => {return {name: i['name'], value: i['id']};}));
},
@computed('model.type')
showFilterOptions(modelType) {
return !modelType.match(/_private_messages$/);
},
@computed('model.type')
showGroupOptions(modelType) {
return modelType === "visits" || modelType === "signups" || modelType === "profile_views";

View File

@ -1,13 +1,15 @@
<h3>{{model.title}}</h3>
<div class="admin-reports-filter">
{{i18n 'admin.dashboard.reports.start_date'}} {{date-picker-past value=startDate}}
{{i18n 'admin.dashboard.reports.end_date'}} {{date-picker-past value=endDate}}
{{combo-box valueAttribute="value" content=categoryOptions value=categoryId}}
{{#if showGroupOptions}}
{{combo-box valueAttribute="value" content=groupOptions value=groupId}}
{{#if showFilterOptions}}
{{i18n 'admin.dashboard.reports.start_date'}} {{date-picker-past value=startDate}}
{{i18n 'admin.dashboard.reports.end_date'}} {{date-picker-past value=endDate}}
{{combo-box valueAttribute="value" content=categoryOptions value=categoryId}}
{{#if showGroupOptions}}
{{combo-box valueAttribute="value" content=groupOptions value=groupId}}
{{/if}}
{{d-button action="refreshReport" class="btn-primary" label="admin.dashboard.reports.refresh_report" icon="refresh"}}
{{/if}}
{{d-button action="refreshReport" class="btn-primary" label="admin.dashboard.reports.refresh_report" icon="refresh"}}
{{d-button action="exportCsv" label="admin.export_csv.button_text" icon="download"}}
</div>