This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/templates/header.js.handlebars
Ryan Sullivan 5100c2bbd2 Add Global Keyboard Shortcuts
Not all of these have been fully implemented yet.

**Jump To**
* `g` then `h` - Home (Latest)
* `g` then `l` - Latest
* `g` then `n` - New
* `g` then `u` - Unread
* `g` then `f` - Favorited
* `g` then `c` - Categories List

**Navigation**
* `u` - Back to topic list
* `k` / `j` - Newer/Older conversation or post
* `o` or `Enter` - Open selected conversation
* <code>`</code> - Go to next section
* `~` - Go to previous section

**Application**
* `c` - Create a new topic
* `n` - Open notifications menu
* `/` - Search
* `?` - Open keyboard shortcut help

**Actions**
* `f` - Favorite topic
* `s` - Share topic
* `<Shift>` + `s` - Share selected post
* `r` - Reply to topic
* `<Shift>` + `r` - Reply to selected post
* `l` - Like selected post
* `!` - Flag selected post
* `b` - Bookmark selected post
* `e` - Edit selected post
* `d` - Delete selected post
* `m` then `m` - Mark topic as muted
* `m` then `r` - Mark topic as regular
* `m` then `t` - Mark topic as tracking
* `m` then `w` - Mark topic as watching
2013-12-22 12:16:42 -07:00

111 lines
4.0 KiB
Handlebars

<div class='container'>
<div class='contents clearfix'>
{{home-logo minimized=showExtraInfo}}
{{#if showExtraInfo}}
<div class="extra-info-wrapper">
<div class="extra-info">
{{#if showFavoriteButton}}
<a {{bindAttr class=":star topic.starred:starred"}} {{action toggleStar}} href='#' {{bindAttr title="topic.favoriteTooltip"}}></a>
{{/if}}
<h1>
{{boundCategoryLink topic.category}}
{{#if topic.details.loaded}}
{{topicStatus topic=topic}}
<a class='topic-link' href='{{unbound topic.url}}'>{{{topic.fancy_title}}}</a>
{{else}}
{{#if topic.errorLoading}}
{{topic.errorTitle}}
{{else}}
{{i18n topic.loading}}
{{/if}}
{{/if}}
</h1>
</div>
</div>
{{/if}}
<div class='panel clearfix'>
{{#unless showExtraInfo}}
<div class='current-username'>
{{#if currentUser}}
<span class='username'><a {{bindAttr href="currentUser.path"}}>{{currentUser.displayName}}</a></span>
{{else}}
<button {{action showLogin}} class='btn btn-primary btn-small'>{{i18n log_in}}</button>
{{/if}}
</div>
{{/unless}}
<ul class='icons clearfix'>
<li class='notifications'>
{{#if currentUser}}
<a class='icon' href="#" {{action showNotifications target="view"}} data-notifications="notifications-dropdown" id='user-notifications' title='{{i18n notifications.title}}'><i class='fa fa-comment'></i></a>
{{#if currentUser.unread_notifications}}
<a href='#' class='badge-notification unread-notifications'>{{currentUser.unread_notifications}}</a>
{{/if}}
{{#if currentUser.unread_private_messages}}
<a href='#' class='badge-notification unread-private-messages'>{{currentUser.unread_private_messages}}</a>
{{/if}}
{{else}}
<a class='icon' href="#" {{action showLogin}} title='{{i18n notifications.title}}'><i class='fa fa-comment'></i></a>
{{/if}}
</li>
<li>
{{#if Discourse.loginRequired}}
<a id='search-button' class='icon expand' href='#' {{action showLogin}}>
<i class='fa fa-search'></i>
</a>
{{else}}
<a id='search-button'
class='icon expand'
href='#'
data-dropdown="search-dropdown"
title='{{i18n search.title}}'>
<i class='fa fa-search'></i>
</a>
{{/if}}
</li>
<li class='categories dropdown'>
{{#if Discourse.loginRequired}}
<a class='icon'
href="#"
{{action showLogin}}>
<i class='fa fa-bars'></i>
</a>
{{else}}
<a class='icon'
data-dropdown="site-map-dropdown"
data-render="renderSiteMap"
href="#"
title='{{i18n site_map}}'
id="site-map">
<i class='fa fa-bars'></i>
</a>
{{/if}}
{{#if currentUser.site_flagged_posts_count}}
<a href='/admin/flags/active' title='{{i18n notifications.total_flagged}}' class='badge-notification flagged-posts'>{{currentUser.site_flagged_posts_count}}</a>
{{/if}}
</li>
<li class='current-user'>
{{#if currentUser}}
{{#titledLinkTo 'userActivity.index' currentUser titleKey="current_user" class="icon"}}{{boundAvatar currentUser imageSize="medium" }}{{/titledLinkTo}}
{{else}}
<div class="icon not-logged-in-avatar" {{action showLogin}}><i class='fa fa-user'></i></div>
{{/if}}
</li>
</ul>
{{render search}}
{{render notifications notifications}}
{{#if view.renderSiteMap}}
{{render siteMap}}
{{/if}}
</div>
</div>
</div>