frontend: move the logic about admin using his permissions from templates
The logic is a bit too complicated for being written as jinja2 macro,
so I am rewriting it in python. Also fixing a bug - the previous
implementation was displaying the warning even for group projects that
the admin belongs to.