WonSong/Often — pull request #46 by kubuscmg (2014-02-08 12:12:38+00:00)
Title: Star directive

I've created star directive with total stars count. What has been changed?
* **Model refactor**
* renamed `Stars` property to `stars`,
* added `starredByLoggedIn` which is filled before each requests for stars. We must think about changing it to mongoose virtual method, I didn;t knwo how to properly inject `request` object to get to session. Maybe other ways to get `requests`?
* **New module - `often.directives`**
* By the way it is nice convention which actually tells that here `directives` is a submodule of `often`
* **`StarService`**
* For now it only sending request to toggle the star
* **`OftenStar`** directive
* binds to `note` model in parent scope
* selecting/unselecting star based on got model
* handling star toggling
* total star count
* Star route
* new route for API toggling the star (existing method used)
* If user is not signed in while toggling a star, I put a 403 status temporarily, because clicking a star was moving to login page and that was quite annoying. We must think about some message system, which would tell that user should be logged in first.

Feel free to code-review! :) Any notes and suggestions are welcome :)