##// END OF EJS Templates
quick-filter: added nicer UI and hints.
ergo -
r3750:20052068 new-ui
parent child Browse files
Show More
@@ -442,12 +442,14 b' class HomeView(BaseAppView):'
442 def query_modifier():
442 def query_modifier():
443 qry = query
443 qry = query
444 return {'q': qry, 'type': 'content'}
444 return {'q': qry, 'type': 'content'}
445 label = u'File search for `{}` in this repository.'.format(query)
445
446 label = u'File search for `{}`'.format(h.escape(query))
446 file_qry = {
447 file_qry = {
447 'id': -10,
448 'id': -10,
448 'value': query,
449 'value': query,
449 'value_display': label,
450 'value_display': label,
450 'type': 'search',
451 'type': 'search',
452 'subtype': 'repo',
451 'url': h.route_path('search_repo',
453 'url': h.route_path('search_repo',
452 repo_name=repo_name,
454 repo_name=repo_name,
453 _query=query_modifier())
455 _query=query_modifier())
@@ -458,12 +460,13 b' class HomeView(BaseAppView):'
458 qry = query
460 qry = query
459 return {'q': qry, 'type': 'commit'}
461 return {'q': qry, 'type': 'commit'}
460
462
461 label = u'Commit search for `{}` in this repository.'.format(query)
463 label = u'Commit search for `{}`'.format(h.escape(query))
462 commit_qry = {
464 commit_qry = {
463 'id': -20,
465 'id': -20,
464 'value': query,
466 'value': query,
465 'value_display': label,
467 'value_display': label,
466 'type': 'search',
468 'type': 'search',
469 'subtype': 'repo',
467 'url': h.route_path('search_repo',
470 'url': h.route_path('search_repo',
468 repo_name=repo_name,
471 repo_name=repo_name,
469 _query=query_modifier())
472 _query=query_modifier())
@@ -482,12 +485,13 b' class HomeView(BaseAppView):'
482 qry = query
485 qry = query
483 return {'q': qry, 'type': 'content'}
486 return {'q': qry, 'type': 'content'}
484
487
485 label = u'File search for `{}` in this repository group'.format(query)
488 label = u'File search for `{}`'.format(query)
486 file_qry = {
489 file_qry = {
487 'id': -30,
490 'id': -30,
488 'value': query,
491 'value': query,
489 'value_display': label,
492 'value_display': label,
490 'type': 'search',
493 'type': 'search',
494 'subtype': 'repo_group',
491 'url': h.route_path('search_repo_group',
495 'url': h.route_path('search_repo_group',
492 repo_group_name=repo_group_name,
496 repo_group_name=repo_group_name,
493 _query=query_modifier())
497 _query=query_modifier())
@@ -498,12 +502,13 b' class HomeView(BaseAppView):'
498 qry = query
502 qry = query
499 return {'q': qry, 'type': 'commit'}
503 return {'q': qry, 'type': 'commit'}
500
504
501 label = u'Commit search for `{}` in this repository group'.format(query)
505 label = u'Commit search for `{}`'.format(query)
502 commit_qry = {
506 commit_qry = {
503 'id': -40,
507 'id': -40,
504 'value': query,
508 'value': query,
505 'value_display': label,
509 'value_display': label,
506 'type': 'search',
510 'type': 'search',
511 'subtype': 'repo_group',
507 'url': h.route_path('search_repo_group',
512 'url': h.route_path('search_repo_group',
508 repo_group_name=repo_group_name,
513 repo_group_name=repo_group_name,
509 _query=query_modifier())
514 _query=query_modifier())
@@ -524,6 +529,7 b' class HomeView(BaseAppView):'
524 'value': query,
529 'value': query,
525 'value_display': u'File search for: `{}`'.format(query),
530 'value_display': u'File search for: `{}`'.format(query),
526 'type': 'search',
531 'type': 'search',
532 'subtype': 'global',
527 'url': h.route_path('search',
533 'url': h.route_path('search',
528 _query={'q': query, 'type': 'content'})
534 _query={'q': query, 'type': 'content'})
529 })
535 })
@@ -533,6 +539,7 b' class HomeView(BaseAppView):'
533 'value': query,
539 'value': query,
534 'value_display': u'Commit search for: `{}`'.format(query),
540 'value_display': u'Commit search for: `{}`'.format(query),
535 'type': 'search',
541 'type': 'search',
542 'subtype': 'global',
536 'url': h.route_path('search',
543 'url': h.route_path('search',
537 _query={'q': query, 'type': 'commit'})
544 _query={'q': query, 'type': 'commit'})
538 })
545 })
@@ -1250,6 +1250,16 b' table.integrations {'
1250 background-color: white;
1250 background-color: white;
1251 }
1251 }
1252
1252
1253 .autocomplete-qfilter-suggestions {
1254 width: auto !important; // overrides autocomplete.js
1255 max-height: 100% !important;
1256 min-width: 376px;
1257 margin: 0;
1258 border: @border-thickness solid @grey5;
1259 color: @grey2;
1260 background-color: white;
1261 }
1262
1253 .autocomplete-selected {
1263 .autocomplete-selected {
1254 background: #F0F0F0;
1264 background: #F0F0F0;
1255 }
1265 }
@@ -727,7 +727,7 b' input {'
727
727
728 &.main_filter_input {
728 &.main_filter_input {
729 padding: 5px 10px;
729 padding: 5px 10px;
730 min-width: 260px;
730 min-width: 340px;
731 color: @grey7;
731 color: @grey7;
732 background: @black;
732 background: @black;
733 min-height: 18px;
733 min-height: 18px;
@@ -572,7 +572,7 b''
572 % endif
572 % endif
573
573
574 <li class="searchTagInput">
574 <li class="searchTagInput">
575 <input class="main_filter_input" id="main_filter" size="15" type="text" name="main_filter" placeholder="${_('search / go to...')}" value="" />
575 <input class="main_filter_input" id="main_filter" size="25" type="text" name="main_filter" placeholder="${_('search / go to...')}" value="" />
576 </li>
576 </li>
577 <li class="searchTag searchTagHelp">
577 <li class="searchTag searchTagHelp">
578 <a href="#showFilterHelp" onclick="showMainFilterBox(); return false">?</a>
578 <a href="#showFilterHelp" onclick="showMainFilterBox(); return false">?</a>
@@ -733,6 +733,7 b''
733 }
733 }
734
734
735 var searchType = data['type'];
735 var searchType = data['type'];
736 var searchSubType = data['subtype'];
736 var valueDisplay = data['value_display'];
737 var valueDisplay = data['value_display'];
737
738
738 var pattern = '(' + escapeRegExChars(value) + ')';
739 var pattern = '(' + escapeRegExChars(value) + ')';
@@ -749,9 +750,15 b''
749 if (searchType === 'hint') {
750 if (searchType === 'hint') {
750 icon += '<i class="icon-repo-group"></i> ';
751 icon += '<i class="icon-repo-group"></i> ';
751 }
752 }
752 // full text search
753 // full text search/hints
753 else if (searchType === 'search') {
754 else if (searchType === 'search') {
754 icon += '<i class="icon-more"></i> ';
755 icon += '<i class="icon-more"></i> ';
756 if (searchSubType !== undefined && searchSubType == 'repo') {
757 valueDisplay += '<div class="pull-right tag">repository</div>';
758 }
759 else if (searchSubType !== undefined && searchSubType == 'repo_group') {
760 valueDisplay += '<div class="pull-right tag">repo group</div>';
761 }
755 }
762 }
756 // repository
763 // repository
757 else if (searchType === 'repo') {
764 else if (searchType === 'repo') {
@@ -857,6 +864,7 b''
857 deferRequestBy: 300, //miliseconds
864 deferRequestBy: 300, //miliseconds
858 tabDisabled: true,
865 tabDisabled: true,
859 autoSelectFirst: false,
866 autoSelectFirst: false,
867 containerClass: 'autocomplete-qfilter-suggestions',
860 formatResult: autocompleteMainFilterFormatResult,
868 formatResult: autocompleteMainFilterFormatResult,
861 lookupFilter: autocompleteMainFilterResult,
869 lookupFilter: autocompleteMainFilterResult,
862 onSelect: function (element, suggestion) {
870 onSelect: function (element, suggestion) {
General Comments 0
You need to be logged in to leave comments. Login now