Skip to content

Commit

Permalink
Helpers for shared/_record partial added
Browse files Browse the repository at this point in the history
  • Loading branch information
juarlex committed Oct 28, 2011
1 parent c40a414 commit e42fa71
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
12 changes: 12 additions & 0 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,16 @@ def image_for_person(record)
image_tag 'avatar_missing_icon.png'
end
end

def registered_by_info(record)
'Registrado por: ' + ( record.registered_by.nil? ? 'admin' : record.registered_by.friendly_email)
end

def modified_by_info(record)
'Modificado por: ' + record.modified_by.friendly_email unless record.modified_by.nil?
end

def updating_date(record)
'Fecha de actualización: ' + ( record.updated_on.to_s (:long)) if record.respond_to? :update_on
end
end
9 changes: 4 additions & 5 deletions app/views/shared/_record.html.haml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
%div{:class => 'span-23 last record_details' }
.record_details
%b= 'Información adicional'
%br
= registered_by_info(record)
%br
= 'Registrado por: ' + ( record.registered_by.nil? ? 'admin' : record.registered_by.friendly_email)
= modified_by_info(record)
%br
= 'Modificado por: ' + ( record.modified_by.nil? ? '' : record.modified_by.friendly_email)
%br
= 'Fecha de actualización: ' + ( record.updated_on.to_s (:long)) if record.respond_to? :update_on
= updating_date(record)

0 comments on commit e42fa71

Please sign in to comment.