

<div id="group_resources" class="tab-pane">
    <% if (currUser.admin) { %>
        <div style="display: flex; justify-content: flex-end;">
            <a href="/resources/create?groupId=<%= group.groupId%>">
                <button class="btn btn-dark btn-block"
                    id="create-resource-button"><i class="fa-solid fa-file-circle-plus mr-2"></i>Add Resource</button>
            </a>
        </div>
    <% } %>

    <% for(const resource of resources ) { %>
        <div class="card">
            <div class="card-body" id="<%= resource.resourceId %>">
                <div class="row">
                    <div class="col-8">
                        <h5 class="card-title font-weight-bold"><%= resource.resourceHeading %></h5>
                        <p class="card-text text-muted"><%=resource.resourceDescription %></p>
                        <a href="<%= resource.resourceLink %>" target="_blank">
                            Click Here to Access Resource <i class="fa-solid fa-arrow-up-right-from-square ml-2"></i>
                        </a>
                    </div>
                    <div class="col-4">
                        <% if (currUser.admin) { %>
                            <div style="float: right;">
                                <a href="/resources/edit?resourceId=<%= resource.resourceId%>">
                                    <button class="btn btn-primary btn-block my-2" id="edit-resource-button">
                                        <i class="fa-solid fa-file-pen mr-2"></i>Edit Resource
                                    </button>
                                </a>
                                <a href="/resources/delete?resourceId=<%= resource.resourceId %>&groupId=<%= resource.groupId %>">
                                    <button class="btn btn-danger btn-block" id="delete-resource-button">
                                        <i class="fa-solid fa-file-circle-minus mr-2"></i>Delete Resource
                                    </button>
                                </a>
                            </div>
                        <% } %>
                    </div>
                </div>
                
                
            </div>
        </div>       
    <% } %>
</div>
