Aakup/MultiMeet-1

View on GitHub
app/views/participants/show.html.erb

Summary

Maintainability
Test Coverage
<%= render 'layouts/navbar' %>
<%= render 'layouts/alerts' %>

<div class="user-container">
  <div class="jumbotron shadow white-bg">

    <h1>Editing Participant</h1>

    <div class="current-duration">
      <% if !@project.duration.blank? %>
        <p><strong>Current Timeslot Duration:</strong> <%= @project.duration %> minutes</p>
      <% else %>
        <p><strong>Current Timeslot Duration:</strong> Not set yet</p>
      <% end %>
    </div>

    <div class="match-degree">
      <% if !@participant.match_degree == 1 %>
      <% else %>
        <p><strong>Number of times to be assigned to you:</strong> <%= @participant.match_degree %></p>
      <% end %>
    </div>

    <hr>

    <%= form_for([@project, @participant]) do |f| %>

      <div class="form-group">
        <b>Edit Email:</b> <%= f.text_field :email, placeholder: "Participant Email",
                                            class: "form-control", required: "required"%><br>
        <b>Edit Match Degree:</b> <%= f.number_field :match_degree, type: "number", min:"1",
                                                     placeholder: "Match Degree", class: "form-control",
                                                     required: "required" %>
      </div>
      <div class="actions edit-participants-action">
        <%= f.submit "Update Participant", class:"btn btn-success"  %>
        <%= link_to 'Back', project_participants_path, class:"btn btn-primary" %>
        <%= link_to 'Delete Participant', project_participant_path(@participant.project_id, @participant.id), method: :delete, url: project_participants_path, class:"btn btn-danger"%></td>
      </div>
    <% end %>

  </div>
</div>