Commit 98d1f6b8 authored by Tom Mortimer-Jones's avatar Tom Mortimer-Jones
Browse files

[noticket] Display search term at the top of results

parent c5a9c662
......@@ -415,10 +415,13 @@ class PublisherController(OrganizationController):
if request.params.get('org_name'):
q = q.filter_by(name=request.params.get('org_name'))
org = model.Session.query(model.Group).filter_by(name=request.params.get('org_name')).one()
c.search_term = org.title
elif request.params.get('parent_name'):
parent = model.Session.query(model.Group).filter_by(name=request.params.get('parent_name')).one()
child_ids = [ch[0] for ch in parent.get_children_group_hierarchy(type='organization')]
q = q.filter(model.Group.id.in_([parent.id] + child_ids))
c.search_term = parent.title
c.count = q.count()
......
......@@ -27,6 +27,8 @@
</select>
</form>
<h1 py:if="c.search_term">You selected: ${c.search_term}</h1>
${paginator(c.page)}
<table py:if="c.count" width="100%" class="table table-bordered">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment