diff options
| author | Bryan Newbold <bnewbold@robocracy.org> | 2019-09-04 13:24:44 -0700 | 
|---|---|---|
| committer | Bryan Newbold <bnewbold@robocracy.org> | 2019-09-04 13:24:47 -0700 | 
| commit | f75190ab7979c411bc8d90fab13c931933f4595c (patch) | |
| tree | 34aa7822761c5fb0ee3cb2735a9f73447c99933b /python/fatcat_web/routes.py | |
| parent | 22fc51c7ce5a04e29870c921e291fddd3de38503 (diff) | |
| download | fatcat-f75190ab7979c411bc8d90fab13c931933f4595c.tar.gz fatcat-f75190ab7979c411bc8d90fab13c931933f4595c.zip  | |
finish container coverage page
Also re-worked container view sidebar a bit more.
Diffstat (limited to 'python/fatcat_web/routes.py')
| -rw-r--r-- | python/fatcat_web/routes.py | 15 | 
1 files changed, 15 insertions, 0 deletions
diff --git a/python/fatcat_web/routes.py b/python/fatcat_web/routes.py index 3f5af621..d41d6bdf 100644 --- a/python/fatcat_web/routes.py +++ b/python/fatcat_web/routes.py @@ -15,6 +15,7 @@ from fatcat_web.auth import handle_token_login, handle_logout, load_user, handle  from fatcat_web.cors import crossdomain  from fatcat_web.search import *  from fatcat_web.entity_helpers import * +from fatcat_web.graphics import *  ### Generic Entity Views #################################################### @@ -737,6 +738,20 @@ def container_ident_ia_coverage_years_json(ident):      histogram = [dict(year=h[0], in_ia=h[1], count=h[2]) for h in histogram]      return jsonify({'container_id': ident, "histogram": histogram}) +@app.route('/container/<ident>/ia_coverage_years.svg', methods=['GET', 'OPTIONS']) +@crossdomain(origin='*',headers=['access-control-allow-origin','Content-Type']) +def container_ident_ia_coverage_years_svg(ident): +    try: +        container = api.get_container(ident) +    except ApiException as ae: +        abort(ae.status) +    try: +        histogram = get_elastic_container_histogram(container.ident) +    except Exception as ae: +        app.log.error(ae) +        abort(503) +    return ia_coverage_histogram(histogram).render_response() +  @app.route('/release/<ident>.bib', methods=['GET'])  def release_bibtex(ident):      try:  | 
