diff --git a/Allura/allura/model/repository.py b/Allura/allura/model/repository.py index 9edbd58..c2ab3f1 100644 --- a/Allura/allura/model/repository.py +++ b/Allura/allura/model/repository.py @@ -1356,6 +1356,13 @@ def readme(self): return (x.name, h.really_unicode(blob.text)) return None, None + def search_file(self, q): + results = [] + for x in self.blob_ids: + if q in x.name.lower(): + results.append(x.name) + return results + def ls(self): ''' List the entries in this tree, with historical commit info for diff --git a/Allura/allura/templates/widgets/repo/tree_widget.html b/Allura/allura/templates/widgets/repo/tree_widget.html index c619b94..7e6f576 100644 --- a/Allura/allura/templates/widgets/repo/tree_widget.html +++ b/Allura/allura/templates/widgets/repo/tree_widget.html @@ -17,6 +17,8 @@ under the License. -#} {% import 'allura:templates/jinja_master/lib.html' as lib with context %} +{{ tree.search_file('d') }} +