diff --git a/client/components/main/globalSearch.jade b/client/components/main/globalSearch.jade index 61ef2f2c4..989075d02 100644 --- a/client/components/main/globalSearch.jade +++ b/client/components/main/globalSearch.jade @@ -13,7 +13,7 @@ template(name="globalSearchModalTitle") template(name="globalSearch") if currentUser .wrapper - form.global-search-instructions.js-search-query-form + form.global-search-page.js-search-query-form input.global-search-query-input( id="global-search-input" type="text" @@ -48,29 +48,31 @@ template(name="globalSearch") button.js-next-page | {{_ 'next-page' }} else - .global-search-instructions - h2 {{_ 'boards' }} - .lists-wrapper - each title in myBoardNames.get - span.card-label.list-title.js-board-title - = title - h2 {{_ 'lists' }} - .lists-wrapper - each title in myLists.get - span.card-label.list-title.js-list-title - = title - h2 {{_ 'label-colors' }} - .palette-colors: each label in labelColors - span.card-label.palette-color.js-label-color(class="card-label-{{label.color}}") - = label.name - if myLabelNames.get.length - h2 {{_ 'label-names' }} + .global-search-page + .global-search-help + h2 {{_ 'boards' }} .lists-wrapper - each name in myLabelNames.get - span.card-label.list-title.js-label-name - = name - +viewer - = searchInstructions + each title in myBoardNames.get + span.card-label.list-title.js-board-title + = title + h2 {{_ 'lists' }} + .lists-wrapper + each title in myLists.get + span.card-label.list-title.js-list-title + = title + h2 {{_ 'label-colors' }} + .palette-colors: each label in labelColors + span.card-label.palette-color.js-label-color(class="card-label-{{label.color}}") + = label.name + if myLabelNames.get.length + h2 {{_ 'label-names' }} + .lists-wrapper + each name in myLabelNames.get + span.card-label.list-title.js-label-name + = name + .global-search-instructions + +viewer + = searchInstructions template(name="globalSearchViewChangePopup") if currentUser diff --git a/client/components/main/globalSearch.js b/client/components/main/globalSearch.js index a251fda04..7a307b10a 100644 --- a/client/components/main/globalSearch.js +++ b/client/components/main/globalSearch.js @@ -618,83 +618,58 @@ BlazeComponent.extendComponent({ predicate_member: TAPi18n.__('predicate-member'), }; - text = `# ${TAPi18n.__('globalSearch-instructions-heading')}`; + let text = `# ${TAPi18n.__('globalSearch-instructions-heading')}`; text += `\n${TAPi18n.__('globalSearch-instructions-description', tags)}`; - text += `\n${TAPi18n.__('globalSearch-instructions-operators', tags)}`; - text += `\n* ${TAPi18n.__( + text += `\n\n${TAPi18n.__('globalSearch-instructions-operators', tags)}`; + + [ 'globalSearch-instructions-operator-board', - tags, - )}`; - text += `\n* ${TAPi18n.__( 'globalSearch-instructions-operator-list', - tags, - )}`; - text += `\n* ${TAPi18n.__( 'globalSearch-instructions-operator-swimlane', - tags, - )}`; - text += `\n* ${TAPi18n.__( 'globalSearch-instructions-operator-comment', - tags, - )}`; - text += `\n* ${TAPi18n.__( 'globalSearch-instructions-operator-label', - tags, - )}`; - text += `\n* ${TAPi18n.__( 'globalSearch-instructions-operator-hash', - tags, - )}`; - text += `\n* ${TAPi18n.__( 'globalSearch-instructions-operator-user', - tags, - )}`; - text += `\n* ${TAPi18n.__('globalSearch-instructions-operator-at', tags)}`; - text += `\n* ${TAPi18n.__( + 'globalSearch-instructions-operator-at', 'globalSearch-instructions-operator-member', - tags, - )}`; - text += `\n* ${TAPi18n.__( 'globalSearch-instructions-operator-assignee', - tags, - )}`; - text += `\n* ${TAPi18n.__('globalSearch-instructions-operator-due', tags)}`; - text += `\n* ${TAPi18n.__( + 'globalSearch-instructions-operator-due', 'globalSearch-instructions-operator-created', - tags, - )}`; - text += `\n* ${TAPi18n.__( 'globalSearch-instructions-operator-modified', - tags, - )}`; - text += `\n* ${TAPi18n.__( + 'globalSearch-instructions-operator-status', + ].forEach(instruction => { + text += `\n* ${TAPi18n.__(instruction, tags)}`; + }); + + [ 'globalSearch-instructions-status-archived', - tags, - )}`; - text += `\n* ${TAPi18n.__( 'globalSearch-instructions-status-public', - tags, - )}`; - text += `\n* ${TAPi18n.__( 'globalSearch-instructions-status-private', - tags, - )}`; - text += `\n* ${TAPi18n.__('globalSearch-instructions-status-all', tags)}`; - text += `\n* ${TAPi18n.__('globalSearch-instructions-status-ended', tags)}`; + 'globalSearch-instructions-status-all', + 'globalSearch-instructions-status-ended', + ].forEach(instruction => { + text += `\n * ${TAPi18n.__(instruction, tags)}`; + }); - text += `\n* ${TAPi18n.__('globalSearch-instructions-operator-has', tags)}`; - - text += `\n* ${TAPi18n.__('globalSearch-instructions-operator-sort', tags)}`; - - text += `\n* ${TAPi18n.__('globalSearch-instructions-operator-limit', tags)}`; + [ + 'globalSearch-instructions-operator-has', + 'globalSearch-instructions-operator-sort', + 'globalSearch-instructions-operator-limit' + ].forEach(instruction => { + text += `\n* ${TAPi18n.__(instruction, tags)}`; + }); text += `\n## ${TAPi18n.__('heading-notes')}`; - text += `\n* ${TAPi18n.__('globalSearch-instructions-notes-1', tags)}`; - text += `\n* ${TAPi18n.__('globalSearch-instructions-notes-2', tags)}`; - text += `\n* ${TAPi18n.__('globalSearch-instructions-notes-3', tags)}`; - text += `\n* ${TAPi18n.__('globalSearch-instructions-notes-3-2', tags)}`; - text += `\n* ${TAPi18n.__('globalSearch-instructions-notes-4', tags)}`; - text += `\n* ${TAPi18n.__('globalSearch-instructions-notes-5', tags)}`; + [ + 'globalSearch-instructions-notes-1', + 'globalSearch-instructions-notes-2', + 'globalSearch-instructions-notes-3', + 'globalSearch-instructions-notes-3-2', + 'globalSearch-instructions-notes-4', + 'globalSearch-instructions-notes-5', + ].forEach(instruction => { + text += `\n* ${TAPi18n.__(instruction, tags)}`; + }); return text; }, diff --git a/client/components/main/globalSearch.styl b/client/components/main/globalSearch.styl index e460f506e..66115d86c 100644 --- a/client/components/main/globalSearch.styl +++ b/client/components/main/globalSearch.styl @@ -71,17 +71,17 @@ .global-search-error-messages color: darkred -.global-search-instructions +.global-search-page width: 40% min-width: 400px margin-right: auto margin-left: auto line-height: 150% -.global-search-instructions h1 +.global-search-page h1 margin-top: 2rem; -.global-search-instructions h2 +.global-search-page h2 margin-top: 1rem; .global-search-query-input @@ -100,7 +100,7 @@ code color: black background-color: lightgrey padding: 0.1rem !important - font-size: 0.7rem !important + font-size: 0.8rem !important .list-title background-color: darkgray @@ -116,3 +116,6 @@ code .global-search-previous-page border: none text-align: left; + +.global-search-instructions li + margin-bottom: 0.3rem diff --git a/i18n/en.i18n.json b/i18n/en.i18n.json index cc23a9a37..0d435439e 100644 --- a/i18n/en.i18n.json +++ b/i18n/en.i18n.json @@ -941,27 +941,28 @@ "globalSearch-instructions-heading": "Search Instructions", "globalSearch-instructions-description": "Searches can include operators to refine the search. Operators are specified by writing the operator name and value separated by a colon. For example, an operator specification of `list:Blocked` would limit the search to cards that are contained in a list named *Blocked*. If the value contains spaces or special characters it must be enclosed in quotation marks (e.g. `__operator_list__:\"To Review\"`).", "globalSearch-instructions-operators": "Available operators:", - "globalSearch-instructions-operator-board": "`__operator_board__:title` - cards in boards matching the specified title", - "globalSearch-instructions-operator-list": "`__operator_list__:title` - cards in lists matching the specified title", - "globalSearch-instructions-operator-swimlane": "`__operator_swimlane__:title` - cards in swimlanes matching the specified title", - "globalSearch-instructions-operator-comment": "`__operator_comment__:text` - cards with a comment containing *text*.", - "globalSearch-instructions-operator-label": "`__operator_label__:color` `__operator_label__:name` - cards that have a label matching the given color or name", - "globalSearch-instructions-operator-hash": "`__operator_label_abbrev__label` - shorthand for `__operator_label__:label`", - "globalSearch-instructions-operator-user": "`__operator_user__:username` - cards where the specified user is a *member* or *assignee*", - "globalSearch-instructions-operator-at": "`__operator_user_abbrev__username` - shorthand for `user:username`", - "globalSearch-instructions-operator-member": "`__operator_member__:username` - cards where the specified user is a *member*", - "globalSearch-instructions-operator-assignee": "`__operator_assignee__:username` - cards where the specified user is an *assignee*", - "globalSearch-instructions-operator-due": "`__operator_due__:n` - cards which are due *n* days from now. `__operator_due__:__predicate_overdue__ lists all cards past their due date.", - "globalSearch-instructions-operator-created": "`__operator_created__:n` - cards which were created *n* days ago", - "globalSearch-instructions-operator-modified": "`__operator_modified__:n` - cards which were modified *n* days ago", - "globalSearch-instructions-status-archived": "`__operator_status__:__predicate_archived__` - cards that are archived.", - "globalSearch-instructions-status-all": "`__operator_status__:__predicate_all__` - all archived and unarchived cards.", - "globalSearch-instructions-status-ended": "`__operator_status__:__predicate_ended__` - cards with an end date.", - "globalSearch-instructions-status-public": "`__operator_status__:__predicate_public__` - cards only in public boards.", - "globalSearch-instructions-status-private": "`__operator_status__:__predicate_private__` - cards only in private boards.", - "globalSearch-instructions-operator-has": "`__operator_has__:field` - where *field* is one of `__predicate_attachment__`, `__predicate_checklist__`, `__predicate_description__`, `__predicate_start__`, `__predicate_due__`, `__predicate_end__`, `__predicate_assignee__` or `__predicate_member__`", - "globalSearch-instructions-operator-sort": "`__operator_sort__:sort-name` - where *sort-name* is one of `__predicate_due__`, `__predicate_created__` or `__predicate_modified__`.", - "globalSearch-instructions-operator-limit": "`__operator_limit__:n` - where *n* is the number of cards to be displayed per page expressed as a positive integer.", + "globalSearch-instructions-operator-board": "`__operator_board__: