Sha256: 90cfd05cc38943cbf84992a553b548dec83bfea372257f5af8a0b2a07d890e9c

Contents?: true

Size: 1.74 KB

Versions: 13

Compression:

Stored size: 1.74 KB

Contents

<h1>Over the PAST DAY, how much have you felt each of these emotions?</h1>

<table class="table" style="background-color: #FFF;">
  <thead>
    <tr>
      <th></th>
      <% ratings.each do |rating| %>
        <th>
          <%= rating.description %>
        </th>
      <% end %>
    </tr>
  </thead>
  <tbody>
    <% emotional_ratings.each do |emotional_rating| %>
      <tr
        data-emotion-id="<%= emotional_rating.emotion_id %>"
        data-is-positive="<%= emotional_rating.is_positive %>">
        <th>
          <label for="emotional_rating_<%= emotional_rating.emotion_id %>_<%= ratings.first.value %>">
            <%= emotional_rating.name %>
          </label>
        </th>
        <% ratings.each do |rating| %>
          <td>
            <input
              id="emotional_rating_<%= emotional_rating.emotion_id %>_<%= rating.value %>"
              name="emotional_rating_<%= emotional_rating.emotion_id %>"
              type="radio"
              value="<%= rating.value %>">
          </td>
        <% end %>
      </tr>
    <% end %>
  </tbody>
</table>

<div class="btn-toolbar">
  <%= submit_tag t(:next), class: "btn btn-primary", id: "submit_emotions" %>
</div>

<script type="text/javascript">
  $(document).on("page:change", function() {
    $('#submit_emotions').on('click', function() {
      var $rows_of_emotions = $('table.table tbody tr');
      var count = $rows_of_emotions.length;
      var options = {
        rows_of_emotions: $rows_of_emotions,
        index: 0,
        count: count,
        participant_id: '<%= current_participant.id %>',
        post_path: '<%= create_path %>',
        redirect_path: '<%= main_app.root_path %>',
        _window: window
      };

      sc.createEmotionalRating(options);
    });
  });
</script>

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
think_feel_do_engine-3.15.2 app/views/think_feel_do_engine/emotions/new_yesterday.html.erb
think_feel_do_engine-3.15.1 app/views/think_feel_do_engine/emotions/new_yesterday.html.erb
think_feel_do_engine-3.15.0 app/views/think_feel_do_engine/emotions/new_yesterday.html.erb
think_feel_do_engine-3.14.9 app/views/think_feel_do_engine/emotions/new_yesterday.html.erb
think_feel_do_engine-3.14.8 app/views/think_feel_do_engine/emotions/new_yesterday.html.erb
think_feel_do_engine-3.14.7 app/views/think_feel_do_engine/emotions/new_yesterday.html.erb
think_feel_do_engine-3.14.6 app/views/think_feel_do_engine/emotions/new_yesterday.html.erb
think_feel_do_engine-3.14.5 app/views/think_feel_do_engine/emotions/new_yesterday.html.erb
think_feel_do_engine-3.14.4 app/views/think_feel_do_engine/emotions/new_yesterday.html.erb
think_feel_do_engine-3.14.3 app/views/think_feel_do_engine/emotions/new_yesterday.html.erb
think_feel_do_engine-3.14.2 app/views/think_feel_do_engine/emotions/new_yesterday.html.erb
think_feel_do_engine-3.14.1 app/views/think_feel_do_engine/emotions/new_yesterday.html.erb
think_feel_do_engine-3.14.0 app/views/think_feel_do_engine/emotions/new_yesterday.html.erb