teddim/gCamp

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

Summary

Maintainability
Test Coverage
<div class="page-header">
  <%= link_to "New Task", new_project_task_path, class: "btn btn-info pull-right" %>
  <h1>Tasks for <%= @project.name %></h1>
</div>

<ol class="breadcrumb">
  <li><%= link_to 'Projects', projects_path %></li>
  <li><%= link_to @project.name, project_path(@project) %></li>
  <li class= "Active">Tasks</li>
</ol>

<table class="table">
  <thead>
    <tr>
      <th class= "col-sm-3">Description</th>
      <th class= "col-sm-2">Due On</th>
      <th>

      </th>
    </tr>
  </thead>
  <% @tasks.each do |task| %>
    <tr>
      <% task.complete ? this_class = 'strikethrough' : custom_class =''  %>
      <td class = <%= this_class %> >
        <%= link_to task.description, project_task_path(task.project,task) %>
        <div class="badge"> <%= task.comments.count %> </div>
      </td>
      <td>
        <% if task.due_date %>
          <%= task.due_date.strftime("%_m/%d/%Y") %>
        <% end %>
      </td>
      <td class="text-right">
        <%= link_to 'Edit', edit_project_task_path(task.project,task), class: "btn btn-info" %>
        <%= link_to '', project_task_path(task.project,task), id: "Delete", method: :delete, class: "glyphicon glyphicon-remove" %>
      </td>
    </tr>
  <% end %>
</table>