{% extends 'abase.axml' %} {% from 'actions.axml' import pagination %} {% set modal_name = 'Producers' %} {% macro commander() %} { isFilterable: false, nameSearch: '', locationSearch: '', whenFilter: '', filterResults(){ let base = `/v1/producers?pagination=${pagination}` if(this.nameSearch) base = `${base}&name=${this.nameSearch}` if(this.locationSearch) base = `${base}&location=${this.locationSearch}` if(this.whenFilter) base = `${base}&timeline=${this.whenFilter}` fetch(`${base}`) .then(response => response.json()) .then(data => { isFiltering = true; producers = data; }).catch(err => { ShowFeedback('error', 'Filter operation failed...') }) }, clearFilter(){ this.nameSearch = ''; this.locationSearch = ''; this.whenFilter = ''; refreshPage(); }, checkDirty(){ if(this.nameSearch !== '' || this.locationSearch !== '' || this.whenFilter !== '') { this.isFilterable = true; return true; } this.isFilterable = false; return false; } } {% endmacro %} {% block easel %} Filters: Select Date search clear filter Producer Location Pass phrase Timestamped Producer Location Pass phrase Timestamped {{ pagination() }} {% endblock %} {% block wizard %} Name: Address: Pass phrase: save producer {% endblock %}