ece517-p3/expertiza

View on GitHub
app/views/teams/new.html.erb

Summary

Maintainability
Test Coverage
<H1>Create Teams for <%= @parent.name %></H1>

<H2> Automatically </H2>

<p> Uses, insofar as possible, the number of members specified when the
  assignment was created.</p>

<%= form_tag :action => 'create_teams' do %>
    <!-- BUG FIX: Check if the parent is course, then set the max size as 4 otherwise the max team size of assignment team-->
    <% if @parent.is_a?(Course)%>
          Team Size:<%= select_tag 'team_size', options_for_select(2..4), size: 1 %>
    <% else %>
          Team Size:<%= select_tag 'team_size', options_for_select(2..@parent.max_team_size), size: 1 %>
    <% end %>
<%= hidden_field_tag 'id', @parent.id %>

<%= submit_tag "Create Teams" %>
<% end %>


<BR/>

<H2> Manually </H2>
<p>Specify Team name, then add members to team, one by one. </p>
<%= form_tag :action => 'create' do %>
  <%= hidden_field_tag 'id', @parent.id %>
  <%= render :partial => 'form' %>
<% end %>

<BR/>
<% if not @parent.instance_of?(Course) and not @parent.course.nil? %>
  <H2> Inherit Teams From Course </H2>
  <p> Use the teams that are currently defined for the course.</p>
  <%= form_tag :action => 'inherit' do %>
    <%= hidden_field_tag 'id', @parent.id %>

    <%= submit_tag "Inherit" %>
  <% end %>
<% end %>
<BR/>
<%= link_to 'Back', :controller => 'teams', :action => 'list', :id => @parent.id  %>