2007-03-30 04:36:52 +00:00
|
|
|
module NotesHelper
|
|
|
|
def truncated_note(note, characters = 50)
|
2015-04-03 12:13:21 +01:00
|
|
|
render_text(truncate(note.body, :length => characters, :omission => "..."))
|
2007-03-30 04:36:52 +00:00
|
|
|
end
|
2010-04-02 09:14:25 -04:00
|
|
|
|
|
|
|
def rendered_note(note)
|
2015-04-03 12:13:21 +01:00
|
|
|
render_text(note.body)
|
2010-04-02 09:14:25 -04:00
|
|
|
end
|
2011-02-09 20:41:34 +01:00
|
|
|
|
|
|
|
def link_to_delete_note(note, descriptor = sanitize(note.id.to_s))
|
|
|
|
link_to(
|
|
|
|
descriptor,
|
|
|
|
note_path(note, :format => 'js'),
|
|
|
|
{:id => "delete_note_#{note.id}", :class => "delete_note_button",
|
|
|
|
:title => t('notes.delete_note_title', :id => note.id), :x_confirm_message => t('notes.delete_note_confirm', :id => note.id)}
|
|
|
|
)
|
|
|
|
end
|
|
|
|
|
2007-03-30 04:36:52 +00:00
|
|
|
end
|