From 6341e13ca671ea7c3a9aa6a7ad3c3252cdc32f62 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 8 Dec 2022 14:48:36 +0100 Subject: [PATCH] show path of document/folder in typeahead search --- views/bootstrap/class.Search.php | 4 ++-- views/bootstrap/styles/application.css | 5 +++++ views/bootstrap/styles/application.js | 4 ++-- views/bootstrap4/styles/application.css | 5 +++++ views/bootstrap4/styles/application.js | 4 ++-- 5 files changed, 16 insertions(+), 6 deletions(-) diff --git a/views/bootstrap/class.Search.php b/views/bootstrap/class.Search.php index f1d3f4827..ff2ea8341 100644 --- a/views/bootstrap/class.Search.php +++ b/views/bootstrap/class.Search.php @@ -367,10 +367,10 @@ function typeahead() { /* {{{ */ foreach ($entries as $entry) { if($entry->isType('document')) { // $recs[] = 'D'.$entry->getName(); - $recs[] = array('type'=>'D', 'id'=>$entry->getId(), 'name'=>$entry->getName()); + $recs[] = array('type'=>'D', 'id'=>$entry->getId(), 'name'=>$entry->getName(), 'path'=>$entry->getParent()->getFolderPathPlain(true, '/')); } elseif($entry->isType('folder')) { // $recs[] = 'F'.$entry->getName(); - $recs[] = array('type'=>'F', 'id'=>$entry->getId(), 'name'=>$entry->getName()); + $recs[] = array('type'=>'F', 'id'=>$entry->getId(), 'name'=>$entry->getName(), 'path'=>$entry->getParent()->getFolderPathPlain(true, '/')); } } } diff --git a/views/bootstrap/styles/application.css b/views/bootstrap/styles/application.css index 10d2c690c..bc4abf2c2 100644 --- a/views/bootstrap/styles/application.css +++ b/views/bootstrap/styles/application.css @@ -265,6 +265,11 @@ span.datepicker { span.datepicker input { max-width: 100px; } + +div.typeahead span.path { + font-size: 85%; + color: #888; +} /* Sidenav for Docs * -------------------------------------------------- */ diff --git a/views/bootstrap/styles/application.js b/views/bootstrap/styles/application.js index 096c057d4..8cafbb25d 100644 --- a/views/bootstrap/styles/application.js +++ b/views/bootstrap/styles/application.js @@ -148,9 +148,9 @@ function initMost() { **/ highlighter : function (item) { if(item.type.charAt(0) == 'D') - return ' ' + item.name.replace(/ ' + item.name.replace(/' + item.path + ''; else if(item.type.charAt(0) == 'F') - return ' ' + item.name.replace(/ ' + item.name.replace(/' + item.path + ''; else return ' ' + item.name.replace(/ ' + item.name.replace(/ ' + item.name.replace(/' + item.path + ''; else if(item.type.charAt(0) == 'F') - return ' ' + item.name.replace(/ ' + item.name.replace(/' + item.path + ''; else return ' ' + item.name.replace(/