Permalink
Browse files

Reorganize email helpers

  • Loading branch information...
1 parent 5fd15e7 commit 7d7b9e40d2bf601038abc497a411913fd6ff9c68 @riyad committed Mar 15, 2012
Showing with 12 additions and 12 deletions.
  1. +12 −12 app/helpers/email_helper.rb
@@ -7,27 +7,27 @@ def admin_badge(email)
image_tag("email-is-admin.png") if email.admin?
end
- def get_email_prefix(email)
- email.sub(/@.*/,"")
+ def expiration_date_for(email)
+ image_tag("email-expires-on.png") + l(email.expires_on) if email.expires_on
end
def forwards_badge(email)
image_tag("email-forwards.png")+content_tag(:span, email.forwards.count, :class => "label label-info") unless email.forwards.empty?
end
-
- def can_receive(email)
- content_tag(:span, "R", :class => "label label-info") if email.can_receive
+
+ def maildir_for(email)
+ email.email_path || File.join(APP_CONFIG["email_default_save_path"], email.email || "")
end
-
- def can_send(email)
- content_tag(:span, "S", :class => "label label-info") if email.can_send
+
+ def prefix_for(email)
+ email.split("@").first
end
- def get_expire_date(email)
- email.expires_on ? email.expires_on : APP_CONFIG["email_default_expires_in"].days.from_now.to_date
+ def receive_badge(email)
+ image_tag("email-can-receive.png") if email.can_receive?
end
- def get_email_path(email)
- email.email_path ? email.email_path : APP_CONFIG["email_default_save_path"]
+ def send_badge(email)
+ image_tag("email-can-send.png") if email.can_send?
end
end

0 comments on commit 7d7b9e4

Please sign in to comment.