fix document detail template and documents rating