2009-02-07 21:50:40 +01:00
|
|
|
module NavigationHelper
|
|
|
|
def link_back_to_messages
|
2009-09-01 16:10:46 +02:00
|
|
|
link_to("«" << t(:back_to_message), :controller=>"webmail", :action=>"messages")
|
2009-02-07 21:50:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def link_send_mail
|
2009-09-01 14:23:05 +02:00
|
|
|
link_to( t(:compose), :controller=>"webmail", :action=>"compose")
|
2009-02-07 21:50:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def link_mail_prefs
|
2009-09-01 14:23:05 +02:00
|
|
|
link_to( t(:preferences), :controller=>"webmail", :action=>"prefs")
|
2009-02-07 21:50:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def link_mail_filters
|
2009-09-01 14:23:05 +02:00
|
|
|
link_to( t(:filters), :controller=>"webmail", :action=>"filters")
|
2009-02-07 21:50:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def folder_manage_link(folder)
|
|
|
|
if folder.name == CDF::CONFIG[:mail_trash] or folder.name == CDF::CONFIG[:mail_inbox] or folder.name == CDF::CONFIG[:mail_sent]
|
|
|
|
short_fn(folder)
|
|
|
|
else
|
2009-09-01 16:10:46 +02:00
|
|
|
short_fn(folder) + ' ' + link_to(t(:delete), folder_path(folder.name), :method => :delete)
|
2009-02-07 21:50:40 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2009-02-08 16:00:26 +01:00
|
|
|
def link_import_preview() "/contacts/import_preview" end
|
2011-03-29 02:59:28 +02:00
|
|
|
def link_main_index() root_url end
|
2011-03-31 22:59:22 +02:00
|
|
|
def link_contact_import() url_for(:controller => :contacts, :action => :import) end
|
|
|
|
def link_contact_choose() url_for(:controller => :contacts, :action => :choose) end
|
2009-02-08 16:00:26 +01:00
|
|
|
|
|
|
|
def link_contact_list
|
2011-03-31 22:59:22 +02:00
|
|
|
link_to(t(:list), :controller => :contacts, :action => :index)
|
2009-02-08 16:00:26 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def link_contact_add_one
|
2009-09-01 14:23:05 +02:00
|
|
|
link_to(t(:add_one_contact), new_contact_path)
|
2009-02-08 16:00:26 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def link_contact_add_multiple
|
2011-03-31 22:59:22 +02:00
|
|
|
link_to(t(:add_multiple), :controller => :contacts, :action => "add_multiple")
|
2009-02-08 16:00:26 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def link_contact_group_list
|
2011-03-31 22:59:22 +02:00
|
|
|
link_to(t(:groups), :controller => :contact_group, :action => :index)
|
2009-02-08 16:00:26 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def link_folders
|
2011-03-29 02:59:28 +02:00
|
|
|
link_to( t(:folders), :controller=>:webmail, :action=>:messages)
|
2009-02-08 16:00:26 +01:00
|
|
|
end
|
|
|
|
|
2009-02-07 22:22:25 +01:00
|
|
|
private
|
|
|
|
|
2009-02-07 21:50:40 +01:00
|
|
|
def short_fn(folder)
|
|
|
|
if folder.name.include? folder.delim
|
2011-04-01 13:23:32 +02:00
|
|
|
folder.name.split(folder.delim).last
|
2009-02-07 21:50:40 +01:00
|
|
|
else
|
|
|
|
folder.name
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|