<% content_for :head do %>
  <%= javascript_include_tag 'moment/moment.min.js' %>
  <%= javascript_include_tag 'dataTable/datatables.min.js' %>
  <%= javascript_include_tag 'query-builder/query-builder.min.js' %>
<% end %>

<div class="row" style="margin: 0">
  <div class="tab-content no-padding">
    <%= render 'task_queues/shared/task_queue_create_tab' %>
    <%= render 'task_queues/shared/task_queue_define_tab' %>
    <%= render 'task_queues/shared/task_queue_publish_tab' %>
  </div>
</div>

<div id="task-queue-item-modal" class="modal fade" aria-hidden="true" data-task-queue-id="<%= @task_queue.id %>">
  <div class="modal-dialog modal-lg">
    <div class="modal-content">
      <div class="modal-body" style="padding: 0">
        <div class="row" style="background-color: #eaeaea;">
          <div class="col-sm-5 border-right" style="padding: 50px 25px">
            <h3 class="m-t-none m-b">
              <%= @task_queue.name %>
            </h3>

            <p>
              <%= @task_queue.details %>
            </p>

            <div id="task_queue_item_data">
            </div>

            <div class="text-center" style="margin-top: 20px">
              <% if @task_queue.success_outcome_title.present? && @task_queue.success_outcome_timeout.present? %>
                <a href="#" onclick="applyOutcomeRule('success')" class="btn btn-primary"><%= @task_queue.success_outcome_title %></a>
              <% end %>
            </div>

            <div class="text-center" style="margin-top: 20px">
              <% if @task_queue.failure_outcome_title.present? && @task_queue.failure_outcome_timeout.present? %>
                <a href="#" onclick="applyOutcomeRule('failure')" class="btn btn-default"><%= @task_queue.failure_outcome_title %></a>
              <% end %>
            </div>
          </div>

          <div class="col-sm-7" style="background-color: white;padding: 50px 25px;min-height: 500px">
            <%= render 'shared/activity_history_task_queue_item', feedable_type: @task_queue.table %>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
