zuzak/gov.zk

View on GitHub
views/books/book-history.pug

Summary

Maintainability
Test Coverage
//- vim:ft=jade
extends ../skeleton
block breadcrumb
  li
    a(href='/') #{__('home')}
  li
    a(href=__('/book-club')) #{__('book-club')}
  li
    a(href='/book-club/book/'+book.isbn) #{book.title}
  li #{__('history')}
  li #{user}
block title
  title #{__('history')}
block css
  link(rel='stylesheet', href='/shortlist.css')
block content
  .grid-row
    span.heading-large #{__('history-heading', {'title': book.title, 'author': book.author, 'user': user})}
    p.lede #{__('history-subtitle', { 'title': book.title, 'author': book.author})}

    table
      thead
        tr
          th #{__('history-time')}
          th #{__('history-status')}
          th #{__('history-pages')}
          th #{__('history-freeform')}
      for status in book.status[user]
        tr
          td #{new Date(status.ts).toUTCString()}
          td(class='reading-'+status.status) #{__('reading-'+status.status)}
          td #{status.pages}
          if status.freeform
            td #{status.freeform}
          else
            td