mailr/app/helpers/navigation_helper.rb

61 lines
1.7 KiB
Ruby
Raw Normal View History

module NavigationHelper
def link_back_to_messages
2009-09-01 16:10:46 +02:00
link_to("&#171;" << t(:back_to_message), :controller=>"webmail", :action=>"messages")
end
def link_send_mail
2009-09-01 14:23:05 +02:00
link_to( t(:compose), :controller=>"webmail", :action=>"compose")
end
def link_mail_prefs
2009-09-01 14:23:05 +02:00
link_to( t(:preferences), :controller=>"webmail", :action=>"prefs")
end
def link_mail_filters
2009-09-01 14:23:05 +02:00
link_to( t(: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-09-01 16:10:46 +02:00
short_fn(folder) + '&nbsp;' + link_to(t(:delete), folder_path(folder.name), :method => :delete)
end
end
2009-02-08 16:00:26 +01:00
def link_import_preview() "/contacts/import_preview" end
def link_main_index() "/" end
def link_contact_import() "/contacts/import" end
def link_contact_choose() "/contacts/contact/choose" end
def link_contact_list
link_to(_('List'), :controller => "/contacts/contact", :action => "list")
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
2009-09-01 14:23:05 +02:00
link_to(t(:add_multiple), :controller => "/contacts/contact", :action => "add_multiple")
2009-02-08 16:00:26 +01:00
end
def link_contact_group_list
link_to(_('Groups'), :controller => "/contacts/contact_group", :action => "list")
end
def link_folders
2009-09-01 14:23:05 +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
def short_fn(folder)
if folder.name.include? folder.delim
"&nbsp; &nbsp;" + folder.name.split(folder.delim).last
else
folder.name
end
end
end