fixed a bug in permissions check for contact and address editing; migrated some templates from erb to HAML