diff options
| author | rr- | 2016-04-17 00:03:45 +0200 |
|---|---|---|
| committer | rr- | 2016-04-17 00:03:45 +0200 |
| commit | 925bfcecc5bb29bf4cff521d82b569a078bc2612 (patch) | |
| tree | 97bb47957ec97b3e7985c30630f6e521bcc50189 /client | |
| parent | 9247e115968e206eea1105f6eba664c824065ffa (diff) | |
client/help: split search help into sections
Diffstat (limited to 'client')
| -rw-r--r-- | client/css/help.styl | 7 | ||||
| -rw-r--r-- | client/html/help-search-general.hbs | 87 | ||||
| -rw-r--r-- | client/html/help-search-posts.hbs | 172 | ||||
| -rw-r--r-- | client/html/help-search-tags.hbs | 129 | ||||
| -rw-r--r-- | client/html/help-search-users.hbs | 81 | ||||
| -rw-r--r-- | client/html/help-search.hbs | 487 | ||||
| -rw-r--r-- | client/html/help.hbs | 2 | ||||
| -rw-r--r-- | client/html/user_list_header.hbs | 2 | ||||
| -rw-r--r-- | client/js/controllers/help_controller.js | 8 | ||||
| -rw-r--r-- | client/js/views/help_view.js | 29 |
10 files changed, 521 insertions, 483 deletions
diff --git a/client/css/help.styl b/client/css/help.styl index a2532ac..dfd3bcd 100644 --- a/client/css/help.styl +++ b/client/css/help.styl @@ -15,3 +15,10 @@ font-size: 1.6em &:first-child margin-top: 0 + nav + text-align: center + ul + margin: 0 auto + text-align: left + nav.secondary + font-size: 0.95em diff --git a/client/html/help-search-general.hbs b/client/html/help-search-general.hbs new file mode 100644 index 0000000..27ee963 --- /dev/null +++ b/client/html/help-search-general.hbs @@ -0,0 +1,87 @@ +<p>Search queries are built of tokens that are separated by spaces. Each token +can be of following form:</p> + +<table> + <thead> + <tr> + <th>Syntax</th> + <th>Token type</th> + <th>Description</th> + </tr> + </thead> + <tbody> + <tr> + <td><code><value></code></td> + <td>anonymous tokens</td> + <td>basic filters</td> + </tr> + <tr> + <td><code><key>:<value></code></td> + <td>named tokens</td> + <td>advanced filters</td> + </tr> + <tr> + <td><code>order:<style></code></td> + <td>order tokens</td> + <td>sort results</td> + </tr> + <tr> + <td><code>special:<value></code></td> + <td>special tokens</td> + <td>filters usually tied to the logged in user</td> + </tr> + </tbody> +</table> + +<p>Most of anonymous and named tokens support ranged and composite values that +take following form:</p> + +<table> + <tbody> + <tr> + <td><code>a,b,c</code></td> + <td>will show things that satisfy either <code>a</code>, + <code>b</code> or <code>c</code>.</td> + </tr> + <tr> + <td><code>1..</code></td> + <td>will show things that are equal to or greater than 1.</td> + </tr> + <tr> + <td><code>..4</code></td> + <td>will show things that are equal to at most 4.</td> + </tr> + <tr> + <td><code>1..4</code></td> + <td>will show things that are equal to 1, 2, 3 or 4.</td> + </tr> + </tbody> +</table> + +<p>Date/time values can be of following form:</p> + +<ul> + <li><code>today</code></li> + <li><code>yesterday</code></li> + <li><code><year></code></li> + <li><code><year>-<month></code></li> + <li><code><year>-<month>-<day></code></li> +</ul> + +<p>Some fields, such as user names, can take wildcards (<code>*</code>).</p> + +<p>All tokens can be negated by prepending them with <code>-</code>.</p> + +<p>Order token values can be appended with <code>,asc</code> or +<code>,desc</code> to control the sort direction, which can be also controlled +by negating the whole token.</p> + +<h1>Example</h1> + +<p>Searching for posts with following query:</p> + +<pre><code>sea -fav-count:8.. type:swf uploader:Pirate</code></pre> + +<p>will show flash files tagged as sea, that were liked by seven people at +most, uploaded by user Pirate.</p> + diff --git a/client/html/help-search-posts.hbs b/client/html/help-search-posts.hbs new file mode 100644 index 0000000..1c17aa4 --- /dev/null +++ b/client/html/help-search-posts.hbs @@ -0,0 +1,172 @@ +<p><strong>Anonymous tokens</strong></p> + +<p>Filter posts tagged with given <code><value></code>.</p> + +<p><strong>Named tokens</strong></p> + +<table> + <tbody> + <tr> + <td><code>id</code></td> + <td>having specific post ID</td> + </tr> + <tr> + <td><code>score</code></td> + <td>having given score</td> + </tr> + <tr> + <td><code>uploader</code></td> + <td>uploaded by given user</td> + </tr> + <tr> + <td><code>comment</code></td> + <td>commented by given user</td> + </tr> + <tr> + <td><code>fav</code></td> + <td>favorited by given user</td> + </tr> + <tr> + <td><code>fav-count</code></td> + <td>favorited by given number of users</td> + </tr> + <tr> + <td><code>comment-count</code></td> + <td>having given number of comments</td> + </tr> + <tr> + <td><code>tag-count</code></td> + <td>having given number of tags</td> + </tr> + <tr> + <td><code>note-count</code></td> + <td>having given number of annotations</td> + </tr> + <tr> + <td><code>feature-count</code></td> + <td>having been featured given number of times</td> + </tr> + <tr> + <td><code>date</code></td> + <td>posted at given date</td> + </tr> + <tr> + <td><code>file-size</code></td> + <td>having given file size (in bytes)</td> + </tr> + <tr> + <td><code>image-width</code></td> + <td>having given image width (where applicable)</td> + </tr> + <tr> + <td><code>image-height</code></td> + <td>having given image height (where applicable)</td> + </tr> + <tr> + <td><code>image-area</code></td> + <td>having given number of pixels (image width * image height)</td> + </tr> + <tr> + <td><code>type</code></td> + <td>given type of posts (<code><value></code> can be either <code>image</code>, <code>flash</code>/<code>swf</code>, <code>youtube</code>/<code>yt</code>, <code>video</code> or <code>animation</code>)</td> + </tr> + </tbody> +</table> + +<p><strong>Order tokens</strong></p> + +<table> + <tbody> + <tr> + <td><code>random</code></td> + <td>as random as it can get</td> + </tr> + <tr> + <td><code>id</code></td> + <td>highest to lowest post ID</td> + </tr> + <tr> + <td><code>score</code></td> + <td>highest scored</td> + </tr> + <tr> + <td><code>fav-count</code></td> + <td>loved by most</td> + </tr> + <tr> + <td><code>comment-count</code></td> + <td>most commented first</td> + </tr> + <tr> + <td><code>tag-count</code></td> + <td>with most tags</td> + </tr> + <tr> + <td><code>note-count</code></td> + <td>with most annotations</td> + </tr> + <tr> + <td><code>file-size</code></td> + <td>largest files first</td> + </tr> + <tr> + <td><code>image-width</code></td> + <td>widest images first</td> + </tr> + <tr> + <td><code>image-height</code></td> + <td>tallest images first</td> + </tr> + <tr> + <td><code>image-area</code></td> + <td>largest images first</td> + </tr> + <tr> + <td><code>creation-date</code></td> + <td>newest to oldest (pretty much same as <code>id</code>)</td> + </tr> + <tr> + <td><code>edit-date</code></td> + <td>like <code>creation-date</code>, only looks at last edit time</td> + </tr> + <tr> + <td><code>fav-date</code></td> + <td>recently added to favorites by anyone</td> + </tr> + <tr> + <td><code>comment-date</code></td> + <td>recently commented by anyone</td> + </tr> + <tr> + <td><code>feature-date</code></td> + <td>recently featured</td> + </tr> + <tr> + <td><code>feature-count</code></td> + <td>most often featured</td> + </tr> + </tbody> +</table> + +<p><strong>Special tokens</strong></p> + +<table> + <tbody> + <tr> + <td><code>liked</code></td> + <td>posts liked by currently logged in user</td> + </tr> + <tr> + <td><code>disliked</code></td> + <td>posts disliked by currently logged in user</td> + </tr> + <tr> + <td><code>fav</code></td> + <td>posts added to favorites by currently logged in user</td> + </tr> + <tr> + <td><code>tumbleweed</code></td> + <td>posts with score of 0, without comments and without favorites</td> + </tr> + </tbody> +</table> diff --git a/client/html/help-search-tags.hbs b/client/html/help-search-tags.hbs new file mode 100644 index 0000000..666881a --- /dev/null +++ b/client/html/help-search-tags.hbs @@ -0,0 +1,129 @@ +<p><strong>Anonymous tokens</strong></p> + +<p>Same as <code>name</code> token.</p> + +<p><strong>Named tokens</strong></p> + +<table> + <tbody> + <tr> + <td><code>name</code></td> + <td>having given name (accepts wildcards)</td> + </tr> + <tr> + <td><code>category</code></td> + <td>having given category</td> + </tr> + <tr> + <td><code>creation-date</code></td> + <td>created at given date</td> + </tr> + <tr> + <td><code>creation-time</code></td> + <td>alias of <code>creation-date</code></td> + </tr> + <tr> + <td><code>last-edit-date</code></td> + <td>edited at given date</td> + </tr> + <tr> + <td><code>last-edit-time</code></td> + <td>alias of <code>last-edit-date</code></td> + </tr> + <tr> + <td><code>edit-date</code></td> + <td>alias of <code>last-edit-date</code></td> + </tr> + <tr> + <td><code>edit-time</code></td> + <td>alias of <code>last-edit-date</code></td> + </tr> + <tr> + <td><code>usages</code></td> + <td>used in given number of posts</td> + </tr> + <tr> + <td><code>usage-count</code></td> + <td>alias of <code>usages</code></td> + </tr> + <tr> + <td><code>post-count</code></td> + <td>alias of <code>usages</code></td> + </tr> + <tr> + <td><code>suggestion-count</code></td> + <td>with given number of suggestions</td> + </tr> + <tr> + <td><code>implication-count</code></td> + <td>with given number of implications</td> + </tr> + </tbody> +</table> + +<p><strong>Order tokens</strong></p> + +<table> + <tbody> + <tr> + <td><code>random</code></td> + <td>as random as it can get</td> + </tr> + <tr> + <td><code>name</code></td> + <td>A to Z</td> + </tr> + <tr> + <td><code>category</code></td> + <td>category (A to Z)</td> + </tr> + <tr> + <td><code>creation-date</code></td> + <td>recently created first</td> + </tr> + <tr> + <td><code>creation-time</code></td> + <td>alias of <code>creation-date</code></td> + </tr> + <tr> + <td><code>last-edit-date</code></td> + <td>recently edited first</td> + </tr> + <tr> + <td><code>last-edit-time</code></td> + <td>alias of <code>creation-time</code></td> + </tr> + <tr> + <td><code>edit-date</code></td> + <td>alias of <code>creation-time</code></td> + </tr> + <tr> + <td><code>edit-time</code></td> + <td>alias of <code>creation-time</code></td> + </tr> + <tr> + <td><code>usages</code></td> + <td>used in most posts first</td> + </tr> + <tr> + <td><code>usage-count</code></td> + <td>alias of <code>usages</code></td> + </tr> + <tr> + <td><code>post-count</code></td> + <td>alias of <code>usages</code></td> + </tr> + <tr> + <td><code>suggestion-count</code></td> + <td>with most suggestions first</td> + </tr> + <tr> + <td><code>implication-count</code></td> + <td>with most implications first</td> + </tr> + </tbody> +</table> + +<p><strong>Special tokens</strong></p> + +<p>None.</p> diff --git a/client/html/help-search-users.hbs b/client/html/help-search-users.hbs new file mode 100644 index 0000000..31cbc12 --- /dev/null +++ b/client/html/help-search-users.hbs @@ -0,0 +1,81 @@ +<p><strong>Anonymous tokens</strong></p> + +<p>Same as <code>name</code> token.</p> + +<p><strong>Named tokens</strong></p> + +<table> + <tbody> + <tr> + <td><code>name</code></td> + <td>having given name (doesn't accept wildcards yet)</td> + </tr> + <tr> + <td><code>creation-date</code></td> + <td>registered at given date</td> + </tr> + <tr> + <td><code>creation-time</code></td> + <td>alias of <code>creation-date</code></td> + </tr> + <tr> + <td><code>last-login-date</code> + <td>whose most recent login date matches given date</td> + </tr> + <tr> + <td><code>last-login-time</code> + <td>alias of <code>last-login-date</code> + </tr> + <tr> + <td><code>login-date</code> + <td>alias of <code>last-login-date</code> + </tr> + <tr> + <td><code>login-time</code></td> + <td>alias of <code>last-login-date</code> + </tr> + </tbody> +</table> + +<p><strong>Order tokens</strong></p> + +<table> + <tbody> + <tr> + <td><code>random</code></td> + <td>as random as it can get</td> + </tr> + <tr> + <td><code>name</code></td> + <td>A to Z</td> + </tr> + <tr> + <td><code>creation-date</code></td> + <td>newest to oldest</td> + </tr> + <tr> + <td><code>creation-time</code></td> + <td>alias of <code>creation-date</code></td> + </tr> + <tr> + <td><code>last-login-date</code></td> + <td>recently active first</td> + </tr> + <tr> + <td><code>last-login-time</code></td> + <td>alias of <code>last-login-date</code></td> + </tr> + <tr> + <td><code>login-date</code></td> + <td>alias of <code>last-login-date</code></td> + </tr> + <tr> + <td><code>login-time</code></td> + <td>alias of <code>last-login-date</code></td> + </tr> + </tbody> +</table> + +<p><strong>Special tokens</strong></p> + +<p>None.</p> diff --git a/client/html/help-search.hbs b/client/html/help-search.hbs index ddbe5c1..8771e6b 100644 --- a/client/html/help-search.hbs +++ b/client/html/help-search.hbs @@ -1,479 +1,10 @@ -<h1>General search syntax</h1> +<nav class='text-nav secondary'><!-- + --><ul><!-- + --><li data-name='default'><a href='/help/search'>General</a></li><!-- + --><li data-name='posts'><a href='/help/search/posts'>Posts</a></li><!-- + --><li data-name='users'><a href='/help/search/users'>Users</a></li><!-- + --><li data-name='tags'><a href='/help/search/tags'>Tags</a></li><!-- + --></ul><!-- +--></nav> -<p>Search queries are built of tokens that are separated by spaces. Each token -can be of following form:</p> - -<table> - <thead> - <tr> - <th>Syntax</th> - <th>Token type</th> - <th>Description</th> - </tr> - </thead> - <tbody> - <tr> - <td><code><value></code></td> - <td>anonymous tokens</td> - <td>basic filters</td> - </tr> - <tr> - <td><code><key>:<value></code></td> - <td>named tokens</td> - <td>advanced filters</td> - </tr> - <tr> - <td><code>order:<style></code></td> - <td>order tokens</td> - <td>sort results</td> - </tr> - <tr> - <td><code>special:<value></code></td> - <td>special tokens</td> - <td>filters usually tied to the logged in user</td> - </tr> - </tbody> -</table> - -<p>Most of anonymous and named tokens support ranged and composite values that -take following form:</p> - -<table> - <tbody> - <tr> - <td><code>a,b,c</code></td> - <td>will show things that satisfy either <code>a</code>, - <code>b</code> or <code>c</code>.</td> - </tr> - <tr> - <td><code>1..</code></td> - <td>will show things that are equal to or greater than 1.</td> - </tr> - <tr> - <td><code>..4</code></td> - <td>will show things that are equal to at most 4.</td> - </tr> - <tr> - <td><code>1..4</code></td> - <td>will show things that are equal to 1, 2, 3 or 4.</td> - </tr> - </tbody> -</table> - -<p>Date/time values can be of following form:</p> - -<ul> - <li><code>today</code></li> - <li><code>yesterday</code></li> - <li><code><year></code></li> - <li><code><year>-<month></code></li> - <li><code><year>-<month>-<day></code></li> -</ul> - -<p>Some fields, such as user names, can take wildcards (<code>*</code>).</p> - -<p>All tokens can be negated by prepending them with <code>-</code>.</p> - -<p>Order token values can be appended with <code>,asc</code> or -<code>,desc</code> to control the sort direction, which can be also controlled -by negating the whole token.</p> - -<h1>Example</h1> - -<p>Searching for posts with following query:</p> - -<pre><code>sea -fav-count:8.. type:swf uploader:Pirate</code></pre> - -<p>will show flash files tagged as sea, that were liked by seven people at -most, uploaded by user Pirate.</p> - -<h1 id='post-search-help'>Post search tokens</h1> - -<p><strong>Anonymous tokens</strong></p> - -<p>Filter posts tagged with given <code><value></code>.</p> - -<p><strong>Named tokens</strong></p> - -<table> - <tbody> - <tr> - <td><code>id</code></td> - <td>having specific post ID</td> - </tr> - <tr> - <td><code>score</code></td> - <td>having given score</td> - </tr> - <tr> - <td><code>uploader</code></td> - <td>uploaded by given user</td> - </tr> - <tr> - <td><code>comment</code></td> - <td>commented by given user</td> - </tr> - <tr> - <td><code>fav</code></td> - <td>favorited by given user</td> - </tr> - <tr> - <td><code>fav-count</code></td> - <td>favorited by given number of users</td> - </tr> - <tr> - <td><code>comment-count</code></td> - <td>having given number of comments</td> - </tr> - <tr> - <td><code>tag-count</code></td> - <td>having given number of tags</td> - </tr> - <tr> - <td><code>note-count</code></td> - <td>having given number of annotations</td> - </tr> - <tr> - <td><code>feature-count</code></td> - <td>having been featured given number of times</td> - </tr> - <tr> - <td><code>date</code></td> - <td>posted at given date</td> - </tr> - <tr> - <td><code>file-size</code></td> - <td>having given file size (in bytes)</td> - </tr> - <tr> - <td><code>image-width</code></td> - <td>having given image width (where applicable)</td> - </tr> - <tr> - <td><code>image-height</code></td> - <td>having given image height (where applicable)</td> - </tr> - <tr> - <td><code>image-area</code></td> - <td>having given number of pixels (image width * image height)</td> - </tr> - <tr> - <td><code>type</code></td> - <td>given type of posts (<code><value></code> can be either <code>image</code>, <code>flash</code>/<code>swf</code>, <code>youtube</code>/<code>yt</code>, <code>video</code> or <code>animation</code>)</td> - </tr> - </tbody> -</table> - -<p><strong>Order tokens</strong></p> - -<table> - <tbody> - <tr> - <td><code>random</code></td> - <td>as random as it can get</td> - </tr> - <tr> - <td><code>id</code></td> - <td>highest to lowest post ID</td> - </tr> - <tr> - <td><code>score</code></td> - <td>highest scored</td> - </tr> - <tr> - <td><code>fav-count</code></td> - <td>loved by most</td> - </tr> - <tr> - <td><code>comment-count</code></td> - <td>most commented first</td> - </tr> - <tr> - <td><code>tag-count</code></td> - <td>with most tags</td> - </tr> - <tr> - <td><code>note-count</code></td> - <td>with most annotations</td> - </tr> - <tr> - <td><code>file-size</code></td> - <td>largest files first</td> - </tr> - <tr> - <td><code>image-width</code></td> - <td>widest images first</td> - </tr> - <tr> - <td><code>image-height</code></td> - <td>tallest images first</td> - </tr> - <tr> - <td><code>image-area</code></td> - <td>largest images first</td> - </tr> - <tr> - <td><code>creation-date</code></td> - <td>newest to oldest (pretty much same as <code>id</code>)</td> - </tr> - <tr> - <td><code>edit-date</code></td> - <td>like <code>creation-date</code>, only looks at last edit time</td> - </tr> - <tr> - <td><code>fav-date</code></td> - <td>recently added to favorites by anyone</td> - </tr> - <tr> - <td><code>comment-date</code></td> - <td>recently commented by anyone</td> - </tr> - <tr> - <td><code>feature-date</code></td> - <td>recently featured</td> - </tr> - <tr> - <td><code>feature-count</code></td> - <td>most often featured</td> - </tr> - </tbody> -</table> - -<p><strong>Special tokens</strong></p> - -<table> - <tbody> - <tr> - <td><code>liked</code></td> - <td>posts liked by currently logged in user</td> - </tr> - <tr> - <td><code>disliked</code></td> - <td>posts disliked by currently logged in user</td> - </tr> - <tr> - <td><code>fav</code></td> - <td>posts added to favorites by currently logged in user</td> - </tr> - <tr> - <td><code>tumbleweed</code></td> - <td>posts with score of 0, without comments and without favorites</td> - </tr> - </tbody> -</table> - -<h1 id='user-search-help'>User search tokens</h1> - -<p><strong>Anonymous tokens</strong></p> - -<p>Same as <code>name</code> token.</p> - -<p><strong>Named tokens</strong></p> - -<table> - <tbody> - <tr> - <td><code>name</code></td> - <td>having given name (doesn't accept wildcards yet)</td> - </tr> - <tr> - <td><code>creation-date</code></td> - <td>registered at given date</td> - </tr> - <tr> - <td><code>creation-time</code></td> - <td>alias of <code>creation-date</code></td> - </tr> - <tr> - <td><code>last-login-date</code> - <td>whose most recent login date matches given date</td> - </tr> - <tr> - <td><code>last-login-time</code> - <td>alias of <code>last-login-date</code> - </tr> - <tr> - <td><code>login-date</code> - <td>alias of <code>last-login-date</code> - </tr> - <tr> - <td><code>login-time</code></td> - <td>alias of <code>last-login-date</code> - </tr> - </tbody> -</table> - -<p><strong>Order tokens</strong></p> - -<table> - <tbody> - <tr> - <td><code>random</code></td> - <td>as random as it can get</td> - </tr> - <tr> - <td><code>name</code></td> - <td>A to Z</td> - </tr> - <tr> - <td><code>creation-date</code></td> - <td>newest to oldest</td> - </tr> - <tr> - <td><code>creation-time</code></td> - <td>alias of <code>creation-date</code></td> - </tr> - <tr> - <td><code>last-login-date</code></td> - <td>recently active first</td> - </tr> - <tr> - <td><code>last-login-time</code></td> - <td>alias of <code>last-login-date</code></td> - </tr> - <tr> - <td><code>login-date</code></td> - <td>alias of <code>last-login-date</code></td> - </tr> - <tr> - <td><code>login-time</code></td> - <td>alias of <code>last-login-date</code></td> - </tr> - </tbody> -</table> - -<p><strong>Special tokens</strong></p> - -<p>None.</p> - -<h1 id='tag-search-help'>Tag search tokens</h1> - -<p><strong>Anonymous tokens</strong></p> - -<p>Same as <code>name</code> token.</p> - -<p><strong>Named tokens</strong></p> - -<table> - <tbody> - <tr> - <td><code>name</code></td> - <td>having given name (accepts wildcards)</td> - </tr> - <tr> - <td><code>category</code></td> - <td>having given category</td> - </tr> - <tr> - <td><code>creation-date</code></td> - <td>created at given date</td> - </tr> - <tr> - <td><code>creation-time</code></td> - <td>alias of <code>creation-date</code></td> - </tr> - <tr> - <td><code>last-edit-date</code></td> - <td>edited at given date</td> - </tr> - <tr> - <td><code>last-edit-time</code></td> - <td>alias of <code>last-edit-date</code></td> - </tr> - <tr> - <td><code>edit-date</code></td> - <td>alias of <code>last-edit-date</code></td> - </tr> - <tr> - <td><code>edit-time</code></td> - <td>alias of <code>last-edit-date</code></td> - </tr> - <tr> - <td><code>usages</code></td> - <td>used in given number of posts</td> - </tr> - <tr> - <td><code>usage-count</code></td> - <td>alias of <code>usages</code></td> - </tr> - <tr> - <td><code>post-count</code></td> - <td>alias of <code>usages</code></td> - </tr> - <tr> - <td><code>suggestion-count</code></td> - <td>with given number of suggestions</td> - </tr> - <tr> - <td><code>implication-count</code></td> - <td>with given number of implications</td> - </tr> - </tbody> -</table> - -<p><strong>Order tokens</strong></p> - -<table> - <tbody> - <tr> - <td><code>random</code></td> - <td>as random as it can get</td> - </tr> - <tr> - <td><code>name</code></td> - <td>A to Z</td> - </tr> - <tr> - <td><code>category</code></td> - <td>category (A to Z)</td> - </tr> - <tr> - <td><code>creation-date</code></td> - <td>recently created first</td> - </tr> - <tr> - <td><code>creation-time</code></td> - <td>alias of <code>creation-date</code></td> - </tr> - <tr> - <td><code>last-edit-date</code></td> - <td>recently edited first</td> - </tr> - <tr> - <td><code>last-edit-time</code></td> - <td>alias of <code>creation-time</code></td> - </tr> - <tr> - <td><code>edit-date</code></td> - <td>alias of <code>creation-time</code></td> - </tr> - <tr> - <td><code>edit-time</code></td> - <td>alias of <code>creation-time</code></td> - </tr> - <tr> - <td><code>usages</code></td> - <td>used in most posts first</td> - </tr> - <tr> - <td><code>usage-count</code></td> - <td>alias of <code>usages</code></td> - </tr> - <tr> - <td><code>post-count</code></td> - <td>alias of <code>usages</code></td> - </tr> - <tr> - <td><code>suggestion-count</code></td> - <td>with most suggestions first</td> - </tr> - <tr> - <td><code>implication-count</code></td> - <td>with most implications first</td> - </tr> - </tbody> -</table> - -<p><strong>Special tokens</strong></p> - -<p>None.</p> +<div class='subcontent'></div> diff --git a/client/html/help.hbs b/client/html/help.hbs index 2656f18..c187a29 100644 --- a/client/html/help.hbs +++ b/client/html/help.hbs @@ -1,5 +1,5 @@ <div class='content-wrapper' id='help'> - <nav class='text-nav'><!-- + <nav class='text-nav primary'><!-- --><ul><!-- --><li data-name='about'><a href='/help/about'>About</a></li><!-- --><li data-name='keyboard'><a href='/help/keyboard'>Keyboard</a></li><!-- diff --git a/client/html/user_list_header.hbs b/client/html/user_list_header.hbs index 6a82eda..d325308 100644 --- a/client/html/user_list_header.hbs +++ b/client/html/user_list_header.hbs @@ -9,7 +9,7 @@ </div> <div class='buttons'> <input type='submit' value='Search'/> - <a class='append icon' href='/help/search#user-search-help'><i class='fa fa-question-circle-o'></i></a> + <a class='append icon' href='/help/search/users'><i class='fa fa-question-circle-o'></i></a> </div> </form> </div> diff --git a/client/js/controllers/help_controller.js b/client/js/controllers/help_controller.js index 2cc53a2..797d2ac 100644 --- a/client/js/controllers/help_controller.js +++ b/client/js/controllers/help_controller.js @@ -14,12 +14,18 @@ class HelpController { page( '/help/:section', (ctx, next) => { this.showHelpRoute(ctx.params.section); }); + page( + '/help/:section/:subsection', + (ctx, next) => { + this.showHelpRoute(ctx.params.section, ctx.params.subsection); + }); } - showHelpRoute(section) { + showHelpRoute(section, subsection) { topNavController.activate('help'); this.helpView.render({ section: section, + subsection: subsection, }); } } diff --git a/client/js/views/help_view.js b/client/js/views/help_view.js index 12439d2..0c6bebf 100644 --- a/client/js/views/help_view.js +++ b/client/js/views/help_view.js @@ -12,6 +12,14 @@ class HelpView { const templateName = 'help-' + section; this.sectionTemplates[section] = views.getTemplate(templateName); } + this.subsectionTemplates = { + 'search': { + 'default': views.getTemplate('help-search-general'), + 'posts': views.getTemplate('help-search-posts'), + 'users': views.getTemplate('help-search-users'), + 'tags': views.getTemplate('help-search-tags'), + } + } } render(ctx) { @@ -27,8 +35,17 @@ class HelpView { })); } - const allItemsSelector = '[data-name]'; - for (let item of source.querySelectorAll(allItemsSelector)) { + ctx.subsection = ctx.subsection || 'default'; + if (ctx.section in this.subsectionTemplates && + ctx.subsection in this.subsectionTemplates[ctx.section]) { + views.showView( + source.querySelector('.subcontent'), + this.subsectionTemplates[ctx.section][ctx.subsection]({ + name: config.name, + })); + } + + for (let item of source.querySelectorAll('.primary [data-name]')) { if (item.getAttribute('data-name') === ctx.section) { item.className = 'active'; } else { @@ -36,6 +53,14 @@ class HelpView { } } + for (let item of source.querySelectorAll('.secondary [data-name]')) { + if (item.getAttribute('data-name') === ctx.subsection) { + item.className = 'active'; + } else { + item.className = ''; + } + } + views.listenToMessages(target); views.showView(target, source); |