Fix broken links to glviewer and attachments

Hardcoded relative links are replaced with calls to url_for to the view
endpoint.
Merge branch 'fix_glviewer_endpoint'

* fix_glviewer_endpoint:
  Fix broken links to glviewer and attachments