summaryrefslogtreecommitdiff
path: root/httemplate/elements/select-cgp_rule_condition.html
blob: 1ce85bdb63c117edd28da2c00d514d14d7c6ace5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
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>