cozy/cozy-files — pull request #124 by jsilvestre (2014-06-30 15:26:44+00:00)
Title: Merged private and shared areas

C/C from #120

* minor fixes prior to anterior modifications
* refactored the code so the shared area reuses as much code as possible from the private area

The merge exposes more things to the public API so we must be really careful that we don't leak any private information. I wrote a middleware to handle authentication in public routes but I have not a complete knowledge of cozy-clearance so it might be worthy to plan a pair-programing refactoring on that (@aenario and I already agreed on that).

I put emphasis on reusing as much code as possible and I tried to reduce all the tricky "if app.isPublic then...".
* features (buttons, controls) that should be hidden are hidden from CSS
* additionnal behaviour (features that are not in the private area, such as guest notifications) is added from the PublicFolderView (that extends the FolderView)
* URL differences and model stuff are handled by tricky "if app.isPublic then..."s

I will improve the code (mostly the server code) in future PRs as the implementation of the "guest mode" goes (a guest can see all folders and files shared with it).