think_feel_do_engine 3.15.2 → 3.15.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3e83ae6fd9a710a062c4abad4f5294fd8fa398be
4
- data.tar.gz: 30db304fb47b40b0c49dfe62fe6ac93190f29d3f
3
+ metadata.gz: 1c112288214be133c2d67a051e11b527a383ca8c
4
+ data.tar.gz: fffba0d56a2d9988017b1b9139e198c1458f75e9
5
5
  SHA512:
6
- metadata.gz: 7f37cee0fb9d4c0b54951d1e4df53cd2d6840c261dda81c2c20218ee27725db866c23c1f472a2d6489c638b24b74a19ae3fcea9106ad9cbe2e6ffd387939e6fe
7
- data.tar.gz: 0d4676397eea5e1ce4a3873abe315adb4d49098c54177efd3cd7c063944f19e1c860fca8677ea197bdf185c593e31b09da45151d41f43ae47dde3f111c589442
6
+ metadata.gz: f42ec636df2f603354c3fceb06f629ba6d48d36cb7ffa604b0d26b9c1fbdf836b9d2c33c407cb244d5f6e03e229a755954e7ad94965455ba9eea396bfd52e21d
7
+ data.tar.gz: 488227e76b5054c0f970cd280d4068e06d05226cf4a0934a1b58f9e3255b7d3f081508a9b6e2f359bc30d7fa93841f82c17839e98b4c9d5e288ca07b3a87d03d
data/Rakefile CHANGED
@@ -28,7 +28,6 @@ Jshintrb::JshintTask.new :jshint do |t|
28
28
  t.pattern = %w(
29
29
  spec/dummy/spec/javascripts/**/*.js
30
30
  app/assets/javascripts/think_feel_do_engine/**/draw_graphs.js
31
- app/assets/javascripts/think_feel_do_engine/feel/create_emotional_ratings.js
32
31
  )
33
32
  t.options = :defaults
34
33
  t.globals = ["$".to_sym, :spyOn, :afterEach, :beforeEach, :describe, :expect, :it, :jasmine, :sc, :Graph, :appendDateRange, :columnChart, :d3, :moment]
@@ -17,11 +17,13 @@ module ContentProviders
17
17
  end
18
18
 
19
19
  def render_current(options)
20
+ view_context = options.view_context
21
+
20
22
  options.view_context.render(
21
23
  template: "think_feel_do_engine/experiences/new_provider",
22
24
  locals: {
23
- create_path: options.view_context.participant_data_path,
24
- participant: options.view_context.current_participant
25
+ create_path: view_context.participant_data_path,
26
+ participant: view_context.current_participant
25
27
  })
26
28
  end
27
29
 
@@ -94,8 +94,8 @@
94
94
  <% end %>
95
95
 
96
96
  <div class="btn-group pull-right">
97
- <%= link_to 'Skip', navigator_next_content_path, class: 'btn btn-default btn-warning' %>
98
97
  <%= submit_tag t(:next), class: "btn btn-primary", id: "submit_activities" %>
98
+ <%= link_to t(:skip), navigator_next_content_path, class: "btn btn-warning" %>
99
99
  </div>
100
100
  <% end # form_for %>
101
101
 
@@ -16,7 +16,7 @@
16
16
 
17
17
  <div class="btn-toolbar">
18
18
  <%= submit_tag t(:next), class: 'btn btn-primary', id: "submit-forms" %>
19
- <%= link_to 'Skip', navigator_next_content_path, class: 'btn btn-warning' %>
19
+ <%= link_to t(:skip), navigator_next_content_path, class: "btn btn-warning" %>
20
20
  </div>
21
21
 
22
22
  <script>
@@ -58,4 +58,5 @@
58
58
  </div>
59
59
 
60
60
  <%= f.submit t(:next), class: "btn btn-primary" %>
61
+ <%= link_to t(:skip), navigator_next_content_path, class: "btn btn-warning" %>
61
62
  <% end %>
@@ -24,4 +24,5 @@
24
24
  </div>
25
25
 
26
26
  <%= f.submit t(:next), class: "btn btn-primary" %>
27
+ <%= link_to t(:skip), navigator_next_content_path, class: "btn btn-warning" %>
27
28
  <% end %>
@@ -1,5 +1,5 @@
1
1
  <% if current_provider_skippable?(@navigator) %>
2
2
  <div class="btn-toolbar">
3
- <%= link_to "Skip", navigator_next_provider_path, class: "btn btn-default next-button" %>
3
+ <%= link_to t(:skip), navigator_next_provider_path, class: "btn btn-default next-button" %>
4
4
  </div>
5
5
  <% end %>
@@ -2,3 +2,4 @@ en:
2
2
  back: Back
3
3
  finish: Finish
4
4
  next: Next
5
+ skip: Skip
@@ -1,4 +1,4 @@
1
1
  # nodoc
2
2
  module ThinkFeelDoEngine
3
- VERSION = "3.15.2"
3
+ VERSION = "3.15.3"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: think_feel_do_engine
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.15.2
4
+ version: 3.15.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Carty-Fickes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-15 00:00:00.000000000 Z
11
+ date: 2016-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -355,7 +355,6 @@ files:
355
355
  - app/assets/javascripts/think_feel_do_engine/dateWrapper.js
356
356
  - app/assets/javascripts/think_feel_do_engine/devise/passwords/edit.js.erb
357
357
  - app/assets/javascripts/think_feel_do_engine/event_capture/init.js
358
- - app/assets/javascripts/think_feel_do_engine/feel/create_emotional_ratings.js
359
358
  - app/assets/javascripts/think_feel_do_engine/feel/draw_graphs.js
360
359
  - app/assets/javascripts/think_feel_do_engine/feel/emotion_mood_viz.js
361
360
  - app/assets/javascripts/think_feel_do_engine/feel/emotions.js
@@ -467,7 +466,6 @@ files:
467
466
  - app/models/content_providers/create_activity.rb
468
467
  - app/models/content_providers/current_modules/index_provider.rb
469
468
  - app/models/content_providers/edit_past_feel_provider.rb
470
- - app/models/content_providers/emotions/new_yesterday_provider.rb
471
469
  - app/models/content_providers/evaluate_thoughts_provider.rb
472
470
  - app/models/content_providers/experiences/index_provider.rb
473
471
  - app/models/content_providers/experiences/new_provider.rb
@@ -689,7 +687,6 @@ files:
689
687
  - app/views/think_feel_do_engine/emotions/_form.html.erb
690
688
  - app/views/think_feel_do_engine/emotions/index.html.erb
691
689
  - app/views/think_feel_do_engine/emotions/new_current.html.erb
692
- - app/views/think_feel_do_engine/emotions/new_yesterday.html.erb
693
690
  - app/views/think_feel_do_engine/experiences/index_provider.html.erb
694
691
  - app/views/think_feel_do_engine/experiences/new_provider.html.erb
695
692
  - app/views/think_feel_do_engine/gratitude_recordings/index_provider.html.erb
@@ -1,44 +0,0 @@
1
- (function() {
2
- 'use strict';
3
-
4
- sc.createEmotionalRating = function(options) {
5
- var $tr = $(options.rows_of_emotions[options.index]);
6
- var rating = $tr.find('input:checked').val();
7
-
8
- function successCallback() {
9
- rateEmotion(options);
10
- }
11
-
12
- options.index = options.index + 1;
13
- if (rating) {
14
- $.ajax({
15
- type: 'post',
16
- url: options.post_path,
17
- data: {
18
- emotional_rating: {
19
- emotion_id: $tr.data('emotionId'),
20
- is_positive: $tr.data('isPositive'),
21
- participant_id: options.participant_id,
22
- rating: rating
23
- }
24
- },
25
- async: true,
26
- dataType: 'script',
27
- success: successCallback,
28
- error: errorCallback
29
- });
30
- } else {
31
- rateEmotion(options);
32
- }
33
- };
34
-
35
- function errorCallback() {}
36
-
37
- function rateEmotion(options) {
38
- if (options.count === 0 || options.count === options.index) {
39
- options._window.location = options.redirect_path;
40
- } else {
41
- sc.createEmotionalRating(options);
42
- }
43
- }
44
- })();
@@ -1,95 +0,0 @@
1
- module ContentProviders
2
- module Emotions
3
- # Allows participants to record all of yesterday's emotions
4
- class NewYesterdayProvider < BitCore::ContentProvider
5
- Description = Struct.new(:name, :is_positive)
6
- Rating = Struct.new(:description, :value)
7
-
8
- def render_current(options)
9
- context = options.view_context
10
- participant = options.participant
11
-
12
- context.render(
13
- template: "think_feel_do_engine/emotions/new_yesterday",
14
- locals: {
15
- create_path: context.participant_data_path,
16
- emotional_ratings: emotional_ratings(participant),
17
- participant: participant,
18
- ratings: ratings
19
- })
20
- end
21
-
22
- def data_attributes
23
- [
24
- :emotion_id,
25
- :is_positive,
26
- :participant_id,
27
- :rating
28
- ]
29
- end
30
-
31
- def data_class_name
32
- "EmotionalRating"
33
- end
34
-
35
- def emotional_ratings(participant)
36
- descriptions.map do |description|
37
- participant
38
- .emotional_ratings
39
- .build(
40
- emotion: emotions(participant)
41
- .find_or_create_by!(name: description.name),
42
- is_positive: description.is_positive)
43
- end
44
- end
45
-
46
- def show_nav_link?
47
- false
48
- end
49
-
50
- private
51
-
52
- def descriptions
53
- [
54
- Description.new("amused, fun-loving", true),
55
- Description.new("angry, irritated, frustrated", false),
56
- Description.new("anxious, scared", false),
57
- Description.new("awe, wonder, inspiration", true),
58
- Description.new("bored", false),
59
- Description.new("contempt, score, disdain", false),
60
- Description.new("content", false),
61
- Description.new("disgusted", false),
62
- Description.new("embarrassed", false),
63
- Description.new("excited, eager, enthusiastic", true),
64
- Description.new("grateful", true),
65
- Description.new("guilty", false),
66
- Description.new("happy", true),
67
- Description.new("hatred, disgust, suspicion", false),
68
- Description.new("hopeful, optimistic", true),
69
- Description.new("interested", true),
70
- Description.new("lonely, rejected", false),
71
- Description.new("love, closeness, trust", true),
72
- Description.new("proud, confident", true),
73
- Description.new("sad", false),
74
- Description.new("stressed, overwhelmed", false),
75
- Description.new("sympathy, compassion", true),
76
- Description.new("relieved", true)
77
- ]
78
- end
79
-
80
- def emotions(participant)
81
- @emotions ||= participant.emotions
82
- end
83
-
84
- def ratings
85
- [
86
- Rating.new("Not at all", 0),
87
- Rating.new("A little bit", 1),
88
- Rating.new("Sometimes", 2),
89
- Rating.new("Frequently", 3),
90
- Rating.new("All the time", 4)
91
- ]
92
- end
93
- end
94
- end
95
- end
@@ -1,60 +0,0 @@
1
- <h1>Over the PAST DAY, how much have you felt each of these emotions?</h1>
2
-
3
- <table class="table" style="background-color: #FFF;">
4
- <thead>
5
- <tr>
6
- <th></th>
7
- <% ratings.each do |rating| %>
8
- <th>
9
- <%= rating.description %>
10
- </th>
11
- <% end %>
12
- </tr>
13
- </thead>
14
- <tbody>
15
- <% emotional_ratings.each do |emotional_rating| %>
16
- <tr
17
- data-emotion-id="<%= emotional_rating.emotion_id %>"
18
- data-is-positive="<%= emotional_rating.is_positive %>">
19
- <th>
20
- <label for="emotional_rating_<%= emotional_rating.emotion_id %>_<%= ratings.first.value %>">
21
- <%= emotional_rating.name %>
22
- </label>
23
- </th>
24
- <% ratings.each do |rating| %>
25
- <td>
26
- <input
27
- id="emotional_rating_<%= emotional_rating.emotion_id %>_<%= rating.value %>"
28
- name="emotional_rating_<%= emotional_rating.emotion_id %>"
29
- type="radio"
30
- value="<%= rating.value %>">
31
- </td>
32
- <% end %>
33
- </tr>
34
- <% end %>
35
- </tbody>
36
- </table>
37
-
38
- <div class="btn-toolbar">
39
- <%= submit_tag t(:next), class: "btn btn-primary", id: "submit_emotions" %>
40
- </div>
41
-
42
- <script type="text/javascript">
43
- $(document).on("page:change", function() {
44
- $('#submit_emotions').on('click', function() {
45
- var $rows_of_emotions = $('table.table tbody tr');
46
- var count = $rows_of_emotions.length;
47
- var options = {
48
- rows_of_emotions: $rows_of_emotions,
49
- index: 0,
50
- count: count,
51
- participant_id: '<%= current_participant.id %>',
52
- post_path: '<%= create_path %>',
53
- redirect_path: '<%= main_app.root_path %>',
54
- _window: window
55
- };
56
-
57
- sc.createEmotionalRating(options);
58
- });
59
- });
60
- </script>