Commit 583d0993dd4ff19d5bd6511d64062fe041945842

Authored by Niklas
1 parent 9976bd4dea
Exists in master

custom folders

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

... ... @@ -19,8 +19,6 @@
19 19 before do
20 20 unless env['PATH_INFO'] =~ /^\/login/ || session[:user]
21 21 redirect '/login'
22   - # session[:user] = "test@sourceagency.org"
23   - # session[:pass] = "password"
24 22 end
25 23 end
26 24  
public/javascripts/app.js
... ... @@ -17,6 +17,13 @@
17 17 $(this).parent().remove();
18 18 return false;
19 19 });
  20 + $('a.add_folder_link').click(function() {
  21 + var folder = prompt("Enter folder name. It will be prefixed with 'INBOX.' automatically. The folder will be created once a matching message arrives.");
  22 + if(folder) {
  23 + folder = "INBOX."+folder;
  24 + $("select.destination_folder").append($("<option value=\""+folder+"\" selected>"+folder+"</option>"));
  25 + }
  26 + });
20 27 });
21 28 })(jQuery);
... ... @@ -13,9 +13,10 @@
13 13 %label{:for => "filter[destination_folder]"}
14 14 Destination Folder
15 15 - # %input{:type => "text", :name => "filter[destination_folder]", :value => @filter.destination_folder}
16   - %select{:name => "filter[destination_folder]"}
  16 + %select.destination_folder{:name => "filter[destination_folder]"}
17 17 - folders.each do |folder|
18 18 = option(folder, folder, folder == @filter.destination_folder)
  19 + %a.add_folder_link{:href => "#"} Add
19 20 %label{:for => "expressions"}
20 21 Expressions:
21 22 %div#expressions.value