think_feel_do_engine 3.15.7 → 3.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/controllers/think_feel_do_engine/coach/participant_activities_visualizations_controller.rb +8 -0
- data/app/controllers/think_feel_do_engine/coach/participant_thoughts_visualizations_controller.rb +8 -0
- data/app/helpers/think_feel_do_engine/coach/patient_dashboard_helper.rb +1 -1
- data/app/views/think_feel_do_engine/coach/patient_dashboards/_table_of_contents.html.erb +2 -2
- data/app/views/think_feel_do_engine/coach/patient_dashboards/show.html.erb +2 -2
- data/config/routes.rb +2 -2
- data/lib/think_feel_do_engine/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34d63772ced14e7d7761f7ba2c12d9d0b8766fcf
|
4
|
+
data.tar.gz: 5c384494bf24e725d4bf70583710dee49256bb64
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e807caf2b79b77bf1328bcf4d20f4a315a9fc6f0bd9af28608f16b5e6186d3758f7614ff954ab99d8a1048ed2434c62bd88dd3e6f8c559b42fa117ff79bdd29
|
7
|
+
data.tar.gz: 5f8bee00a72e0799bd89f76fe74de0b747326c13b17ac4949daa5914295a179da126f9d8dc7f4b48f014f766ccc32558b0ac4043bdff6cf4e6d5232b097ee4f5
|
data/app/controllers/think_feel_do_engine/coach/participant_activities_visualizations_controller.rb
CHANGED
@@ -5,6 +5,7 @@ module ThinkFeelDoEngine
|
|
5
5
|
# Present Participant Activities Visualization to the Coach.
|
6
6
|
class ParticipantActivitiesVisualizationsController < ApplicationController
|
7
7
|
before_action :authenticate_user!
|
8
|
+
rescue_from ActiveRecord::RecordNotFound, with: :record_not_found
|
8
9
|
|
9
10
|
RenderOptions = Struct.new(
|
10
11
|
:view_context, :app_context, :position, :participant
|
@@ -12,6 +13,7 @@ module ThinkFeelDoEngine
|
|
12
13
|
|
13
14
|
def show
|
14
15
|
@participant = Participant.find(params[:participant_id])
|
16
|
+
@group = @participant.groups.find(params[:group_id])
|
15
17
|
provider = ContentProviders::YourActivitiesProvider.new
|
16
18
|
options = RenderOptions.new(
|
17
19
|
self,
|
@@ -21,6 +23,12 @@ module ThinkFeelDoEngine
|
|
21
23
|
)
|
22
24
|
provider.render_current(options)
|
23
25
|
end
|
26
|
+
|
27
|
+
def record_not_found
|
28
|
+
redirect_to main_app.root_path,
|
29
|
+
alert: "The activities visualization you were "\
|
30
|
+
"looking does not exist."
|
31
|
+
end
|
24
32
|
end
|
25
33
|
end
|
26
34
|
end
|
data/app/controllers/think_feel_do_engine/coach/participant_thoughts_visualizations_controller.rb
CHANGED
@@ -5,13 +5,21 @@ module ThinkFeelDoEngine
|
|
5
5
|
# Present Participant Thoughts Visualization to the Coach.
|
6
6
|
class ParticipantThoughtsVisualizationsController < ApplicationController
|
7
7
|
before_action :authenticate_user!
|
8
|
+
rescue_from ActiveRecord::RecordNotFound, with: :record_not_found
|
8
9
|
|
9
10
|
def show
|
10
11
|
@participant = Participant.find(params[:participant_id])
|
12
|
+
@group = @participant.groups.find(params[:group_id])
|
11
13
|
thoughts = @participant.thoughts.harmful
|
12
14
|
render "think_feel_do_engine/thoughts/distortion_viz",
|
13
15
|
locals: { thoughts: thoughts, link_to_view: nil }
|
14
16
|
end
|
17
|
+
|
18
|
+
def record_not_found
|
19
|
+
redirect_to main_app.root_path,
|
20
|
+
alert: "The thoughts visualization you were "\
|
21
|
+
"looking does not exist."
|
22
|
+
end
|
15
23
|
end
|
16
24
|
end
|
17
25
|
end
|
@@ -10,10 +10,10 @@
|
|
10
10
|
<li class="list-group-item"><a href="#logins-container">Logins</a></li>
|
11
11
|
<li class="list-group-item"><a href="#lessons-container">Lessons</a></li>
|
12
12
|
<li class="list-group-item"><a href="#media-access-container">Audio Access</a></li>
|
13
|
-
<li class="list-group-item"><%= link_to "Activities visualization", coach_participant_activities_visualization_path(@participant) %></li>
|
13
|
+
<li class="list-group-item"><%= link_to "Activities visualization", coach_participant_activities_visualization_path(participant_id: @participant.id, group_id: @group.id) %></li>
|
14
14
|
<li class="list-group-item"><a href="#activities-future-container">Activities - Future</a></li>
|
15
15
|
<li class="list-group-item"><a href="#activities-past-container">Activities - Past</a></li>
|
16
|
-
<li class="list-group-item"><%= link_to "Thoughts visualization", coach_participant_thoughts_visualization_path(@participant) %></li>
|
16
|
+
<li class="list-group-item"><%= link_to "Thoughts visualization", coach_participant_thoughts_visualization_path(participant_id: @participant.id, group_id: @group.id) %></li>
|
17
17
|
<li class="list-group-item"><a href="#thoughts-container">Thoughts</a></li>
|
18
18
|
<li class="list-group-item"><a href="#messages-container">Messages</a></li>
|
19
19
|
<li class="list-group-item"><a href="#tasks-container">Tasks</a></li>
|
@@ -12,11 +12,11 @@
|
|
12
12
|
<%= render "think_feel_do_engine/coach/patient_dashboards/tables/lessons_table" %>
|
13
13
|
<%= render "think_feel_do_engine/coach/patient_dashboards/tables/audio_access_table" %>
|
14
14
|
|
15
|
-
<h3><%= link_to "Activities visualization", coach_participant_activities_visualization_path(@participant) %></h3>
|
15
|
+
<h3><%= link_to "Activities visualization", coach_participant_activities_visualization_path(participant_id: @participant.id, group_id: @group.id) %></h3>
|
16
16
|
<%= render "think_feel_do_engine/coach/patient_dashboards/tables/future_activities_table" %>
|
17
17
|
<%= render "think_feel_do_engine/coach/patient_dashboards/tables/past_activities_table" %>
|
18
18
|
|
19
|
-
<h3><%= link_to "Thoughts visualization", coach_participant_thoughts_visualization_path(@participant) %></h3>
|
19
|
+
<h3><%= link_to "Thoughts visualization", coach_participant_thoughts_visualization_path(participant_id: @participant.id, group_id: @group.id) %></h3>
|
20
20
|
<%= render "think_feel_do_engine/coach/patient_dashboards/tables/thoughts_table" %>
|
21
21
|
|
22
22
|
<%= render "think_feel_do_engine/coach/patient_dashboards/tables/messages_table" %>
|
data/config/routes.rb
CHANGED
@@ -68,10 +68,10 @@ ThinkFeelDoEngine::Engine.routes.draw do
|
|
68
68
|
resources :site_messages, only: [:index, :show, :new, :create]
|
69
69
|
resources :memberships, only: :update
|
70
70
|
end
|
71
|
-
get "participant_activities_visualization/:participant_id",
|
71
|
+
get "participant_activities_visualization/:participant_id/group/:group_id",
|
72
72
|
to: "participant_activities_visualizations#show",
|
73
73
|
as: "participant_activities_visualization"
|
74
|
-
get "participant_thoughts_visualization/:participant_id",
|
74
|
+
get "participant_thoughts_visualization/:participant_id/group/:group_id",
|
75
75
|
to: "participant_thoughts_visualizations#show",
|
76
76
|
as: "participant_thoughts_visualization"
|
77
77
|
end
|