sogo/UI/Templates/PreferencesUI/UIxFilterEditor.wox

139 lines
5.2 KiB
XML

<?xml version="1.0" standalone="yes"?>
<!DOCTYPE var:component>
<var:component
xmlns="http://www.w3.org/1999/xhtml"
xmlns:var="http://www.skyrix.com/od/binding"
xmlns:const="http://www.skyrix.com/od/constant"
xmlns:uix="OGo:uix"
xmlns:rsrc="OGo:url"
xmlns:label="OGo:label"
className="UIxPageFrame"
>
<md-dialog>
<md-dialog-content>
<script type="text/javascript">
var filterId = '<var:string value="filterId"/>';
var sieveFolderEncoding = '<var:string value="sieveFolderEncoding"/>';
var mailTags = <var:string value="labels" const:escapeHTML="NO"/>;
</script>
<form id="mainForm" var:href="ownPath">
<div id="filterNameContainer" class="container">
<md-input-container>
<label><var:string label:value="Filter name:"/></label>
<input const:name="filterName" type="text" ng-model="filter.name"/>
</md-input-container>
</div>
<div id="filterMatchContainer" class="container">
<var:string label:value="For incoming messages that"/>
<md-select const:name="matchType" const:id="matchType" ng-model="filter.match">
<md-option const:value="all">
<var:string label:value="match all of the following rules:"/>
</md-option>
<md-option const:value="any">
<var:string label:value="match any of the following rules:"/>
</md-option>
<md-option const:value="allmessages">
<var:string label:value="match all messages"/>
</md-option>
</md-select>
</div>
<!-- CONDITIONS -->
<div id="filterRulesContainer" class="container">
<div id="filterRules"><!-- empty -->
<md-list>
<md-list-item ng-repeat="rule in filter.rules">
<md-select ng-model="rule.field">
<md-option ng-value="key" ng-repeat="(key, value) in fieldLabels">{{ value }}</md-option>
</md-select>
<input type="text" ng-show="rule.field ==
'header'" ng-model="rule.custom_header"/>
<md-select ng-show="rule.field =='size'" ng-model="rule.operator">
<md-option ng-value="key" ng-repeat="(key, value) in numberOperatorLabels">
{{ value }}
</md-option>
</md-select>
<md-select ng-show="rule.field !='size'" ng-model="rule.operator">
<md-option ng-value="key" ng-repeat="(key, value) in textOperatorLabels">
{{ value }}
</md-option>
</md-select>
<input type="text" ng-model="rule.value"/>
<md-button ng-click="removeMailFilterRule($index)" type="button">
<div class="md-icon-remove"><!-- delete --></div>
</md-button>
</md-list-item>
</md-list>
</div>
<md-button ng-click="addMailFilterRule($event)" type="button">
<div class="md-icon-add"><!-- create --></div>
</md-button>
</div>
<!-- ACTIONS -->
<div id="filterActionsContainer" class="container">
<var:string label:value="Perform these actions:"/><br/>
<div id="filterActions"><!-- empty --></div>
<md-list>
<md-list-item ng-repeat="action in filter.actions">
<md-select ng-model="action.method">
<md-option ng-value="key" ng-repeat="(key, value) in methodLabels">{{ value }}</md-option>
</md-select>
<!-- FORWARD MESSAGE TO -->
<input type="text" ng-show="action.method == 'redirect'" ng-model="action.argument"/>
<!-- DISCARD -->
<!-- nada -->
<!-- KEEP -->
<!-- nada -->
<!-- SEND REJECT MESSAGE -->
<input type="text" ng-show="action.method == 'reject'" ng-model="action.argument"/>
<!-- FILE INTO -->
<md-select ng-show="action.method == 'fileinto'" ng-model="action.argument">
<md-option ng-value="item.path" ng-repeat="item in mailboxes">
{{ item.name }}
</md-option>
</md-select>
<!-- FLAG WITH -->
<md-select ng-show="action.method == 'addflag'" ng-model="action.argument" >
<md-option ng-value="key" ng-repeat="(key, value) in labels">{{ value[0] }}</md-option>
</md-select>
<!-- STOP -->
<!-- nada -->
<md-button ng-click="removeMailFilterAction($index)" type="button">
<div class="md-icon-remove"><!-- delete --></div>
</md-button>
</md-list-item>
</md-list>
<md-button ng-click="addMailFilterAction($event)" type="button">
<div class="md-icon-add"><!-- create --></div>
</md-button>
</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>
</form>
</md-dialog-content>
</md-dialog>
</var:component>