Class: Decidim::ReportingProposals::EditNoteModalCell

Inherits:
ViewModel
  • Object
show all
Includes:
ActionView::Helpers::FormOptionsHelper
Defined in:
app/cells/decidim/reporting_proposals/edit_note_modal_cell.rb

Instance Method Summary collapse

Instance Method Details



24
25
26
# File 'app/cells/decidim/reporting_proposals/edit_note_modal_cell.rb', line 24

def modal_id
  options[:modal_id] || "editNoteModal"
end

#noteObject



12
13
14
# File 'app/cells/decidim/reporting_proposals/edit_note_modal_cell.rb', line 12

def note
  model
end

#note_bodyObject



20
21
22
# File 'app/cells/decidim/reporting_proposals/edit_note_modal_cell.rb', line 20

def note_body
  model.body
end

#note_pathObject



32
33
34
# File 'app/cells/decidim/reporting_proposals/edit_note_modal_cell.rb', line 32

def note_path
  Decidim::ReportingProposals::AdminEngine.routes.url_helpers.proposal_note_path(proposal_id: proposal.id, id: note)
end

#notes_formObject



28
29
30
# File 'app/cells/decidim/reporting_proposals/edit_note_modal_cell.rb', line 28

def notes_form
  @notes_form = Decidim::Proposals::Admin::ProposalNoteForm.from_model(note)
end

#proposalObject



16
17
18
# File 'app/cells/decidim/reporting_proposals/edit_note_modal_cell.rb', line 16

def proposal
  Decidim::Proposals::Proposal.find(model.decidim_proposal_id)
end

#showObject



8
9
10
# File 'app/cells/decidim/reporting_proposals/edit_note_modal_cell.rb', line 8

def show
  render if note
end