$ungettext('1 hit', '%(count)s hits', response['numFound'], count=commify(response['numFound']))
$if q and 'error' in results: $for line in results['error'].splitlines(): $line $if not loop.last:$if q and 'error' not in results:
-
$for doc in response['docs']:
$ n = doc['name']
$ key = '/subjects/' + url_map.get(doc['type'], '') + n.lower().replace(' ', '_').replace('?', '').replace(',', '').replace('/', '')
- $n $code: def find_type(): if doc['type'] == 'time': return "type_time" elif doc['type'] == 'subject': return "type_subject" elif doc['type'] == 'place': return "type_place" elif doc['type'] == 'org': return "type_org" elif doc['type'] == 'event': return "type_event" elif doc['type'] == 'person': return "type_person" elif doc['type'] == 'work': return "type_work" else: return "other" type = find_type() if type == "type_time": note = '' + _("time") + '' elif type == "type_subject": note = '' + _("subject") + '' elif type == "type_place": note = '' + _("place") + '' elif type == "type_org": note = '' + _("org") + '' elif type == "type_event": note = '' + _("event") + '' elif type == "type_person": note = '' + _("person") + '' elif type == "type_work": note = '' + _("work") + '' else: note = doc['type'] $ungettext('1 book', '%(count)d books', doc['count'], count=doc['count']), $:note