Sha256: 771ee34f6257234082d01695ea3375cc2e9c2a65c259a1539717aa9c5f4be9d5

Contents?: true

Size: 662 Bytes

Versions: 23

Compression:

Stored size: 662 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)
  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

23 entries across 23 versions & 1 rubygems

Version Path
mumuki-laboratory-9.12.1 app/helpers/concerns/with_student_path_navigation.rb
mumuki-laboratory-9.12.0 app/helpers/concerns/with_student_path_navigation.rb
mumuki-laboratory-9.11.0 app/helpers/concerns/with_student_path_navigation.rb
mumuki-laboratory-9.10.0 app/helpers/concerns/with_student_path_navigation.rb
mumuki-laboratory-9.9.0 app/helpers/concerns/with_student_path_navigation.rb
mumuki-laboratory-9.8.2 app/helpers/concerns/with_student_path_navigation.rb
mumuki-laboratory-9.8.1 app/helpers/concerns/with_student_path_navigation.rb
mumuki-laboratory-9.8.0 app/helpers/concerns/with_student_path_navigation.rb
mumuki-laboratory-9.7.2 app/helpers/concerns/with_student_path_navigation.rb
mumuki-laboratory-9.7.1 app/helpers/concerns/with_student_path_navigation.rb
mumuki-laboratory-9.7.0 app/helpers/concerns/with_student_path_navigation.rb
mumuki-laboratory-9.6.0 app/helpers/concerns/with_student_path_navigation.rb
mumuki-laboratory-9.5.1 app/helpers/concerns/with_student_path_navigation.rb
mumuki-laboratory-9.5.0 app/helpers/concerns/with_student_path_navigation.rb
mumuki-laboratory-9.4.1 app/helpers/concerns/with_student_path_navigation.rb
mumuki-laboratory-9.4.0 app/helpers/concerns/with_student_path_navigation.rb
mumuki-laboratory-9.3.1 app/helpers/concerns/with_student_path_navigation.rb
mumuki-laboratory-9.3.0 app/helpers/concerns/with_student_path_navigation.rb
mumuki-laboratory-9.2.0 app/helpers/concerns/with_student_path_navigation.rb
mumuki-laboratory-9.1.3 app/helpers/concerns/with_student_path_navigation.rb