Sha256: 03d1fa8e172527571ba1fd9f884f14be9800a96b09447f0ddfc7fcc4bac7f11a

Contents?: true

Size: 687 Bytes

Versions: 16

Compression:

Stored size: 687 Bytes

Contents

module WithStudentPathNavigation
  def next_button(navigable)
    return unless navigable
    navigation_flows.lazy.map { |it| it.new(self).button(navigable) }.find(&:present?)
  end

  def next_lesson_button(guide)
    next_button(guide.lesson) || chapter_finished(guide.chapter)
  end

  def next_exercise_button(exercise)
    next_button(exercise) || next_button(exercise.guide.lesson) if show_content_element?
  end

  def close_modal_button
    %Q{<button class="btn btn-complementary w-100 mu-close-modal">#{t :keep_learning}</button>}.html_safe
  end

  private

  def navigation_flows
    [ContinueNavigation, RevisitNavigation, NextParentNavigation, FinishNavigation]
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
mumuki-laboratory-9.23.0 app/helpers/concerns/with_student_path_navigation.rb
mumuki-laboratory-9.22.0 app/helpers/concerns/with_student_path_navigation.rb
mumuki-laboratory-9.21.0 app/helpers/concerns/with_student_path_navigation.rb
mumuki-laboratory-9.20.1 app/helpers/concerns/with_student_path_navigation.rb
mumuki-laboratory-9.20.0 app/helpers/concerns/with_student_path_navigation.rb
mumuki-laboratory-9.19.0 app/helpers/concerns/with_student_path_navigation.rb
mumuki-laboratory-9.18.1 app/helpers/concerns/with_student_path_navigation.rb
mumuki-laboratory-9.18.0 app/helpers/concerns/with_student_path_navigation.rb
mumuki-laboratory-9.17.0 app/helpers/concerns/with_student_path_navigation.rb
mumuki-laboratory-9.16.0 app/helpers/concerns/with_student_path_navigation.rb
mumuki-laboratory-9.15.0 app/helpers/concerns/with_student_path_navigation.rb
mumuki-laboratory-9.14.1 app/helpers/concerns/with_student_path_navigation.rb
mumuki-laboratory-9.14.0 app/helpers/concerns/with_student_path_navigation.rb
mumuki-laboratory-9.13.2 app/helpers/concerns/with_student_path_navigation.rb
mumuki-laboratory-9.13.1 app/helpers/concerns/with_student_path_navigation.rb
mumuki-laboratory-9.13.0 app/helpers/concerns/with_student_path_navigation.rb