Sha256: 3819e48c45225ede7455c3c479e6a2196868bd35ef24f29908bef1d851b49fac

Contents?: true

Size: 1.71 KB

Versions: 37

Compression:

Stored size: 1.71 KB

Contents

module ThinkFeelDoEngine
  module Coach
    # Displays navigational information in the form of breadcrumbs
    module PatientDashboardHelper
      VISUALIZATION_CONTROLLERS = [
        "participant_activities_visualizations",
        "participant_thoughts_visualizations"
      ]

      def breadcrumbs
        return unless VISUALIZATION_CONTROLLERS.include?(controller_name)

        dashboard_path = coach_group_patient_dashboard_path(
          @participant.active_group,
          @participant
        )

        content_for(
          :breadcrumbs,
          content_tag(
            :ol,
            content_tag(
              :li,
              link_to("Patient Dashboard", dashboard_path)
            ),
            class: "breadcrumb"
          )
        )
      end

      def activities_planned_today(participant)
        participant
          .activities.planned.created_for_day(Date.today).count +
          participant
            .activities
            .reviewed_and_complete.created_for_day(Date.today).count +
          participant
            .activities
            .reviewed_and_incomplete.created_for_day(Date.today).count
      end

      def activities_planned_7_day(participant)
        participant.activities
          .planned.created_last_seven_days.count +
          participant.activities
            .reviewed_and_complete.created_last_seven_days.count +
          participant.activities
            .reviewed_and_incomplete.created_last_seven_days.count
      end

      def activities_planned_total(participant)
        participant.activities.planned.count +
          participant.activities.reviewed_and_complete.count +
          participant.activities.reviewed_and_incomplete.count
      end
    end
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
think_feel_do_engine-3.12.9 app/helpers/think_feel_do_engine/coach/patient_dashboard_helper.rb
think_feel_do_engine-3.12.8 app/helpers/think_feel_do_engine/coach/patient_dashboard_helper.rb
think_feel_do_engine-3.12.7 app/helpers/think_feel_do_engine/coach/patient_dashboard_helper.rb
think_feel_do_engine-3.12.6 app/helpers/think_feel_do_engine/coach/patient_dashboard_helper.rb
think_feel_do_engine-3.12.5 app/helpers/think_feel_do_engine/coach/patient_dashboard_helper.rb
think_feel_do_engine-3.12.4 app/helpers/think_feel_do_engine/coach/patient_dashboard_helper.rb
think_feel_do_engine-3.12.3 app/helpers/think_feel_do_engine/coach/patient_dashboard_helper.rb
think_feel_do_engine-3.12.2 app/helpers/think_feel_do_engine/coach/patient_dashboard_helper.rb
think_feel_do_engine-3.12.1 app/helpers/think_feel_do_engine/coach/patient_dashboard_helper.rb
think_feel_do_engine-3.12.0 app/helpers/think_feel_do_engine/coach/patient_dashboard_helper.rb
think_feel_do_engine-3.11.3 app/helpers/think_feel_do_engine/coach/patient_dashboard_helper.rb
think_feel_do_engine-3.11.0 app/helpers/think_feel_do_engine/coach/patient_dashboard_helper.rb
think_feel_do_engine-3.10.10 app/helpers/think_feel_do_engine/coach/patient_dashboard_helper.rb
think_feel_do_engine-3.10.9 app/helpers/think_feel_do_engine/coach/patient_dashboard_helper.rb
think_feel_do_engine-3.10.8 app/helpers/think_feel_do_engine/coach/patient_dashboard_helper.rb
think_feel_do_engine-3.10.7 app/helpers/think_feel_do_engine/coach/patient_dashboard_helper.rb
think_feel_do_engine-3.10.6 app/helpers/think_feel_do_engine/coach/patient_dashboard_helper.rb