gogits/gogs — pull request #716 by ErebusBat (2014-12-05 18:11:14+00:00)
Title: Fix Gravatar images in web view (like commit listing)

Related to #700 and PR-#708

In the original bug report it was referencing only the sytem avatar images for system users (like in the header); however the problem also persists with things like commit history.

This commit fixes the `tool.AvatarLink` function so that it also uses the already existing `avatar.HashEmail` function.

I also refactored the `tool.AvatarLink` method some to make the control flow more apparent and adhere better to DRY (there were multiple calls to the `EncodeMd5` function that the `HashEmail` function call replaced, now there is only one.)