think_feel_do_engine 3.16.3 → 3.17.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/assets/javascripts/think_feel_do_engine/participants.js +0 -1
- data/app/controllers/think_feel_do_engine/navigator_controller.rb +14 -15
- data/app/models/task_status.rb +0 -1
- data/app/views/think_feel_do_engine/activities/_build_activity.html.erb +1 -1
- data/app/views/think_feel_do_engine/coach/group_dashboard/index.html.erb +1 -1
- data/app/views/think_feel_do_engine/emotions/new_current.html.erb +1 -1
- data/app/views/think_feel_do_engine/experiences/new_provider.html.erb +1 -1
- data/app/views/think_feel_do_engine/gratitude_recordings/new_provider.html.erb +1 -1
- data/app/views/think_feel_do_engine/learn/lessons_index.html.erb +2 -2
- data/app/views/think_feel_do_engine/shared/participant/_nav_items.html.erb +1 -2
- data/db/migrate/20140722172101_add_missing_fk_constraints.rb +6 -1
- data/lib/think_feel_do_engine/version.rb +1 -1
- metadata +2 -5
- data/app/assets/javascripts/think_feel_do_engine/task_status.js +0 -19
- data/app/controllers/think_feel_do_engine/participants/task_status_controller.rb +0 -35
- data/app/models/engagement.rb +0 -7
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: a1aeba41ab19d644e3b61f35f1a0b5a12599b44b
         | 
| 4 | 
            +
              data.tar.gz: f5ab432d31659ccc124231abcd98314d4840238e
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: d8999ed4d317cb5c7537d140ea008179e170e52b345d56fa3ce3db6431bf5c0f3dd92c9a0865373ede0acbcf5ac678ceb1e6a5be058a04786b5420c3cc8c1558
         | 
| 7 | 
            +
              data.tar.gz: c7f36ad1f51765a3c90befd9b873d4a0840fff5a62c56708ddf655cfb24576aebc246a857f7bcf9c3953ec520d1312fa526886dae2b5e986deb3edb8d52e15ef
         | 
| @@ -25,6 +25,9 @@ module ThinkFeelDoEngine | |
| 25 25 | 
             
                    provider_id: params[:provider_id],
         | 
| 26 26 | 
             
                    content_position: params[:content_position]
         | 
| 27 27 | 
             
                  )
         | 
| 28 | 
            +
             | 
| 29 | 
            +
                  complete_task_status(params[:module_id])
         | 
| 30 | 
            +
             | 
| 28 31 | 
             
                  render "show_content"
         | 
| 29 32 | 
             
                rescue ActiveRecord::RecordNotFound, ActionView::Template::Error
         | 
| 30 33 | 
             
                  @navigator.initialize_context(home_tool.title)
         | 
| @@ -33,7 +36,6 @@ module ThinkFeelDoEngine | |
| 33 36 | 
             
                end
         | 
| 34 37 |  | 
| 35 38 | 
             
                def show_next_content
         | 
| 36 | 
            -
                  mark_engagement_completed
         | 
| 37 39 | 
             
                  @navigator.fetch_next_content
         | 
| 38 40 |  | 
| 39 41 | 
             
                  if @navigator.current_module
         | 
| @@ -75,20 +77,17 @@ module ThinkFeelDoEngine | |
| 75 77 |  | 
| 76 78 | 
             
                private
         | 
| 77 79 |  | 
| 78 | 
            -
                def  | 
| 79 | 
            -
                   | 
| 80 | 
            -
             | 
| 81 | 
            -
             | 
| 82 | 
            -
             | 
| 83 | 
            -
             | 
| 84 | 
            -
             | 
| 85 | 
            -
             | 
| 86 | 
            -
             | 
| 87 | 
            -
             | 
| 88 | 
            -
             | 
| 89 | 
            -
                  if navigator_content_module && last_engagment
         | 
| 90 | 
            -
                    last_engagment.update_attributes(completed_at: DateTime.current)
         | 
| 91 | 
            -
                  end
         | 
| 80 | 
            +
                def complete_task_status(module_id)
         | 
| 81 | 
            +
                  content_module = BitCore::ContentModule.find(module_id)
         | 
| 82 | 
            +
                  membership = current_participant
         | 
| 83 | 
            +
                               .active_membership
         | 
| 84 | 
            +
                  @task_status = membership
         | 
| 85 | 
            +
                                 .task_statuses
         | 
| 86 | 
            +
                                 .for_content_module(content_module)
         | 
| 87 | 
            +
                                 .available_by_day(membership.day_in_study)
         | 
| 88 | 
            +
                                 .try(:order, "start_day DESC")
         | 
| 89 | 
            +
                                 .try(:first)
         | 
| 90 | 
            +
                  @task_status.mark_complete unless @task_status.nil?
         | 
| 92 91 | 
             
                end
         | 
| 93 92 |  | 
| 94 93 | 
             
                def module_exist?
         | 
    
        data/app/models/task_status.rb
    CHANGED
    
    
| @@ -94,8 +94,8 @@ | |
| 94 94 | 
             
              <% end %>
         | 
| 95 95 |  | 
| 96 96 | 
             
              <div class="btn-group pull-right">
         | 
| 97 | 
            -
                <%= submit_tag t(:next), class: "btn btn-primary", id: "submit_activities" %>
         | 
| 98 97 | 
             
                <%= link_to t(:skip), navigator_next_content_path, class: "btn btn-warning" %>
         | 
| 98 | 
            +
                <%= submit_tag t(:next), class: "btn btn-primary", id: "submit_activities" %>
         | 
| 99 99 | 
             
              </div>
         | 
| 100 100 | 
             
            <% end # form_for %>
         | 
| 101 101 |  | 
| @@ -42,7 +42,7 @@ | |
| 42 42 | 
             
                <%= render partial: "think_feel_do_engine/coach/group_dashboard/comments", locals: {group: @group} %>
         | 
| 43 43 |  | 
| 44 44 | 
             
                <a name="goals_table"></a>
         | 
| 45 | 
            -
                <%= render partial: "think_feel_do_engine/coach/group_dashboard/goals", locals: {group: @group} %>
         | 
| 45 | 
            +
                <%= render partial: "think_feel_do_engine/coach/group_dashboard/goals", locals: { group: @group} %>
         | 
| 46 46 |  | 
| 47 47 | 
             
                <a name="likes_table"></a>
         | 
| 48 48 | 
             
                <%= render partial: "think_feel_do_engine/coach/group_dashboard/likes", locals: {group: @group} %>
         | 
| @@ -15,8 +15,8 @@ | |
| 15 15 | 
             
            </div>
         | 
| 16 16 |  | 
| 17 17 | 
             
            <div class="btn-toolbar">
         | 
| 18 | 
            -
              <%= submit_tag t(:next), class: 'btn btn-primary', id: "submit-forms" %>
         | 
| 19 18 | 
             
              <%= link_to t(:skip), navigator_next_content_path, class: "btn btn-warning" %>
         | 
| 19 | 
            +
              <%= submit_tag t(:next), class: 'btn btn-primary', id: "submit-forms" %>
         | 
| 20 20 | 
             
            </div>
         | 
| 21 21 |  | 
| 22 22 | 
             
            <script>
         | 
| @@ -33,7 +33,7 @@ | |
| 33 33 | 
             
                          <% release_date = ts.available_for_learning_on %>
         | 
| 34 34 | 
             
                          <% if ts.accessible? %>
         | 
| 35 35 | 
             
                            <span class="list-group-item task-status enabled">
         | 
| 36 | 
            -
                              <%= link_to create_task_path(ts), class: "task-status", id: "task-status-#{ ts.id }" | 
| 36 | 
            +
                              <%= link_to create_task_path(ts), class: "task-status", id: "task-status-#{ ts.id }" do %>
         | 
| 37 37 | 
             
                                <h4 class="list-group-item-heading">
         | 
| 38 38 | 
             
                                  <span class="lesson <%= ts.completed_at ? "read" : "unread" %>"><%= ts.task.bit_core_content_module.pretty_title %></span>
         | 
| 39 39 | 
             
                                </h4>
         | 
| @@ -53,7 +53,7 @@ | |
| 53 53 | 
             
                              </p>
         | 
| 54 54 | 
             
                            </span>
         | 
| 55 55 | 
             
                          <% else %>
         | 
| 56 | 
            -
                            <span class="list-group-item task-status disabled" id="task-status-<%= ts.id %>" | 
| 56 | 
            +
                            <span class="list-group-item task-status disabled" id="task-status-<%= ts.id %>">
         | 
| 57 57 | 
             
                              <h4 class="list-group-item-heading">
         | 
| 58 58 | 
             
                                <span class="lesson unread"><%= ts.task.bit_core_content_module.pretty_title %></span>
         | 
| 59 59 | 
             
                              </h4>
         | 
| @@ -28,8 +28,7 @@ | |
| 28 28 | 
             
                      <li>
         | 
| 29 29 | 
             
                        <%= link_to think_feel_do_engine.navigator_location_path(module_id: module_nav_item.id),
         | 
| 30 30 | 
             
                                    class: "task-status",
         | 
| 31 | 
            -
                                    id: "task-status-#{ module_nav_item.task_status_id }" | 
| 32 | 
            -
                                    data: { :"task-status-id" => module_nav_item.task_status_id } do %>
         | 
| 31 | 
            +
                                    id: "task-status-#{ module_nav_item.task_status_id }" do %>
         | 
| 33 32 | 
             
                          <%= module_nav_item.has_didactic_content? ? fa_icon("book") : fa_icon("pencil") %> <%= module_nav_item.title %>
         | 
| 34 33 | 
             
                        <% end %>
         | 
| 35 34 | 
             
                      </li>
         | 
| @@ -1,4 +1,9 @@ | |
| 1 1 | 
             
            class AddMissingFkConstraints < ActiveRecord::Migration
         | 
| 2 | 
            +
              class MigrationEngagement < ActiveRecord::Base
         | 
| 3 | 
            +
                self.table_name = :engagements
         | 
| 4 | 
            +
                belongs_to :task_status
         | 
| 5 | 
            +
              end
         | 
| 6 | 
            +
             | 
| 2 7 | 
             
              def change
         | 
| 3 8 | 
             
                EmotionalRating.where(emotion_id: nil).destroy_all
         | 
| 4 9 | 
             
                EmotionalRating.all.each do |r|
         | 
| @@ -10,7 +15,7 @@ class AddMissingFkConstraints < ActiveRecord::Migration | |
| 10 15 | 
             
                ContentProviderPolicy.all.each do |p|
         | 
| 11 16 | 
             
                  p.destroy if p.content_provider.nil?
         | 
| 12 17 | 
             
                end
         | 
| 13 | 
            -
                 | 
| 18 | 
            +
                MigrationEngagement.all.each do |e|
         | 
| 14 19 | 
             
                  e.destroy if e.task_status.nil?
         | 
| 15 20 | 
             
                end
         | 
| 16 21 | 
             
                Task.all.each do |t|
         | 
    
        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. | 
| 4 | 
            +
              version: 3.17.0
         | 
| 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-05- | 
| 11 | 
            +
            date: 2016-05-09 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: rails
         | 
| @@ -371,7 +371,6 @@ files: | |
| 371 371 | 
             
            - app/assets/javascripts/think_feel_do_engine/shared/detect_timeout.js
         | 
| 372 372 | 
             
            - app/assets/javascripts/think_feel_do_engine/slideshows.js
         | 
| 373 373 | 
             
            - app/assets/javascripts/think_feel_do_engine/stepped_care.js
         | 
| 374 | 
            -
            - app/assets/javascripts/think_feel_do_engine/task_status.js
         | 
| 375 374 | 
             
            - app/assets/javascripts/think_feel_do_engine/thought_patterns/index.js.erb
         | 
| 376 375 | 
             
            - app/assets/javascripts/think_feel_do_engine/thoughts/edit_bulk.js
         | 
| 377 376 | 
             
            - app/assets/javascripts/think_feel_do_engine/thoughts/scThoughtTrackerMenuViz.js
         | 
| @@ -419,7 +418,6 @@ files: | |
| 419 418 | 
             
            - app/controllers/think_feel_do_engine/participants/passwords_controller.rb
         | 
| 420 419 | 
             
            - app/controllers/think_feel_do_engine/participants/public_slides_controller.rb
         | 
| 421 420 | 
             
            - app/controllers/think_feel_do_engine/participants/sessions_controller.rb
         | 
| 422 | 
            -
            - app/controllers/think_feel_do_engine/participants/task_status_controller.rb
         | 
| 423 421 | 
             
            - app/controllers/think_feel_do_engine/participants/thoughts_controller.rb
         | 
| 424 422 | 
             
            - app/controllers/think_feel_do_engine/password_entropy_bits_controller.rb
         | 
| 425 423 | 
             
            - app/controllers/think_feel_do_engine/privacy_policies_controller.rb
         | 
| @@ -505,7 +503,6 @@ files: | |
| 505 503 | 
             
            - app/models/delivered_message.rb
         | 
| 506 504 | 
             
            - app/models/emotion.rb
         | 
| 507 505 | 
             
            - app/models/emotional_rating.rb
         | 
| 508 | 
            -
            - app/models/engagement.rb
         | 
| 509 506 | 
             
            - app/models/experience.rb
         | 
| 510 507 | 
             
            - app/models/gratitude_recording.rb
         | 
| 511 508 | 
             
            - app/models/group.rb
         | 
| @@ -1,19 +0,0 @@ | |
| 1 | 
            -
            ;(function() {
         | 
| 2 | 
            -
              "use strict";
         | 
| 3 | 
            -
             | 
| 4 | 
            -
              // Report actions associated with task statuses
         | 
| 5 | 
            -
              $(document).on("page:change", function() {
         | 
| 6 | 
            -
                $("a.task-status").not(".disabled").on("click", function(event) {
         | 
| 7 | 
            -
                  var $target, $taskStatusId;
         | 
| 8 | 
            -
                  
         | 
| 9 | 
            -
                  $target = $(event.currentTarget);
         | 
| 10 | 
            -
                  $taskStatusId = $target.data("task-status-id");
         | 
| 11 | 
            -
                  $.ajax({
         | 
| 12 | 
            -
                    async: false,
         | 
| 13 | 
            -
                    dataType: "script",
         | 
| 14 | 
            -
                    type: "PUT",
         | 
| 15 | 
            -
                    url: "/participants/task_status/" + $taskStatusId
         | 
| 16 | 
            -
                  });
         | 
| 17 | 
            -
                });
         | 
| 18 | 
            -
              });
         | 
| 19 | 
            -
            })();
         | 
| @@ -1,35 +0,0 @@ | |
| 1 | 
            -
            require_dependency "think_feel_do_engine/application_controller"
         | 
| 2 | 
            -
             | 
| 3 | 
            -
            module ThinkFeelDoEngine
         | 
| 4 | 
            -
              module Participants
         | 
| 5 | 
            -
                # Updates the completion of assigned tasks for a participant
         | 
| 6 | 
            -
                class TaskStatusController < ApplicationController
         | 
| 7 | 
            -
                  before_action :authenticate_participant!
         | 
| 8 | 
            -
             | 
| 9 | 
            -
                  rescue_from ActiveRecord::RecordNotFound, with: :record_not_found
         | 
| 10 | 
            -
             | 
| 11 | 
            -
                  def update
         | 
| 12 | 
            -
                    @task_status = current_participant
         | 
| 13 | 
            -
                                   .active_membership
         | 
| 14 | 
            -
                                   .task_statuses
         | 
| 15 | 
            -
                                   .find(params[:id])
         | 
| 16 | 
            -
             | 
| 17 | 
            -
                    begin
         | 
| 18 | 
            -
                      if @task_status.engagements.build && @task_status.mark_complete
         | 
| 19 | 
            -
                        render nothing: true, status: 200
         | 
| 20 | 
            -
                      else
         | 
| 21 | 
            -
                        render nothing: true, status: 400
         | 
| 22 | 
            -
                      end
         | 
| 23 | 
            -
                    rescue ActiveRecord::InvalidForeignKey
         | 
| 24 | 
            -
                      render nothing: true, status: 400
         | 
| 25 | 
            -
                    end
         | 
| 26 | 
            -
                  end
         | 
| 27 | 
            -
             | 
| 28 | 
            -
                  private
         | 
| 29 | 
            -
             | 
| 30 | 
            -
                  def record_not_found
         | 
| 31 | 
            -
                    render nothing: true, status: 404
         | 
| 32 | 
            -
                  end
         | 
| 33 | 
            -
                end
         | 
| 34 | 
            -
              end
         | 
| 35 | 
            -
            end
         | 
    
        data/app/models/engagement.rb
    DELETED