WebSearch: fix for record numbering in pagination

* Adds optional `nb_found` argument to `print_records` allowing for a
  different list of records to be printed and number of records found,
  when we are only printing a subset of a total number of records
  found.  (closes #1762) (PR #1763)

Signed-off-by: Nikolaos Kasioumis <nikolaos.kasioumis@cern.ch>
Reviewed-by: Tibor Simko <tibor.simko@cern.ch>
WebSubmit: link to successfully created record

* Shows link to new record if possible.  (closes #1641)

Signed-off-by: Patrick Glauner <patrick.oliver.glauner@cern.ch>
Tested-by: Tibor Simko <tibor.simko@cern.ch>
BibRank: fix of similar-to-recid result order

* Fixes order of results.  (addresses #1745) (PR #2236)

Signed-off-by: Patrick Glauner <patrick.oliver.glauner@cern.ch>
Reviewed-by: Tibor Simko <tibor.simko@cern.ch>
SolrUtils: fix of similar-to-recid result order

* Fixes order of results.  (closes #1745) (PR #2236)

Signed-off-by: Patrick Glauner <patrick.oliver.glauner@cern.ch>
Reviewed-by: Tibor Simko <tibor.simko@cern.ch>
docs: initial release of CONTRIBUTING guide

* Adds `CONTRIBUTING.rst` guide, taken from our old Trac wiki site,
  reusing the old content, updating it only slightly so far.
  (closes #2163)

Signed-off-by: Tibor Simko <tibor.simko@cern.ch>
Merge branch 'maint-1.0' into maint-1.1

* maint-1.0:
  docs: initial release of CONTRIBUTING guide

Signed-off-by: Tibor Simko <tibor.simko@cern.ch>
Merge branch 'maint-1.1'

* maint-1.1:
  docs: initial release of CONTRIBUTING guide

Signed-off-by: Tibor Simko <tibor.simko@cern.ch>
WebSearch: richer `/record` and `/search` API docs

* Enriches documentation about `/search` API with new sections
  describing XML API and JSON API, with notes and usage examples.
  (addresses #2303)

* Adds new "Record API" documentation describing `/record/` API, with
  notes and usage examples.

Signed-off-by: Tibor Simko <tibor.simko@cern.ch>
errorlib: context support in sentry

* Introduces support for HTTP, and user context in sentry, by
  exploiting information provided in req object when available.
  (closes #1960) (PR #2147)

Signed-off-by: Samuele Kaplun <samuele.kaplun@cern.ch>
Tested-by: Tibor Simko <tibor.simko@cern.ch>
WebSearch: kwalitee fix

* Runs `autopep8` on `websearch_services_regression_tests.py`.
  (PR #2352)

Signed-off-by: Federico Poli <federico.poli@cern.ch>
Tested-by: Tibor Simko <tibor.simko@cern.ch>
WebSearch: new Journal Hint Service

* Adds the Journal Hint Service, that displays
  'Were you looking for a journal reference? Try: <link>'
  when the user search for a raw journal reference.
  (PR #2352)

* Adds unit and regression tests for the new search service.

* Adds two unit tests to `search_from_reference`, just to be sure that
  it accepts unicode.

Signed-off-by: Federico Poli <federico.poli@cern.ch>
Reviewed-by: Samuele Kaplun <samuele.kaplun@cern.ch>
Reviewed-by: Tibor Simko <tibor.simko@cern.ch>
WebSearch: smarter journal hint

* Improves the JournalHintService implementation by directly
  a brief representation of a record when one is found.
  (PR #2352)

* Additionally, suggests to use find rawref "foo" when "foo"
  is searched for, rather than journal:"bar".

Signed-off-by: Samuele Kaplun <samuele.kaplun@cern.ch>
Tested-by: Tibor Simko <tibor.simko@cern.ch>
BibSort: improved washers

* Improves speed and realiability of BibSort washers by properly
  exploiting textutils.decode_to_unicode() and
  textutils.translate_to_ascii() functions.
  (PR #2283)

* Improves speed of textutils.translate_to_ascii().
  (addresses #1754)

* Introduces new washer
  _sort_nosymbols_case_insensitive_strip_accents().

* Makes unidecode dependency mandatory.

Signed-off-by: Samuele Kaplun <samuele.kaplun@cern.ch>
Tested-by: Tibor Simko <tibor.simko@cern.ch>
BibDocFile: bibdocfile.BibDoc memory fix

* Fixes a memory leak in BibDocFile module where BibDoc instances were
  referring to BibDocFiles and viceversa, by using weakref.ref().
  (closes #2082) (PR #2136)

Signed-off-by: Samuele Kaplun <samuele.kaplun@cern.ch>
Reported-by: Thorsten Schwander <thorsten.schwander@gmail.com>
Tested-by: Tibor Simko <tibor.simko@cern.ch>
errorlib: fix Sentry context syntax issue

* Fixes Python syntax issue that slipped in the Sentry context support
  commit d73bd94b2fbe8666af31dfec25c334c466e6f6df.
  (addresses #1960) (PR #2147)

Signed-off-by: Tibor Simko <tibor.simko@cern.ch>
BibCirculation: fix for CERN returnees

Acked-by: Tibor Simko <tibor.simko@cern.ch>
BibMerge:  added CFG_SITE_RECORD as script data

Signed-off-by: Øystein Blixhavn <oystein@tind.io>
BibCirculation: fix bug blocking library creation

* Fixes a bug due to a wrong argument washing name, indeed
  req argument name is lib_type, argument name waited was
  type.

* Reactivates the creation of library in bibcirculation.

Signed-off-by: Guillaume Lastecoueres <guillaume@tind.io>
BibRank: Fix path for usage statistics graph

* Fixes an error in the path of the the usage statistics graph.

Signed-off-by: Guillaume Lastecoueres <guillaume@tind.io>
WebStat: Enable custom summary

* Adds the dependency matplotlib.

* Fixes the fact that path was always printed.

* Removes annoying try except.

Signed-off-by: Guillaume Lastecoueres <guillaume@tind.io>