gogits/gogs — pull request #296 by nuss-justin (2014-07-22 10:13:50+00:00)
Title: Fix unwatch button in Firefox

I just got bored and looked at the trello page for the project, where I found out that the unwatch button/link for repos doesn't work in Firefox. So I made this little commit that fixes the button/link. It seems that jQuery returns the Object.unwatch function instead of the attribute value.

I also added a condition to the repo/nav.tmpl that hides the watch/unwatch links for guests, which can't watch/unwatch repos. Until now if a guest tried to watch a repo nothing happend and the server paniced, because the repo.Action function (which handles the request) tried to access data of the (logged in) user.

It doesn't crash the server, but just returns an error(, though from my point of view it shouldn't even work, because the /:username/:response group requires a signed in user, but I haven't looked at all the functions, so it could be that I'm wrong at this point).