mixin renderPostDraftList (posts)
  if Array.isArray(posts) && (posts.length > 0)
    ul.uk-list.uk-list-divider
      each draft in posts
        li
          a(href=`/post/${draft.slug}`, title="Preview draft")= draft.title
          .uk-article-meta
            div(uk-grid).uk-grid-small.uk-flex-middle
              .uk-width-expand
                .uk-article-meta
                  div(uk-grid).uk-grid-small.uk-text-small
                    .uk-width-expand
                      a(href=`/post/${draft.slug}`, title="Edit draft")= moment(draft.created).fromNow()
                      if posts.all
                        span  by
                        a(href=`/user/${draft.author.username}`)=` ${draft.author.username}`
              .uk-width-auto
                a(href=`/post/${draft._id}/edit`).uk-display-block
                  +renderButtonIcon('fa-pen', 'edit')

              .uk-width-auto
                a(
                  href="",
                  title="Delete draft",
                  data-post-id= draft._id,
                  data-post-title= draft.title,
                  onclick="return dtp.app.deletePost(event);",
                ).uk-text-danger
                  +renderButtonIcon('fa-trash', 'delete')
  else
    .uk-margin-small You have no drafts.