Commit 259a8bf623836b8ca65ee7416f657c98ac615cf9

Authored by Marius Hanne
1 parent 5ea780fc20
Exists in master

add filter operator

Showing 3 changed files with 11 additions and 1 deletions Side-by-side Diff

maildrop_serializer.rb
... ... @@ -31,7 +31,7 @@
31 31 fe = ""
32 32 for exp in filter.expressions
33 33 post_flag = "h"
34   - fe << " && " unless fe == ""
  34 + fe << " #{filter.operator} " unless fe == ""
35 35 if exp.field_name == "Body"
36 36 fe << "/"
37 37 post_flag = "b"
... ... @@ -79,6 +79,7 @@
79 79 t.string :name
80 80 t.string :destination_folder
81 81 t.string :filters
  82 + t.string :operator
82 83 t.integer :order_num
83 84 t.timestamps
84 85 end
... ... @@ -17,6 +17,12 @@
17 17 - folders.each do |folder|
18 18 = option(folder, folder, folder == @filter.destination_folder)
19 19 %a.add_folder_link{:href => "#"} Add
  20 + %div
  21 + %label{:for => "filter[operator]"}
  22 + Operator
  23 + %select.operator{:name => "filter[operator]"}
  24 + %option{:value => "&&"} AND
  25 + %option{:value => "||"} OR
20 26 %label{:for => "expressions"}
21 27 Expressions:
22 28 %div#expressions.value