module FormHelper
  def possible_read_only_ops(submission=nil)
    ops = {}

    if admin_in_read_only_mode? || (submission && !current_user.account_admin?) || submission_ended?
      ops[:disabled] = "disabled"
      ops[:class] = "read-only"
    end

    ops
  end

  def next_step(form, step)
    return unless step

    steps = form.steps
    steps.map! { |s| s.title.parameterize }

    index = steps.index(step)

    steps[index + 1]
  end

  def text_words_count(text)
    text.to_s.split.count
  end
end

module FormHelper
  def possible_read_only_ops
    ops = {}

    if admin_in_read_only_mode? || submission_ended?
      ops[:disabled] = "disabled"
      ops[:class] = "read-only"
    end

    ops
  end

  def next_step(form, step)
    return unless step

    steps = form.steps
    steps.map! { |s| s.title.parameterize }

    index = steps.index(step)

    steps[index + 1]
  end

  def text_words_count(text)
    text.to_s.split.count
  end
end

Revert "[QAE1019] Fixed disabled submission conditions"
Revert "[QAE1019] Fixed disabled submission conditions"

This reverts commit a280f05838e24d569215bb85f8ef9d5f6cf2e393.

Conflicts:
	app/helpers/form_helper.rb
	app/views/qae_form/_form_footer.html.slim
