Tweak phases

Add phase info in the db and tweak the templates to display.