mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-27 09:34:08 +01:00
add keyboard shortcuts and make todos selectable useing j and k
This commit is contained in:
parent
b725b7b137
commit
db29b84f69
17 changed files with 217 additions and 99 deletions
|
|
@ -1,3 +1,6 @@
|
|||
<%# Template Dependency: todos/collection -%>
|
||||
<%# Template Dependency: contexts/context -%>
|
||||
<%# Template Dependency: projects/project -%>
|
||||
<%
|
||||
suffix_completed = t('contexts.last_completed_in_context', :number=>prefs.show_number_completed)
|
||||
deferred_pending_options = {:append_descriptor => nil, :parent_container_type => 'context'}
|
||||
|
|
@ -5,7 +8,9 @@
|
|||
show_empty_containers = (@group_view_by == 'context')
|
||||
-%>
|
||||
|
||||
<%= empty_message_holder("not_done_context", @not_done_todos.empty?) %>
|
||||
<% cache("not_done_context", @not_done_todos.empty?) do -%>
|
||||
<%= render partial: "todos/empty_message_container", locals: {:show => @not_done_todos.empty?, :container_name => "not_done"} %>
|
||||
<% end -%>
|
||||
|
||||
<%= show_grouped_todos({:collapsible => false, :show_empty_containers => show_empty_containers, :parent_container_type => 'context'}) %>
|
||||
|
||||
|
|
|
|||
|
|
@ -6,37 +6,32 @@
|
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title><%= content_for?(:title) ? yield(:title) : @page_title %></title>
|
||||
<%= csrf_meta_tags %>
|
||||
|
||||
<!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.6.1/html5shiv.js" type="text/javascript"></script>
|
||||
<![endif]-->
|
||||
|
||||
<%= stylesheet_link_tag "application", :media => "all" %>
|
||||
|
||||
<!-- For third-generation iPad with high-resolution Retina display: -->
|
||||
<!-- Size should be 144 x 144 pixels -->
|
||||
<%= favicon_link_tag 'apple-touch-icon-144x144-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png', :sizes => '144x144' %>
|
||||
|
||||
<!-- For iPhone with high-resolution Retina display: -->
|
||||
<!-- Size should be 114 x 114 pixels -->
|
||||
<%= favicon_link_tag 'apple-touch-icon-114x114-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png', :sizes => '114x114' %>
|
||||
|
||||
<!-- For first- and second-generation iPad: -->
|
||||
<!-- Size should be 72 x 72 pixels -->
|
||||
<%= favicon_link_tag 'apple-touch-icon-72x72-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png', :sizes => '72x72' %>
|
||||
|
||||
<!-- For non-Retina iPhone, iPod Touch, and Android 2.1+ devices: -->
|
||||
<!-- Size should be 57 x 57 pixels -->
|
||||
<%= favicon_link_tag 'apple-touch-icon-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png' %>
|
||||
|
||||
<!-- For all other devices -->
|
||||
<!-- Size should be 32 x 32 pixels -->
|
||||
<%= favicon_link_tag 'favicon.ico', :rel => 'shortcut icon' %>
|
||||
</head>
|
||||
<body class="<%= controller.controller_name %>">
|
||||
|
||||
<%= render partial: "shared/navbar" %>
|
||||
<% cache do -%>
|
||||
<%= render partial: "shared/navbar" %>
|
||||
<% end -%>
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="row-fluid">
|
||||
|
|
@ -47,10 +42,12 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<%= render partial: "shared/footer" %>
|
||||
<% # dialogs -%>
|
||||
<%= render partial: "shared/keyboard_shortcuts" %>
|
||||
<%= render partial: "shared/add_new_action" %>
|
||||
<% cache do -%>
|
||||
<%= render partial: "shared/footer" %>
|
||||
<% # dialogs -%>
|
||||
<%= render partial: "shared/keyboard_shortcuts" %>
|
||||
<%= render partial: "shared/add_new_action" %>
|
||||
<% end -%>
|
||||
<%
|
||||
# Javascripts
|
||||
# ==================================================
|
||||
|
|
|
|||
|
|
@ -11,4 +11,4 @@
|
|||
</small></p>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
</footer>
|
||||
|
|
@ -51,20 +51,25 @@
|
|||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><%= t('layouts.navigation.help') %><b class="caret"></b></a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><%= menu_item("keyboard_shortcuts", "#") %></li>
|
||||
<li><%= menu_item("integrations", integrations_path) %></li>
|
||||
<li><%= menu_item("api_docs", rest_api_docs_path) %></li>
|
||||
<li><%= menu_item("keyboard_shortcuts", "#",{:id => "menu-keyboard-shotcuts"}) %></li>
|
||||
<li><%= menu_item("integrations", integrations_path) %></li>
|
||||
<li><%= menu_item("api_docs", rest_api_docs_path) %></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="nav pull-right">
|
||||
<li>
|
||||
<div class="btn-toolbar">
|
||||
<a class="btn btn-primary btn-small button-add-todo" title="Add a new action" data-keybinding="a"><i class="icon-plus icon-large"></i></a>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<form class="navbar-search pull-right">
|
||||
<input type="text" class="search-query" placeholder="Search">
|
||||
</form>
|
||||
</li>
|
||||
<li><%= link_to("#{t('common.logout')} (#{current_user.display_name})".html_safe, logout_path) %>
|
||||
<li><%= link_to("<i class='icon-signout'></i>".html_safe, logout_path, title: "#{t('common.logout')} (#{current_user.display_name})") %></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
<%=
|
||||
settings[:show_container] = !collection.empty? || settings[:show_empty_containers]
|
||||
|
||||
todos_container(settings) do
|
||||
todos_container_header(settings) +
|
||||
todos_container_items(collection, settings)
|
||||
end
|
||||
%>
|
||||
<%
|
||||
# Template Dependency: todos/container_items
|
||||
settings = todos_container_settings(settings)
|
||||
settings[:class] += " hide" if collection.empty? || settings[:show_container]
|
||||
-%>
|
||||
<div id="<%=settings[:id]%>" class="<%=settings[:class]%>">
|
||||
<%= todos_container_header(settings) %>
|
||||
<%= todos_container_items(collection, settings) %>
|
||||
</div>
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
<div id="<%=container_id%>-empty-d" style="display:<%= show_message ? 'block' : 'none'%>">
|
||||
<div id="<%=container_id%>-empty-d" class="<%= show_empty_message ? '' : 'hide'%>">
|
||||
<div class="message">
|
||||
<p><%=t("todos.no_actions.#{container_name}")%></p>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,11 @@
|
|||
<div id="<%=div_id%>" class="todo_items toggle_target">
|
||||
<%= todos_container_empty_message(container_name, todo_id, hide_empty_message) %>
|
||||
|
||||
<% cache container_name, show_empty_message do %>
|
||||
<%= render partial: "todos/container_empty_message", locals: {
|
||||
container_id: settings[:container_id],
|
||||
container_name: settings[:container_name],
|
||||
show_empty_message: settings[:show_empty_message]} -%>
|
||||
<% end -%>
|
||||
|
||||
<%= render(:partial => "todos/todo", :collection => collection, :locals => settings) %>
|
||||
</div>
|
||||
10
app/views/todos/_empty_message_container.html.erb
Normal file
10
app/views/todos/_empty_message_container.html.erb
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<%
|
||||
title_param ||= ""
|
||||
hidden_class = show ? "" : " hide"
|
||||
%>
|
||||
<div id="no_todos_in_view" class="container <%=container_name + hidden_class%>">
|
||||
<h4><%= t("todos.no_actions.title", :param=>title_param) %></h4>
|
||||
<div class="message">
|
||||
<p><%= t("todos.no_actions.#{container_name}", :param=>title_param)%></p>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,23 +1,32 @@
|
|||
<%
|
||||
suppress_context ||= false
|
||||
suppress_project ||= false
|
||||
cache [todo, current_user.date.strftime("%Y%m%d"), @source_view, current_user.prefs.verbose_action_descriptors] do
|
||||
-%>
|
||||
<div id="<%= dom_id(todo) %>" class="row todo-item">
|
||||
<div class="span8">
|
||||
<div class="todo-item-icons">
|
||||
<i class="<%= todo.completed? ? "icon-check-sign" : "icon-check-empty"%>"></i>
|
||||
<i class="<%= todo.starred? ? "icon-star" : "icon-star-empty"%>"></i>
|
||||
<div id="<%= dom_id(todo) %>" class="todo-item">
|
||||
<div class="row">
|
||||
<div class="span8">
|
||||
<div class="todo-item-icons">
|
||||
<i class="<%= todo.completed? ? "icon-check-sign" : "icon-check-empty"%>"></i>
|
||||
<i class="<%= todo.starred? ? "icon-star" : "icon-star-empty"%>"></i>
|
||||
</div>
|
||||
<div class="todo-item-description-container">
|
||||
<span class="todo-description"><%= todo.description %></span>
|
||||
<%= content_tag(:i, {class: "icon-refresh"}){} if todo.from_recurring_todo? -%>
|
||||
<%= deferred_due_date(todo) -%>
|
||||
<%= content_tag(:i, {class: "icon-sitemap"}){} if todo.has_pending_successors -%>
|
||||
<%= content_tag(:i, {class: "icon-book", "data-note-id" => dom_id(todo, 'notes')}){} unless todo.notes.blank? %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="span4 pull-right">
|
||||
<%= date_span(todo) -%>
|
||||
<%= tag_list(todo) %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="todo-item-description-container">
|
||||
<span class="todo-description"><%= todo.description %></span>
|
||||
<%= content_tag(:i, {class: "icon-refresh"}){} if todo.from_recurring_todo? %>
|
||||
<%= deferred_due_date(todo) %>
|
||||
<%= content_tag(:i, {class: "icon-play-sign"}){} if todo.has_pending_successors %>
|
||||
<%= content_tag(:i, {class: "icon-book"}){} unless todo.notes.blank? %>
|
||||
<div class="row">
|
||||
<div id="<%=dom_id(todo, 'notes')%>" class="todo-notes hide">
|
||||
<%=todo.rendered_notes.html_safe%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="span4 pull-right">
|
||||
<%= date_span(todo) -%>
|
||||
<%= tag_list(todo) %>
|
||||
</div>
|
||||
</div>
|
||||
<% end -%>
|
||||
|
|
@ -1,11 +1,14 @@
|
|||
<div id="display_box">
|
||||
<%= empty_message_holder("not_done", @not_done_todos.empty?) %>
|
||||
<%# Template Dependency: todos/collection -%>
|
||||
<%# Template Dependency: contexts/context -%>
|
||||
<%# Template Dependency: projects/project -%>
|
||||
<% cache("not_done", @not_done_todos.empty?) do -%>
|
||||
<%= render partial: "empty_message_container", locals: {:show => @not_done_todos.empty?, :container_name => "not_done"} %>
|
||||
<% end -%>
|
||||
|
||||
<%= show_grouped_todos %>
|
||||
<%= show_grouped_todos %>
|
||||
|
||||
<% if @group_view_by == 'project' -%>
|
||||
<%= show_todos_without_project(@todos_without_project) -%>
|
||||
<% end -%>
|
||||
<% if @group_view_by == 'project' -%>
|
||||
<%= show_todos_without_project(@todos_without_project) -%>
|
||||
<% end -%>
|
||||
|
||||
<%= show_done_todos(@done, {:parent_container_type => @group_view_by, :collapsible => true}) unless @done.nil? %>
|
||||
</div>
|
||||
<%= show_done_todos(@done, {:parent_container_type => @group_view_by, :collapsible => true}) unless @done.nil? %>
|
||||
|
|
@ -1,4 +1,7 @@
|
|||
<%
|
||||
# Template Dependency: todos/collection
|
||||
# Template Dependency: contexts/context
|
||||
# Template Dependency: projects/project
|
||||
options = {
|
||||
:collapsible => false,
|
||||
:parent_container_type => 'tag',
|
||||
|
|
@ -8,19 +11,18 @@
|
|||
hidden_options = options.clone
|
||||
done_options = options.clone
|
||||
-%>
|
||||
<div id="display_box">
|
||||
<%= empty_message_holder("not_done_with_tag", @not_done_todos.empty?, @tag_name) %>
|
||||
<% cache("not_done_with_tag_#{@tag_name}", @not_done_todos.empty?) do -%>
|
||||
<%= render partial: "empty_message_container", locals: {:show => @not_done_todos.empty?, :container_name => "not_done_with_tag"} %>
|
||||
<% end -%>
|
||||
|
||||
<%= show_grouped_todos %>
|
||||
<%= show_grouped_todos %>
|
||||
|
||||
<% if @group_view_by == 'project' -%>
|
||||
<%= show_todos_without_project(@todos_without_project) -%>
|
||||
<% end -%>
|
||||
<% if @group_view_by == 'project' -%>
|
||||
<%= show_todos_without_project(@todos_without_project) -%>
|
||||
<% end -%>
|
||||
|
||||
<%= show_deferred_pending_todos(@deferred_todos, @pending_todos, deferred_pending_options) %>
|
||||
<%= show_deferred_pending_todos(@deferred_todos, @pending_todos, deferred_pending_options) %>
|
||||
|
||||
<%= show_hidden_todos(@hidden_todos, hidden_options) unless @hidden_todos.nil? %>
|
||||
<%= show_hidden_todos(@hidden_todos, hidden_options) unless @hidden_todos.nil? %>
|
||||
|
||||
<%= show_done_todos(@done, done_options) unless @done.nil? %>
|
||||
|
||||
</div>
|
||||
<%= show_done_todos(@done, done_options) unless @done.nil? %>
|
||||
Loading…
Add table
Add a link
Reference in a new issue