Refactored common template code

Conflicts:
	pootle/templates/projects/admin/languages.html
	pootle/templates/projects/admin/permissions.html