ashirahattia/cs169-pgm

View on GitHub
app/views/groups/index.html.erb

Summary

Maintainability
Test Coverage
<%= render "layouts/sidebar.html.erb" %>

<div class="content-container">
    <div class="content">
        <p>Click on the group name (next to the check box) to edit the group matching preferences.</p>
        <%= form_tag(:groups_destroy_multiple, method: "POST") do %>
            <div class="table-container">
                <% @groups.each do |group| %>
                <% @group = group %>
                <div class="group-module">
                    <div class="group-module-header">
                        <h1>
                            <span class="delete-checkbox"><%= check_box_tag("delete[#{group.id}]", "1") %></span>
                            <%= link_to(group.id, "/groups/" + group.id.to_s) %>
                        </h1>
                    </div>
                    <div class="group-module-body">
                        <table id="group_table">
                            <tr>
                                <th><h2>Members</h2></th>
                                <th><h2>Preferences</h2></th>
                                <th><h2>Force Matched To Project</h2></th>
                            </tr>
                            <tr>
                                <td>
                                  <%= @group.username %>
                                </td>
                                <td>
                                    <ol>
                                        <li><%= choice_str :first_choice %></li>
                                        <li><%= choice_str :second_choice %></li>
                                        <li><%= choice_str :third_choice %></li>
                                        <li><%= choice_str :fourth_choice %></li>
                                        <li><%= choice_str :fifth_choice %></li>
                                        <li><%= choice_str :sixth_choice %></li>
                                        <li><%= choice_str :seventh_choice %></li>
                                    </ol>
                                </td>
                                <td>
                                    <%= current_force_matched_project %>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
                <% end %>
            </div>
            <div class="action-container">
                <input id="delete_group" class="button red" type="submit" value="delete selected groups"/>
            </div>
        <% end %>
    </div>
</div>