cortex-cms/cortex

View on GitHub
app/views/cortex/content_items/_form.html.haml

Summary

Maintainability
Test Coverage
= form_for [@content_type, @content_item], html: { multipart: true } do |form|
  = form.hidden_field :creator_id, value: current_user.id
  = form.hidden_field :content_type_id, value: @content_type.id
  -# TODO: remove conditional once fields are properly converted to React
  -# if @content_type.name == 'Media'
    =# react_component('CortexApp', props: { temporary_render: 'Wizard' })
  -# else
  = cell(Cortex::WizardCell, @wizard, context: { content_item: @content_item, form: form }).()

  %footer.mdl-grid
    .mdl-cell.mdl-cell--12-col
      = form.button 'Save Now', value: @content_item.state || 'draft', name: 'content_item[state]', class: 'mdl-button form-button--submission mdl-js-button mdl-button--raised mdl-button--success mdl-js-ripple-effect', type: 'submit'
      = link_to 'Cancel', content_type_content_items_path(@content_type), class: 'mdl-button mdl-js-button mdl-button--cb mdl-js-ripple-effect'