teddim/gCamp

View on GitHub
app/views/tasks/show.html.haml

Summary

Maintainability
Test Coverage
.page-header
  = link_to "Edit", edit_project_task_path(@task.project,@task), class: "btn btn-info pull-right"
  - @task.complete ? this_class = 'strikethrough' : custom_class =''
  <h1 class = #{this_class} >#{@task.description.downcase.titleize}
%ol.breadcrumb
  %li= link_to 'Projects', projects_path
  %li= link_to @project.name, project_path(@project)
  %li= link_to 'Tasks', project_tasks_path
  %li.Active
    = @task.description
= succeed ":" do
  %strong Due On
- if @task.due_date
  = @task.due_date.strftime("%m/%d/%Y")

%h3 Comments
- @comments.each do |comment|
  .row
    .col-md-3
      - if comment.user == nil
        (deleted user)
      - else
        = link_to comment.user.full_name, user_path(comment.user_id)
      %p.text-muted
        = comment.time_in_words
    %p.col-md-9
      = comment.content

= form_for [@comment.task, @comment], html: {class: 'form-horizontal'} do |f|
  .form-group
    .col-md-offset-3.col-md-9
      = f.text_area :content, class: "form-control"
  .form-group
    .col-md-offset-3.col-md-9
      = f.submit "Add Comment", class: "btn btn-primary"