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() 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
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
2011-04-01 13:23:32 +02:00
folder.name.split(folder.delim).last
else
folder.name
end
end
end