add post repository. comments can be added only to published posts. some refactor views and controllers