Fix if for foreach loop in templates show appointment

Signed-off-by: Atanas Kerezov <kerezov.atanas@gmail.com>