<!-- -PHCDev- PHCTitleSEO Title Variables -->
<% phc_title "Marketing Manager" %>
<% phc_title_tagline "Affiliate Links" %>
<% phc_breadcrumb_one yield(:phc_title_tagline) %>
<% phc_breadcrumb_two link_to "Affiliate Link Index", phcdevworks_core_modules.affiliate_links_path %>
<!-- -PHCDev- PHCTitleSEO Title Variables -->

<!-- -PHCDev- Page Bradcrumbs -->
<ol class="breadcrumb float-xl-end">
    <li class="breadcrumb-item"><%= yield(:phc_breadcrumb_one) %></li>
    <li class="breadcrumb-item active"><%= yield(:phc_breadcrumb_two) %></li>
</ol>
<!-- -PHCDev- Page Bradcrumbs -->

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

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

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

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

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

                <thead>
                    <tr>
                        <th>Link Name</th>
                        <th>Button Text</th>
                        <th>Affiliate URL</th>
                        <th>Original URL</th>
                        <th></th>
                    </tr>
                </thead>

                <tbody>
                    <% @affiliate_links.each do |affiliate_link| %>
                        <tr>
                            <td><%= affiliate_link.affiliate_link_name %></td>
                            <td><%= affiliate_link.affiliate_link_button_text %></td>
                            <td><%= affiliate_link.affiliate_link_url %></td>
                            <td><%= affiliate_link.affiliate_link_original_url %></td>
                            <td>
                                <div class="btn-group" role="group" aria-label="Index Actions">
                                    <%= link_to "Link Details", affiliate_link, class: "btn btn-purple btn-xs" %>
                                    <%= link_to "Update Link", edit_affiliate_link_path(affiliate_link), class: "btn btn-primary btn-xs" %>
                                    <%= link_to "Remove", affiliate_link, 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>
        <!-- -PHCDev- Index - Table -->

        <!-- -PHCDev- New Button -->
        <%= link_to phcdevworks_core_modules.new_affiliate_link_path, class: "btn btn-primary btn-sm" do %>
            <i class="fad fa-plus-circle"></i>
            Add a New Affiliate Link
        <% end %>
        <!-- -PHCDev- New Button -->

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

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