This commit is contained in:
Ludovic Marcotte 2015-08-17 16:22:41 -04:00
commit 2e736490d5
2 changed files with 725 additions and 676 deletions

View file

@ -7,23 +7,27 @@
xmlns:label="OGo:label" xmlns:label="OGo:label"
xmlns:rsrc="OGo:url" xmlns:rsrc="OGo:url"
xmlns:uix="OGo:uix"><var:string var:value="doctype" const:escapeHTML="NO" /> xmlns:uix="OGo:uix"><var:string var:value="doctype" const:escapeHTML="NO" />
<md-dialog flex="50"> <md-dialog flex="50">
<form id="mainForm" var:href="ownPath">
<md-dialog-content> <md-dialog-content>
<script type="text/javascript"> <script type="text/javascript">
var filterId = '<var:string value="filterId"/>'; var filterId = '<var:string value="filterId"/>';
var sieveFolderEncoding = '<var:string value="sieveFolderEncoding"/>'; var sieveFolderEncoding = '<var:string value="sieveFolderEncoding"/>';
var mailTags = <var:string value="labels" const:escapeHTML="NO"/>; var mailTags = <var:string value="labels" const:escapeHTML="NO"/>;
</script> </script>
<form id="mainForm" var:href="ownPath"> <div id="filterNameContainer" class="container">
<div id="filterNameContainer" class="container"> <md-input-container>
<md-input-container> <label><var:string label:value="Filter name:"/></label>
<label><var:string label:value="Filter name:"/></label> <input const:name="filterName" type="text" ng-model="filter.name" required="required"/>
<input const:name="filterName" type="text" ng-model="filter.name"/> </md-input-container>
</md-input-container> </div>
</div>
<div id="filterMatchContainer" class="container"> <div class="sg-padded"><var:entity const:name="nbsp"/></div>
<var:string label:value="For incoming messages that"/>
<md-select const:name="matchType" const:id="matchType" ng-model="filter.match"> <div layout="row" layout-align="start center">
<div><var:string label:value="For incoming messages that"/></div>
<md-input-container class="md-flex">
<md-select ng-model="filter.match" required="required">
<md-option const:value="all"> <md-option const:value="all">
<var:string label:value="match all of the following rules:"/> <var:string label:value="match all of the following rules:"/>
</md-option> </md-option>
@ -34,107 +38,130 @@
<var:string label:value="match all messages"/> <var:string label:value="match all messages"/>
</md-option> </md-option>
</md-select> </md-select>
</div> </md-input-container>
</div>
<!-- CONDITIONS --> <!-- CONDITIONS -->
<div id="filterRulesContainer" class="container"> <div layout="column">
<div id="filterRules"><!-- empty --> <div id="filterRules"><!-- empty -->
<md-list> <md-list>
<md-list-item ng-repeat="rule in filter.rules"> <md-list-item ng-repeat="rule in filter.rules">
<md-input-container flex="25">
<md-select ng-model="rule.field"> <md-select ng-model="rule.field">
<md-option ng-value="key" ng-repeat="(key, value) in fieldLabels">{{ value }}</md-option> <md-option ng-value="key" ng-repeat="(key, value) in fieldLabels">{{ value }}</md-option>
</md-select> </md-select>
</md-input-container>
<input type="text" ng-show="rule.field == <md-input-container flex="25" ng-show="rule.field == 'header'">
'header'" ng-model="rule.custom_header"/> <input type="text" ng-model="rule.custom_header"/>
</md-input-container>
<md-select ng-show="rule.field =='size'" ng-model="rule.operator"> <md-input-container flex="25" ng-show="rule.field == 'size'">
<md-select ng-model="rule.operator">
<md-option ng-value="key" ng-repeat="(key, value) in numberOperatorLabels"> <md-option ng-value="key" ng-repeat="(key, value) in numberOperatorLabels">
{{ value }} {{ value }}
</md-option> </md-option>
</md-select> </md-select>
</md-input-container>
<md-select ng-show="rule.field !='size'" ng-model="rule.operator"> <md-input-container flex="25" ng-show="rule.field != 'size'">
<md-select ng-model="rule.operator">
<md-option ng-value="key" ng-repeat="(key, value) in textOperatorLabels"> <md-option ng-value="key" ng-repeat="(key, value) in textOperatorLabels">
{{ value }} {{ value }}
</md-option> </md-option>
</md-select> </md-select>
</md-input-container>
<md-input-container class="md-flex">
<input type="text" ng-model="rule.value"/> <input type="text" ng-model="rule.value"/>
</md-input-container>
<md-button class="sg-icon-button" type="button" <md-button class="sg-icon-button" type="button"
ng-click="removeMailFilterRule($index)"> ng-click="removeMailFilterRule($index)">
<md-icon>remove</md-icon> <md-icon>remove_circle</md-icon>
</md-button> </md-button>
</md-list-item> </md-list-item>
</md-list> </md-list>
</div>
<md-button class="sg-icon-button" type="button"
ng-click="addMailFilterRule($event)">
<md-icon>add</md-icon>
</md-button>
</div> </div>
<!-- ACTIONS --> <div layout="row" layout-align="end center">
<div id="filterActionsContainer" class="container"> <md-button class="sg-icon-button" type="button"
<var:string label:value="Perform these actions:"/><br/> ng-click="addMailFilterRule($event)">
<div id="filterActions"><!-- empty --></div> <md-icon>add_circle</md-icon>
</md-button>
</div>
</div>
<md-list> <!-- ACTIONS -->
<md-list-item ng-repeat="action in filter.actions"> <div layout="column">
<var:string label:value="Perform these actions:"/>
<div id="filterActions"><!-- empty --></div>
<md-list>
<md-list-item layout="row" layout-align="space-between center"
ng-repeat="action in filter.actions">
<md-input-container>
<md-select ng-model="action.method"> <md-select ng-model="action.method">
<md-option ng-value="key" ng-repeat="(key, value) in methodLabels">{{ value }}</md-option> <md-option ng-value="key" ng-repeat="(key, value) in methodLabels">{{ value }}</md-option>
</md-select> </md-select>
</md-input-container>
<!-- FORWARD MESSAGE TO --> <!-- FORWARD MESSAGE TO -->
<input type="text" ng-show="action.method == 'redirect'" ng-model="action.argument"/> <md-input-container ng-show="action.method == 'redirect'" >
<input type="text" ng-model="action.argument"/>
</md-input-container>
<!-- DISCARD --> <!-- DISCARD -->
<!-- nada --> <!-- nada -->
<!-- KEEP --> <!-- KEEP -->
<!-- nada --> <!-- nada -->
<!-- SEND REJECT MESSAGE --> <!-- SEND REJECT MESSAGE -->
<input type="text" ng-show="action.method == 'reject'" ng-model="action.argument"/> <md-input-container ng-show="action.method == 'reject'">
<input type="text" ng-model="action.argument"/>
</md-input-container>
<!-- FILE INTO --> <!-- FILE INTO -->
<md-select ng-show="action.method == 'fileinto'" ng-model="action.argument"> <md-input-container ng-show="action.method == 'fileinto'" >
<md-select ng-model="action.argument">
<md-option ng-value="item.path" ng-repeat="item in mailboxes"> <md-option ng-value="item.path" ng-repeat="item in mailboxes">
{{ item.name }} {{ item.name }}
</md-option> </md-option>
</md-select> </md-select>
</md-input-container>
<!-- FLAG WITH --> <!-- FLAG WITH -->
<md-select ng-show="action.method == 'addflag'" ng-model="action.argument" > <md-input-container ng-show="action.method == 'addflag'" >
<md-select ng-model="action.argument" >
<md-option ng-value="key" ng-repeat="(key, value) in labels">{{ value[0] }}</md-option> <md-option ng-value="key" ng-repeat="(key, value) in labels">{{ value[0] }}</md-option>
</md-select> </md-select>
</md-input-container>
<!-- STOP --> <!-- STOP -->
<!-- nada --> <!-- nada -->
<md-button class="sg-icon-button" type="button"
<md-button class="sg-icon-button" type="button" ng-click="removeMailFilterAction($index)">
ng-click="removeMailFilterAction($index)"> <md-icon>remove_circle</md-icon>
<md-icon>remove</md-icon> </md-button>
</md-button>
</md-list-item> </md-list-item>
</md-list> </md-list>
<div layout="row" layout-align="end center">
<md-button class="sg-icon-button" type="button" <md-button class="sg-icon-button" type="button"
ng-click="addMailFilterAction($event)"> ng-click="addMailFilterAction($event)">
<md-icon>add</md-icon> <md-icon>add_circle</md-icon>
</md-button> </md-button>
</div> </div>
<div class="md-actions" layout="row">
<md-button type="button" ng-click="cancel()">Cancel</md-button>
<md-button type="button" class="md-primary" ng-click="save()">Save</md-button>
</div> </div>
</form> </md-dialog-content>
</md-dialog-content> <div class="md-actions">
<md-button type="button" ng-click="cancel()"><var:string label:value="Cancel"/></md-button>
<md-button type="button" ng-click="save()"><var:string label:value="Save"/></md-button>
</div>
</form>
</md-dialog> </md-dialog>
</container> </container>

File diff suppressed because it is too large Load diff