personally I would move this into a ruby method (prob in LevelsHelper) because I find haml to be hard to read for anything with a lot of conditionals.