move logic out of template

Also just drop some of it as redundant (the check for whether the user
could see permissions was the same as whether they could view the
character)
Merge pull request #308 from eve-val/trim-template-logic

move logic out of template