Sha256: e1f677a157e58c03929b7b5a065626b4d91e055fb12c84e2f59c12dc492bb33f
Contents?: true
Size: 1.61 KB
Versions: 26
Compression:
Stored size: 1.61 KB
Contents
module ContentProviders module CurrentModules # Provides a set of links to other ContentProviders. class IndexProvider < BitCore::ContentProvider def render_current(options) participant = options.participant context = options.view_context context.render( template: "think_feel_do_engine/current_modules/index", locals: { content_modules: content_modules(options), current_practice_modules: current_practice_modules(options), past_practice_modules: past_practice_modules(options), membership: context .view_membership(participant, participant.active_group) }) end def show_nav_link? false end private def content_modules(options) participant = options.participant arm_id = participant.active_group.arm_id tool = BitCore::Tool .find_by_arm_id_and_title(arm_id, options.app_context) @content_modules ||= AvailableContentModule .for_participant(participant) .for_tool(tool) .available_by(Date.current) .excludes_module(bit_core_content_module_id) .latest_duplicate end def current_practice_modules(options) participant = options.participant content_modules(options) .for_current_week(participant.active_membership) end def past_practice_modules(options) participant = options.participant content_modules(options) .for_past_weeks(participant.active_membership) end end end end
Version data entries
26 entries across 26 versions & 1 rubygems