policycompass/policycompass-frontend — pull request #7 by nidico (2014-09-08 15:23:48+00:00)
Title: Create adhocracy modules

This PR creates 3 new modules:

- `AdhocracyEmbedder`, which realizes the connection with the `AdhocracySDK` frontend embedding API (it doesn't talk to the Adhocracy backend)
- `Auth`, which provides login functionality (which is realized by embedding Adhocracy)
- `Deliberation`, which provides discussion functionality (which is also realized by embedding Adhocracy).

The modules don't work if Adhocracy isn't available, therefore the config entry `ENABLE_ADHOCRACY` is set to `false` by default.

The first commit (cc37e8d) exposes the PolicyCompass config as a global variable, which is a bit ugly, but I'm not aware how to do dynamic module loading in `app.js` using dependency injection.

The Auth services is basically done - if Adhocracy is available and enabled in the PC config, the Auth service sets the proper Auth headers for all calls which use the angular `$http` service, if one logs inside the embedded Adhocracy.

The deliberation directive `showDiscussion` will change its interface in the upcoming weeks. At the moment, it requires an existing Adhocracy commentable as an argument:

This will later be changed to something which might more look like the following:

If someone has the time to look at it, feel free to comment or merge, otherwise it's okay for us to keep this in a branch, until the full functionality, including easy Adhocracy deployment can be provided by LIQD.