diff options
author | ivan <ivan> | 2010-04-27 10:58:18 +0000 |
---|---|---|
committer | ivan <ivan> | 2010-04-27 10:58:18 +0000 |
commit | dc3fc48e5104f649a4b11a8feb50b128e14f0bd9 (patch) | |
tree | e9d09ae8c51a2bc2777e6139956c806f6be28464 /httemplate/elements | |
parent | c8edb1e681cadff9a84572c4a6e3b16662f566cd (diff) |
communigate (phase 2): rules: start of adding conditions and actions to rule edit. RT#7514
Diffstat (limited to 'httemplate/elements')
-rw-r--r-- | httemplate/elements/select-cgp_rule_action.html | 1 | ||||
-rw-r--r-- | httemplate/elements/select-cgp_rule_condition.html | 63 | ||||
-rw-r--r-- | httemplate/elements/select.html | 1 | ||||
-rw-r--r-- | httemplate/elements/tr-select.html | 2 |
4 files changed, 64 insertions, 3 deletions
diff --git a/httemplate/elements/select-cgp_rule_action.html b/httemplate/elements/select-cgp_rule_action.html index b53a96e9e..24301b59b 100644 --- a/httemplate/elements/select-cgp_rule_action.html +++ b/httemplate/elements/select-cgp_rule_action.html @@ -17,7 +17,6 @@ <%init> my %opt = @_; -warn "SELECT-CGP_RULE-ACTION.HTML: ". join ' / ', %opt; my @actions = ( '', diff --git a/httemplate/elements/select-cgp_rule_condition.html b/httemplate/elements/select-cgp_rule_condition.html new file mode 100644 index 000000000..1ce85bdb6 --- /dev/null +++ b/httemplate/elements/select-cgp_rule_condition.html @@ -0,0 +1,63 @@ +<% include( 'select.html', + %opt, + 'options' => \@conditions, #reverse order if we ever need to spec + 'labels' => { '' => 'Select Condition' }, + ) +%> +<% include( 'select.html', + 'name' => $opt{'field'}.'_op', + 'id' => ($opt{'field'}||$opt{'id'}).'_op', + 'options' => \@myop, + ) +%> +<% include( 'input-text.html', + 'name' => $opt{'field'}.'_params', + #XXX curr value... anything else? + ) +%> +<%init> + +my %opt = @_; + +my @conditions = ( + '', + 'From', + 'Sender', + 'To', + 'Cc', + 'Reply-To', + 'Any To or Cc', + 'Each To or Cc', + 'Return-Path', + "'From' Name", + 'Subject', + 'Message-ID', + 'Message Size', + 'Human Generated', + 'Header Field', + 'Any Recipient', + 'Each Recipient', + 'Source', + 'Security', + 'Any Route', + 'Each Route' +); + +my %bool = ( + 'Human Generated' => 1, +); + +my %number = ( + 'Message Size' => 1, +); + +#XXX curr value -> hidden op / param / param selects depending + +my @op = ( 'is', 'is not', 'in', 'not in' ); +my @op_number = ( 'is', 'is_not', 'less than', 'greater than' ); + +my @myop = @op; #XXX $number{$curr_value} ? @op_number : @op; +#XXX and a fancy onchange handler... yes. +#XXX (and for total hiding of the %bool one) + +</%init> diff --git a/httemplate/elements/select.html b/httemplate/elements/select.html index 7aa4180b6..268e0d243 100644 --- a/httemplate/elements/select.html +++ b/httemplate/elements/select.html @@ -42,7 +42,6 @@ <%init> my %opt = @_; -warn "SELECT.HTML: ". join ' / ', %opt; my $onchange = $opt{'onchange'} ? 'onChange="'. $opt{'onchange'}. '(this)"' diff --git a/httemplate/elements/tr-select.html b/httemplate/elements/tr-select.html index f9c768c60..cf1b3cc60 100644 --- a/httemplate/elements/tr-select.html +++ b/httemplate/elements/tr-select.html @@ -14,7 +14,7 @@ <%init> my %opt = @_; -warn join ' / ', %opt; + my $style = $opt{'cell_style'} ? 'STYLE="'. $opt{'cell_style'}. '"' : ''; my $colspan = $opt{'colspan'} ? 'COLSPAN="'.$opt{'colspan'}.'"' : ''; |