{% extends 'clean_base.axml' %} {% from 'actions.axml' import pagination %} {% set modal_name = 'Add Redaction' %} {% macro commander() %} { isFilterable: false, actionSearch: '', fieldPathSearch: '', whenFilter: '', filterResults(){ let base = `/v1/redactions?pagination=${this.pagination}&page=1` if(this.actionSearch) base += `&action=${this.actionSearch}` if(this.fieldPathSearch) base += `&field_path=${this.fieldPathSearch}` if(this.whenFilter) base += `&timeline=${this.whenFilter}` fetch(base) .then(r => r.json()) .then(data => { isFiltering = true; redactions = data; }).catch(err => ShowFeedback('error', 'Filter operation failed')) }, clearFilter(){ this.actionSearch = ''; this.fieldPathSearch = ''; this.whenFilter = ''; isFiltering = false; fetchAll(); }, checkDirty(){ this.isFilterable = ( this.actionSearch !== '' || this.fieldPathSearch !== '' || this.whenFilter !== '' ); return this.isFilterable; }, removeRedaction(id){ if(!confirm('Remove this redaction?')) return; fetch(`/v1/redactions/${id}`, { method: 'DELETE' }) .then(r => r.json()) .then(() => { ShowFeedback('success', 'Redaction removed'); fetchAll(); }) .catch(() => ShowFeedback('error', 'Failed to remove redaction')) } } {% endmacro %} {% block easel %}
bolt
route
ID Action Field Path Timestamp
{{ pagination() }}
{% endblock %} {% block wizard %} {% endblock %}