mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-27 20:38:48 +01:00
add shortcuts, help dialog and start on add-action dialog
This commit is contained in:
parent
972210326a
commit
8e0013d0df
7 changed files with 63 additions and 10 deletions
|
|
@ -17,6 +17,7 @@
|
|||
|
||||
// Stuff in app/assets
|
||||
//= require tracks.js
|
||||
//= require keybindings.js
|
||||
|
||||
// Stuff in vendor/assets
|
||||
// require jquery-ui-1.10.0.custom.min
|
||||
|
|
|
|||
|
|
@ -41,3 +41,15 @@ $ ->
|
|||
|
||||
mouseTrapRails.toggleHints() if mouseTrapRails.showOnLoad
|
||||
|
||||
Mousetrap.bind '?', -> $('div#tracks-shortcuts-dialog').modal()
|
||||
Mousetrap.bind 'a', -> $('div#tracks-add-action-dialog').modal()
|
||||
# GO TO
|
||||
# Mousetrap.bind 'g h', TracksApp.go_home
|
||||
Mousetrap.bind 'g c', -> alert("go context")
|
||||
# Mousetrap.bind 'g C', TracksApp.go_contexts
|
||||
Mousetrap.bind 'g t', -> alert("go tag")
|
||||
Mousetrap.bind 'g p', -> alert("go project")
|
||||
# Mousetrap.bind 'g P', TracksApp.go_projects
|
||||
# VIEW
|
||||
Mousetrap.bind 'v p', -> alert("group by project")
|
||||
Mousetrap.bind 'v c', -> alert("group by context")
|
||||
|
|
|
|||
|
|
@ -1 +1,6 @@
|
|||
# Tracks specific coffeescript
|
||||
# Tracks specific coffeescript
|
||||
# TracksApp =
|
||||
# goto_page: (page) -> window.location.href = page
|
||||
# go_home: this.goto_page "/"
|
||||
# go_contexts: this.goto_page "/contexts"
|
||||
# go_projects: this.goto_page "/projects"
|
||||
|
|
@ -40,7 +40,7 @@
|
|||
|
||||
<div class="container-fluid">
|
||||
<div class="row-fluid">
|
||||
<div class="span6 offset3">
|
||||
<div class="span8 offset2 tracks-middle">
|
||||
<%= bootstrap_flash %>
|
||||
<%= yield %>
|
||||
</div>
|
||||
|
|
@ -48,7 +48,9 @@
|
|||
</div>
|
||||
|
||||
<%= render partial: "shared/footer" %>
|
||||
|
||||
<% # dialogs -%>
|
||||
<%= render partial: "shared/keyboard_shortcuts" %>
|
||||
<%= render partial: "shared/add_new_action" %>
|
||||
<%
|
||||
# Javascripts
|
||||
# ==================================================
|
||||
|
|
|
|||
17
app/views/shared/_add_new_action.html.erb
Normal file
17
app/views/shared/_add_new_action.html.erb
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<div id="tracks-add-action-dialog" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h3 id="myModalLabel">Add new action</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="active"><a href="#one-action" data-toggle="tab">Action</a></li>
|
||||
<li><a href="#multi-action" data-toggle="tab">Multiple actions</a></li>
|
||||
<li><a href="#repeat-action" data-toggle="tab">Repeating actions</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
|
||||
<button class="btn btn-primary">Save changes</button>
|
||||
</div>
|
||||
</div>`
|
||||
23
app/views/shared/_keyboard_shortcuts.html.erb
Normal file
23
app/views/shared/_keyboard_shortcuts.html.erb
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
<div id="tracks-shortcuts-dialog" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h3 id="myModalLabel">Keyboard Shortcuts</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>You can use the following shortcuts on every page:</p>
|
||||
<ul>
|
||||
<li>?: Shows this help page</li>
|
||||
<li>a: add action</li>
|
||||
<li>g then h: go to the home page</li>
|
||||
<li>g then c: go to a specific context</li>
|
||||
<li>g then C: go to the contexts page</li>
|
||||
<li>g then p: go to a specific project</li>
|
||||
<li>g then P: go to the projects page</li>
|
||||
<li>v then p: group the actions on the page by project</li>
|
||||
<li>v then c: group the actions on the page by context</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
<div id="sidebar">
|
||||
<%= sidebar_html_for_titled_list(@active_projects, t('sidebar.list_name_active_projects'))%>
|
||||
<%= sidebar_html_for_titled_list(@active_contexts, t('sidebar.list_name_active_contexts'))%>
|
||||
<%= sidebar_html_for_titled_list(@hidden_projects, t('sidebar.list_name_hidden_projects')) if prefs.show_hidden_projects_in_sidebar %>
|
||||
<%= sidebar_html_for_titled_list(@completed_projects, t('sidebar.list_name_completed_projects')) if prefs.show_completed_projects_in_sidebar %>
|
||||
<%= sidebar_html_for_titled_list(@hidden_contexts, t('sidebar.list_name_hidden_contexts')) if prefs.show_hidden_contexts_in_sidebar %>
|
||||
</div>
|
||||
Loading…
Add table
Add a link
Reference in a new issue