updating notification views

This commit is contained in:
maxwell 2010-12-16 18:06:59 -08:00
parent bd64cb723f
commit b8a0abd122
3 changed files with 10 additions and 22 deletions

View file

@ -1,21 +1,14 @@
module NotificationsHelper
def glue_text(kind)
translation = "notifications.#{kind.underscore}_glue"
t(translation)
end
def object_link(note)
kind = note.kind.underscore
translation = t("notifications.#{kind.underscore}_link")
kind = note.kind
translation = t("notifications.#{kind}")
case kind
when 'request'
link_to translation, aspects_manage_path
when 'status_message'
link_to translation, status_message_path(note.object_id)
when 'comment'
when 'request_accepted'
translation
when 'new_request'
translation
when 'comment_on_post'
link_to translation, object_path(Comment.first(:id => object_id).post)
when 'photo'
link_to translation, photo_path(note.object_id)
else
end
end

View file

@ -2,5 +2,4 @@
- @notifications.each do |note|
%li
= link_to "#{note.person.name.titleize}", person_path(note.person)
= glue_text(note.kind)
= object_link(note)

View file

@ -179,13 +179,9 @@ en:
confirm_remove_aspect: "Are you sure you want to delete this aspect?"
add_existing: "Add an existing contact"
notifications:
status_message_glue: "posted a new"
status_message_link: "message"
request_glue: "sent you a contact request"
request_link: "request"
comment_glue: "commented on your"
comment_link: "post"
also_commnet_glue: "commented on your contact's"
request_accepted: "accepted your share request."
new_request: "offered to share with you."
comment_on_post: "commented on your post"
users:
edit:
export_data: "Export Data"