2009-02-07 21:50:40 +01:00
|
|
|
module NavigationHelper
|
|
|
|
def link_back_to_messages
|
|
|
|
link_to("«" << _('Back to messages'), :controller=>"webmail", :action=>"messages")
|
|
|
|
end
|
|
|
|
|
|
|
|
def link_send_mail
|
|
|
|
link_to(_('Compose'), :controller=>"webmail", :action=>"compose")
|
|
|
|
end
|
|
|
|
|
|
|
|
def link_mail_prefs
|
|
|
|
link_to(_('Preferences'), :controller=>"webmail", :action=>"prefs")
|
|
|
|
end
|
|
|
|
|
|
|
|
def link_mail_filters
|
|
|
|
link_to(_('Filters'), :controller=>"webmail", :action=>"filters")
|
|
|
|
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-02-07 22:22:25 +01:00
|
|
|
short_fn(folder) + ' ' + link_to(_('Delete'), folder_path(folder.name), :method => :delete)
|
2009-02-07 21:50:40 +01:00
|
|
|
end
|
|
|
|
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
|
|
|
|
" " + folder.name.split(folder.delim).last
|
|
|
|
else
|
|
|
|
folder.name
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|