##// 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 442 def query_modifier():
443 443 qry = query
444 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 447 file_qry = {
447 448 'id': -10,
448 449 'value': query,
449 450 'value_display': label,
450 451 'type': 'search',
452 'subtype': 'repo',
451 453 'url': h.route_path('search_repo',
452 454 repo_name=repo_name,
453 455 _query=query_modifier())
@@ -458,12 +460,13 b' class HomeView(BaseAppView):'
458 460 qry = query
459 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 464 commit_qry = {
463 465 'id': -20,
464 466 'value': query,
465 467 'value_display': label,
466 468 'type': 'search',
469 'subtype': 'repo',
467 470 'url': h.route_path('search_repo',
468 471 repo_name=repo_name,
469 472 _query=query_modifier())
@@ -482,12 +485,13 b' class HomeView(BaseAppView):'
482 485 qry = query
483 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 489 file_qry = {
487 490 'id': -30,
488 491 'value': query,
489 492 'value_display': label,
490 493 'type': 'search',
494 'subtype': 'repo_group',
491 495 'url': h.route_path('search_repo_group',
492 496 repo_group_name=repo_group_name,
493 497 _query=query_modifier())
@@ -498,12 +502,13 b' class HomeView(BaseAppView):'
498 502 qry = query
499 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 506 commit_qry = {
503 507 'id': -40,
504 508 'value': query,
505 509 'value_display': label,
506 510 'type': 'search',
511 'subtype': 'repo_group',
507 512 'url': h.route_path('search_repo_group',
508 513 repo_group_name=repo_group_name,
509 514 _query=query_modifier())
@@ -524,6 +529,7 b' class HomeView(BaseAppView):'
524 529 'value': query,
525 530 'value_display': u'File search for: `{}`'.format(query),
526 531 'type': 'search',
532 'subtype': 'global',
527 533 'url': h.route_path('search',
528 534 _query={'q': query, 'type': 'content'})
529 535 })
@@ -533,6 +539,7 b' class HomeView(BaseAppView):'
533 539 'value': query,
534 540 'value_display': u'Commit search for: `{}`'.format(query),
535 541 'type': 'search',
542 'subtype': 'global',
536 543 'url': h.route_path('search',
537 544 _query={'q': query, 'type': 'commit'})
538 545 })
@@ -1250,6 +1250,16 b' table.integrations {'
1250 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 1263 .autocomplete-selected {
1254 1264 background: #F0F0F0;
1255 1265 }
@@ -727,7 +727,7 b' input {'
727 727
728 728 &.main_filter_input {
729 729 padding: 5px 10px;
730 min-width: 260px;
730 min-width: 340px;
731 731 color: @grey7;
732 732 background: @black;
733 733 min-height: 18px;
@@ -572,7 +572,7 b''
572 572 % endif
573 573
574 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 576 </li>
577 577 <li class="searchTag searchTagHelp">
578 578 <a href="#showFilterHelp" onclick="showMainFilterBox(); return false">?</a>
@@ -733,6 +733,7 b''
733 733 }
734 734
735 735 var searchType = data['type'];
736 var searchSubType = data['subtype'];
736 737 var valueDisplay = data['value_display'];
737 738
738 739 var pattern = '(' + escapeRegExChars(value) + ')';
@@ -749,9 +750,15 b''
749 750 if (searchType === 'hint') {
750 751 icon += '<i class="icon-repo-group"></i> ';
751 752 }
752 // full text search
753 // full text search/hints
753 754 else if (searchType === 'search') {
754 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 763 // repository
757 764 else if (searchType === 'repo') {
@@ -857,6 +864,7 b''
857 864 deferRequestBy: 300, //miliseconds
858 865 tabDisabled: true,
859 866 autoSelectFirst: false,
867 containerClass: 'autocomplete-qfilter-suggestions',
860 868 formatResult: autocompleteMainFilterFormatResult,
861 869 lookupFilter: autocompleteMainFilterResult,
862 870 onSelect: function (element, suggestion) {
General Comments 0
You need to be logged in to leave comments. Login now