Sorting by document type now works.
Added a test detail view.