Browse Source

Update search instructions

John R. Supplee 4 years ago
parent
commit
b0e4aedd3d

+ 25 - 23
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

+ 34 - 59
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)}`;
-
-    text += `\n* ${TAPi18n.__('globalSearch-instructions-operator-has', tags)}`;
-
-    text += `\n* ${TAPi18n.__('globalSearch-instructions-operator-sort', tags)}`;
+      'globalSearch-instructions-status-all',
+      'globalSearch-instructions-status-ended',
+    ].forEach(instruction => {
+      text += `\n    * ${TAPi18n.__(instruction, 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;
   },

+ 7 - 4
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

+ 22 - 21
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__:<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 *<color>* or *<name>",
+  "globalSearch-instructions-operator-hash": "`__operator_label_abbrev__<name | color>` - shorthand for `__operator_label__:<color>` or `__operator_label__:<name>`",
+  "globalSearch-instructions-operator-user": "`__operator_user__:<username>` - cards where *<username>* 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 *<username>* is a *member*",
+  "globalSearch-instructions-operator-assignee": "`__operator_assignee__:<username>` - cards where *<username>* is an *assignee*",
+  "globalSearch-instructions-operator-due": "`__operator_due__:<n>` - cards which are due up to *<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 or less",
+  "globalSearch-instructions-operator-modified": "`__operator_modified__:<n>` - cards which were modified *<n>* days ago or less",
+  "globalSearch-instructions-operator-status": "`__operator_status__:<status>` - where *<status>* is one of the following:",
+  "globalSearch-instructions-status-archived": "`__predicate_archived__` - archived cards",
+  "globalSearch-instructions-status-all": "`__predicate_all__` - all archived and unarchived cards",
+  "globalSearch-instructions-status-ended": "`__predicate_ended__` - cards with an end date",
+  "globalSearch-instructions-status-public": "`__predicate_public__` - cards only in public boards",
+  "globalSearch-instructions-status-private": "`__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__`.  Placing a `-` in front of *<field>* searches for the absence of a value in that field (e.g. `has:-due` searches for cards without a due date).",
+  "globalSearch-instructions-operator-sort": "`__operator_sort__:<sort-name>` - where *<sort-name>* is one of `__predicate_due__`, `__predicate_created__` or `__predicate_modified__`.  For a descending sort, place a `-` in front of the sort name.",
+  "globalSearch-instructions-operator-limit": "`__operator_limit__:<n>` - where *<n>* is a positive integer expressing the number of cards to be displayed per page.",
   "globalSearch-instructions-notes-1": "Multiple operators may be specified.",
   "globalSearch-instructions-notes-2": "Similar operators are *OR*ed together.  Cards that match any of the conditions will be returned.\n`__operator_list__:Available __operator_list__:Blocked` would return cards contained in any list named *Blocked* or *Available*.",
   "globalSearch-instructions-notes-3": "Differing operators are *AND*ed together.  Only cards that match all of the differing operators are returned.  `__operator_list__:Available __operator_label__:red` returns only cards in the list *Available* with a *red* label.",