summaryrefslogtreecommitdiffstats
path: root/python/fatcat_web/routes.py
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2019-02-22 14:28:27 -0800
committerBryan Newbold <bnewbold@robocracy.org>2019-02-22 14:28:27 -0800
commiteebce42d74f8c0e5176bf0a0cfa8036f88a3da34 (patch)
tree762fd83d7acde23710029686fef2e021520f72ec /python/fatcat_web/routes.py
parent56826236f55b78fa1d41935e9a274d44582a4769 (diff)
downloadfatcat-eebce42d74f8c0e5176bf0a0cfa8036f88a3da34.tar.gz
fatcat-eebce42d74f8c0e5176bf0a0cfa8036f88a3da34.zip
rework container page (search, stats)
Diffstat (limited to 'python/fatcat_web/routes.py')
-rw-r--r--python/fatcat_web/routes.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/python/fatcat_web/routes.py b/python/fatcat_web/routes.py
index 693adf25..acc4b3e2 100644
--- a/python/fatcat_web/routes.py
+++ b/python/fatcat_web/routes.py
@@ -87,13 +87,24 @@ def container_view(ident):
entity = api.get_container(ident)
except ApiException as ae:
abort(ae.status)
+
+ if entity.issnl:
+ try:
+ stats = get_elastic_container_stats(entity.issnl)
+ except Exception as e:
+ stats = None
+ print(e)
+ else:
+ stats = None
+
if entity.state == "redirect":
return redirect('/container/{}'.format(entity.redirect))
if entity.state == "deleted":
return render_template('deleted_entity.html', entity=entity)
if entity.state == "active":
entity.es = container_to_elasticsearch(entity, force_bool=False)
- return render_template('container_view.html', container=entity)
+ return render_template('container_view.html',
+ container=entity, container_stats=stats)
@app.route('/creator/<ident>/history', methods=['GET'])
def creator_history(ident):