<!-- PHCTitleSEO Title Variables -->
<% phc_title "Command Item Manager" %>
<% phc_title_tagline "Command Item Index" %>
<% phc_breadcrumb_one link_to "Command List Index", phcdevworks_tutorials.command_posts_path %>
<% phc_breadcrumb_two "Command Items" %>
<!-- PHCTitleSEO Title Variables -->

<!-- Page Bradcrumbs -->
<ol class="breadcrumb pull-right">
	<li class="breadcrumb-item"><%= yield(:phc_breadcrumb_one) %></li>
	<li class="breadcrumb-item active"><%= yield(:phc_breadcrumb_two) %></li>
</ol>
<!-- Page Bradcrumbs -->

<!-- Page Header -->
<h2 class="page-header"><%= yield(:phc_title) %></h2>
<!-- Page Header -->

<!-- Page Content -->
<div class="row">
	<div class="col-lg-12">

		<!-- Panel -->
		<div class="panel panel-inverse">

			<!-- Panel - Heading -->
			<div class="panel-heading">
				<h4 class="panel-title"><%= yield(:phc_title) %></h4>
			</div>
			<!-- Panel - Heading -->

			<!-- Panel - Body -->
			<div class="panel-body">

				<!-- Index - Table -->
				<div class="table-responsive">
					<table class="table table-striped table-bordered">

                        <thead>
                            <tr>
                                <th>Item Name</th>
                                <th>Description</th>
                                <th>Command</th>
                                <th></th>
                            </tr>
                        </thead>

                        <tbody>
                            <% @command_items.each do |command_item| %>
                                <tr>
                                    <td><%= command_item.item_name %></td>
                                    <td><%= command_item.item_description %></td>
                                    <td><%= command_item.item_copy_command %></td>
                                    <td>
                                        <div class="btn-group d-flex" role="group">
                                            <%= link_to "Update Item", edit_command_post_item_path(command_item.post, command_item), class: "btn btn-primary btn-xs" %>
                                            <%= link_to "Remove Item", command_post_item_path(command_item.post, command_item), method: :delete, data: { confirm: "Are you sure? This Action Cannot be Reversed." }, class: "btn btn-danger btn-xs" %>
                                        </div>
                                    </td>
                                </tr>
                            <% end %>
                           
                        </tbody>

					</table>
				</div>
				<!-- Index - Table -->

				<!-- New Button -->
                <%= link_to phcdevworks_tutorials.new_command_post_item_path, class: "btn btn-primary btn-sm" do %>
                    <i class="fad fa-plus-circle"></i>
                    Add a New Item to Command List
				<% end %>
				<!-- New Button -->

			</div>
			<!-- Panel - Body -->

		</div>
		<!-- Panel -->

	</div>
</div>
<!-- Page Content -->