Class: Decidim::Notify::NoteCell

Inherits:
ViewModel
  • Object
show all
Includes:
LayoutHelper
Defined in:
app/cells/decidim/notify/note_cell.rb

Overview

This cell renders the card for an instance of a Notify Participant

Instance Method Summary collapse

Instance Method Details

#edit_pathObject



33
34
35
# File 'app/cells/decidim/notify/note_cell.rb', line 33

def edit_path
  EngineRouter.main_proxy(model.component).conversation_path(model.id)
end

#note_author_classObject



27
28
29
30
31
# File 'app/cells/decidim/notify/note_cell.rb', line 27

def note_author_class
  return "by-note-taker" if author&.admin

  "by-participant"
end

#note_taker?Boolean

Returns:

  • (Boolean)


21
22
23
24
25
# File 'app/cells/decidim/notify/note_cell.rb', line 21

def note_taker?
  return unless current_user

  Author.for(model.component).note_takers.find_by(user: current_user)
end

#notify_authorObject



17
18
19
# File 'app/cells/decidim/notify/note_cell.rb', line 17

def notify_author
  Author.find_by(user: model.author, component: model.component)
end