Sha256: 10840b6a1822d0e081e7f58d52eb9f956665758a3fb4eaf08bd09b34227e80d1

Contents?: true

Size: 1.67 KB

Versions: 47

Compression:

Stored size: 1.67 KB

Contents

<h2>Harmful Thoughts</h2>

<div class="btn-toolbar">
  <% hide_new_path = hide_new_path or false %>
  <% unless hide_new_path %>
    <%= link_to "<i class='fa fa-plus'></i> Add a New Thought".html_safe, navigator_next_content_path, class: "btn btn-default" %>
  <% end %>
  <%= link_to "Edit Thoughts", "#", class: "btn btn-default", onclick: "makeThoughtsEditable(); return false;", id: "edit-thoughts-button" %>
</div>

<%= form_tag participants_thoughts_path, remote: true do %>
<table class="table table-hover data-table responsive" id="thoughts">
  <thead>
    <tr>
      <th class="not-displayed"></th>
      <th>Thought</th>
      <th>Pattern</th>
      <th>Challenging Thought</th>
      <th>As If Action</th>
      <th>Date</th>
      <th></th>
    </tr>
  </thead>
  <tbody>
    <%= render partial: "think_feel_do_engine/thoughts/mutable_thought", collection: thoughts.order(created_at: :desc) %>
  </tbody>
</table>
<% end %>

<script>
  function makeThoughtsEditable() {
    $("table#thoughts .immutable-thought-content").hide();
    $("table#thoughts input,select").show();
    $("table#thoughts input[type='submit']").show();
    $("table#thoughts tr").addClass("form-table");
  }
  $('table.responsive').ngResponsiveTables({
      smallPaddingCharNo: 13,
      mediumPaddingCharNo: 18,
      largePaddingCharNo: 30,
      shiftedIndex:0
    });
  $(function() {
    $('#thoughts').dataTable({
      order: [[5, 'desc']],
      columnDefs: [
        {
          targets: [0],
          visible: false
        },
        {
          targets: [5],
          orderData: [0]
        },
        {
          targets: [6],
          orderable: false
        }       
      ]
    });
  });
</script>

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
think_feel_do_engine-3.22.9 app/views/think_feel_do_engine/thoughts/thoughts_table.html.erb
think_feel_do_engine-3.22.8 app/views/think_feel_do_engine/thoughts/thoughts_table.html.erb
think_feel_do_engine-3.22.7 app/views/think_feel_do_engine/thoughts/thoughts_table.html.erb
think_feel_do_engine-3.22.6 app/views/think_feel_do_engine/thoughts/thoughts_table.html.erb
think_feel_do_engine-3.22.5 app/views/think_feel_do_engine/thoughts/thoughts_table.html.erb
think_feel_do_engine-3.22.4 app/views/think_feel_do_engine/thoughts/thoughts_table.html.erb
think_feel_do_engine-3.22.2 app/views/think_feel_do_engine/thoughts/thoughts_table.html.erb
think_feel_do_engine-3.22.1 app/views/think_feel_do_engine/thoughts/thoughts_table.html.erb
think_feel_do_engine-3.22.0 app/views/think_feel_do_engine/thoughts/thoughts_table.html.erb
think_feel_do_engine-3.21.2 app/views/think_feel_do_engine/thoughts/thoughts_table.html.erb
think_feel_do_engine-3.21.1 app/views/think_feel_do_engine/thoughts/thoughts_table.html.erb
think_feel_do_engine-3.21.0 app/views/think_feel_do_engine/thoughts/thoughts_table.html.erb
think_feel_do_engine-3.20.1 app/views/think_feel_do_engine/thoughts/thoughts_table.html.erb
think_feel_do_engine-3.19.9 app/views/think_feel_do_engine/thoughts/thoughts_table.html.erb
think_feel_do_engine-3.19.8 app/views/think_feel_do_engine/thoughts/thoughts_table.html.erb
think_feel_do_engine-3.19.7 app/views/think_feel_do_engine/thoughts/thoughts_table.html.erb
think_feel_do_engine-3.19.6 app/views/think_feel_do_engine/thoughts/thoughts_table.html.erb
think_feel_do_engine-3.19.5 app/views/think_feel_do_engine/thoughts/thoughts_table.html.erb
think_feel_do_engine-3.19.4 app/views/think_feel_do_engine/thoughts/thoughts_table.html.erb
think_feel_do_engine-3.19.3 app/views/think_feel_do_engine/thoughts/thoughts_table.html.erb