We should avoid all logic in the views, and move it instead to the models... you can create another ticket for that anyway.