marnen/duckbill

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

Summary

Maintainability
Test Coverage
- content_for :title do
  = _ 'Invoice'

.pdf-controls
  = link_to invoice_path(@invoice, format: :pdf), class: :view do
    %span.fi-page-pdf
    = _ 'View as PDF'

%section.invoice
  .row
    .user
      .header= _ 'From:'
      %div= simple_format @user.name_and_address

    .number-and-date
      .invoice-number
        %span.header= _ 'Invoice no.:'
        = @invoice.number
      .invoice-date
        %span.header= _ 'Invoice date:'
        = cell(:formatted_date, date: @invoice.created_at).call

  .row
    .client
      .header= _ 'To:'
      %div= simple_format @client.name_and_address

    .project
      %span.header= _ 'Project:'
      = @project.name

  %table.time_entries
    %thead
      %tr
        %th.date= _ 'Date'
        %th.description= _ 'Description'
        %th.hours= _ 'Hours'
        %th.notes= _ 'Notes'
    %tbody= render partial: 'time_entry', collection: @time_entries