records: acl hook added to record documents.

* Add new model to represent documents attached to one or more records.

* Add pre hook to the default ACL to check user rights over the records
  that the document belong to.

* New record config variable `RECORD_DOCUMENT_VIEWRESTR_POLICY` to
  specify the access policy over documents attached to one or more
  records.

Signed-off-by: Esteban J. G. Gabancho <esteban.gabancho@gmail.com>
linkbacks: jinja base templates renaming

Signed-off-by: Eirini Psallida <eirini.psallida@cern.ch>
messages: jinja base templates renaming

Signed-off-by: Eirini Psallida <eirini.psallida@cern.ch>
oauth2server: jinja base templates renaming

Signed-off-by: Eirini Psallida <eirini.psallida@cern.ch>
pages: jinja base templates renaming

Signed-off-by: Eirini Psallida <eirini.psallida@cern.ch>
records: jinja base templates renaming

Signed-off-by: Eirini Psallida <eirini.psallida@cern.ch>
cloudconnector: jinja base templates renaming

Signed-off-by: Eirini Psallida <eirini.psallida@cern.ch>
access: file renaming

*Moves files to `admin/` directory

Signed-off-by: Eirini Psallida <eirini.psallida@cern.ch>
search: jinja base templates renaming

Signed-off-by: Eirini Psallida <eirini.psallida@cern.ch>
assets: less flavor of bootstrap

* Installing less and grunt-contrib-less.

* Adding the filters parameter on the assets.
  `{% css "foo.css", "00-bundle", "less" %}`

* Adding some configuration keys.
  LESS_BIN which must be pointing to lessc.
  CLEANCSS_BIN ditto for CleanCSS
  LESS_RUN_IN_DEBUG (default True) to enable or disable the less
  bundling in DEBUG. ASSETS_DEBUG must be also set to True for
  it to work.

* Renamed base.css to base.less and it includes the less files from
  Bootstrap and Font-Awesome.

Signed-off-by: Yoan Blanc <yoan.blanc@cern.ch>
docs: fix of sphinx warnings.

* Fixing all the warnings given by sphinx during compilation.

* Fixing the PEP8, PyFlakes and PEP257 warnings of the touched files.

* Adding some intersphinx.

* Reading the theme from docs/requirements.txt.

Signed-off-by: Yoan Blanc <yoan.blanc@cern.ch>
merger: syntax fix

Signed-off-by: Jiri Kuncar <jiri.kuncar@cern.ch>
assets: fix bundle builder

Signed-off-by: Jiri Kuncar <jiri.kuncar@cern.ch>
assets: error logging if binary are missing

* Adding a check for LESS_BIN and CLEANCSS_BIN presence at startup.
  It switches to ASSETS_DEBUG=True if you ignore the error message.

Signed-off-by: Yoan Blanc <yoan.blanc@cern.ch>
Reported-by: Esteban J. G. Gabancho <esteban.gabancho@gmail.com>
workflows: abstraction layer for workers

* Adds an abstract class to be used like a base for
  worker wrapper.

* Implements a worker wrapper for abstraction for
  celery worker.

* Starts the implementation of a worker wrapper for
  redis worker.

* Fixes PEP8 and sphinx documentation specification.

* Fixes mistake about iteritems with six.

Signed-off-by: Guillaume Lastecoueres <guillaume.lastecoueres@cern.ch>
workflows: more unit tests

* Adds more unit tests to the workflows module, including
  new test workflows. Coverage should now be about 50%.

* Modifies API internals for unit tests conformation.

* Adds one file for tests which are using asynchronous
  worker to compute.

* Corrects unit tests.

Signed-off-by: Guillaume Lastecoueres <guillaume.lastecoueres@cern.ch>
workflows: global improvement

* Updates workflow to comply with the modification in
  tasks librairies.

* Fixes an error with the new ObjectVersion type with
  python3.

* Fixes sphinx mistakes.

* Removes useless regex.

* Fixes PEP8 mistakes.

* Adds more documentation to some functions.

* Removes useless and obsolete code, factorize some parts.

* Changes the start workflow function to give the
  possibility to start from a new clean BibWorkflowObject.

* Adds the refresh frequency as a parameter for workflows
  synchronisation.

Signed-off-by: Guillaume Lastecoueres <guillaume.lastecoueres@cern.ch>
oaiharvest: PEP8 and errors category

* Fixes PEP8 errors in a strict way.

* Allows log of errors of loglevel=40 in oaiharvest.

Signed-off-by: Guillaume Lastecoueres <guillaume.lastecoueres@cern.ch>
workflows: overhaul update

* Adds more documentation.

* Fixes some sphinx errors in documentation.

* Changes imports to relives one when possible.

* Adds a new way to handle errors, to allow easy reading.

* Removes obfuscations of exceptions.

* Clarifies exceptions.

* Updates the way exception unicodes are handling.

* Fixes the behaviour of stop_on_error.

* Adds python 3 compatibility when possible.

* Adds a method to clean extra_data in a Wfe.

* Fixes problems with python 2.6 loggers.

* Adds reliable way to handle types for BibworkflowObject.

* Adds a method to get widget message easily.

* Adds an abstraction method for bibfield conversion in
  workflow tasks.

* Adds more tests.

* Adds start test procedure.

* Fixes bad sorting instructions in bibholdingpen.

* Improves the way of restarting workflows.

* Simplifies celery worker.

* Reorganizes tree of the module.

* Tasks cleaning and optimizations.

Signed-off-by: Guillaume Lastecoueres <guillaume.lastecoueres@cern.ch>
workflows: holdingpen improvement

* Removes selection of row on link click.

* Changes the way of update data in approval widget.

* Changes the way of handling widget in pages.

* Changes the way of managing tags.

* Adds retrocompatibility for _widget field in extra_data.

* Simplifies the handling of informations in the http
  request.

* Adds new way to extract data from bwOject.

Signed-off-by: Guillaume Lastecoueres <guillaume.lastecoueres@cern.ch>