mirror of
https://github.com/TracksApp/tracks.git
synced 2026-03-15 00:36:33 +01:00
fix #999 by adding a menu to the mobile interface where you can choose the action you want to take on a todo, including deferring
This commit is contained in:
parent
174becee81
commit
5c015fea16
11 changed files with 603 additions and 523 deletions
|
|
@ -1,10 +1,10 @@
|
|||
<% @tag_list_text = ""
|
||||
<% @tag_list_text = ""
|
||||
@tag_list_text = tag_list_text if @todo -%>
|
||||
<span class="errors">
|
||||
<%= error_messages_for("todo") %>
|
||||
</span>
|
||||
<% this_year = current_user.time.to_date.strftime("%Y").to_i
|
||||
if parent_container_type == 'show_mobile' -%>
|
||||
<% this_year = current_user.time.to_date.strftime("%Y").to_i -%>
|
||||
<% if parent_container_type == 'show_mobile' -%>
|
||||
<p><label for="todo_done"><%= t('todos.done') %></label> <%= check_box_tag("done", 1, @todo && @todo.completed?, "tabindex" => 1, "onClick" => "document.mobileEdit.submit()") %></p>
|
||||
<% end -%>
|
||||
<h2><label for="todo_description"><%= t('common.description') %></label></h2>
|
||||
|
|
@ -13,10 +13,10 @@ if parent_container_type == 'show_mobile' -%>
|
|||
<%= text_area( "todo", "notes", "cols" => 40, "rows" => 3, "tabindex" => 3) %>
|
||||
<h2><label for="todo_context_id"><%= t('common.context') %></label></h2>
|
||||
<%= unless @mobile_from_context
|
||||
collection_select( "todo", "context_id", @contexts, "id", "name", {}, {"tabindex" => 4} )
|
||||
collection_select( "todo", "context_id", @contexts, "id", "name", {}, {"tabindex" => 4} )
|
||||
else
|
||||
select_tag("todo[context_id]", options_from_collection_for_select(
|
||||
@contexts, "id", "name", @mobile_from_context.id),
|
||||
@contexts, "id", "name", @mobile_from_context.id),
|
||||
{"id" => :todo_context_id, :tabindex => 4} )
|
||||
end %>
|
||||
<h2><label for="todo_project_id"><%= t('common.project') %></label></h2>
|
||||
|
|
@ -24,10 +24,10 @@ end %>
|
|||
collection_select( "todo", "project_id", @projects, "id", "name",
|
||||
{:include_blank => t('todos.no_project')}, {"tabindex" => 5} )
|
||||
else
|
||||
# manually add blank option since :include_blank does not work
|
||||
# manually add blank option since :include_blank does not work
|
||||
# with options_from_collection_for_select
|
||||
select_tag("todo[project_id]", "<option value=\"\"></option>"+options_from_collection_for_select(
|
||||
@projects, "id", "name", @mobile_from_project.id),
|
||||
@projects, "id", "name", @mobile_from_project.id),
|
||||
{"id" => :todo_project_id, :tabindex => 5} )
|
||||
end %>
|
||||
<h2><label for="tag_list"><%= t('todos.tags') %></label></h2>
|
||||
|
|
@ -36,5 +36,5 @@ end %>
|
|||
<%= date_select("todo", "due", {:order => [:day, :month, :year],
|
||||
:start_year => this_year, :include_blank => '--'}, :tabindex => 7) %>
|
||||
<h2><label for="todo_show_from"><%= t('todos.show_from') %></label></h2>
|
||||
<%= date_select("todo", "show_from", {:order => [:day, :month, :year],
|
||||
<%= date_select("todo", "show_from", {:order => [:day, :month, :year],
|
||||
:start_year => this_year, :include_blank => true}, :tabindex => 8) %>
|
||||
5
app/views/todos/edit_mobile.html.erb
Normal file
5
app/views/todos/edit_mobile.html.erb
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
<% form_tag todo_path(@todo, :format => 'm'), :name => 'mobileEdit', :method => :put do %>
|
||||
<%= render :partial => 'edit_mobile_form', :locals => { :parent_container_type => "show_mobile" } %>
|
||||
<p><input type="submit" value="<%= t('common.update') %>" tabindex="6" accesskey="#" /></p>
|
||||
<% end -%>
|
||||
<%= link_to t('common.cancel'), @return_path %>
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
<% form_tag todos_path(:format => 'm'), :method => :post do %>
|
||||
<%= render :partial => 'edit_mobile' %>
|
||||
<%= render :partial => 'edit_mobile_form' %>
|
||||
<p><input type="submit" value="<%= t('common.create') %>" tabindex="12" accesskey="#" /></p>
|
||||
<% end -%>
|
||||
<%= link_to t('common.back'), @return_path %>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,29 @@
|
|||
<% form_tag todo_path(@todo, :format => 'm'), :name => 'mobileEdit', :method => :put do %>
|
||||
<%= render :partial => 'edit_mobile', :locals => { :parent_container_type => "show_mobile" } %>
|
||||
<p><input type="submit" value="<%= t('common.update') %>" tabindex="6" accesskey="#" /></p>
|
||||
<% end -%>
|
||||
<%= link_to t('common.cancel'), @return_path %>
|
||||
<h2>Description</h2>
|
||||
<%= @todo.description %><br/>
|
||||
|
||||
<h2>Actions</h2>
|
||||
|
||||
<form method="get" action="<%= edit_todo_path(@todo, :format => :m)%>">
|
||||
<button>Edit this action</button>
|
||||
<input type="hidden" name="_method" value="put" />
|
||||
</form><br/>
|
||||
|
||||
<form method="post" action="<%=toggle_star_todo_path(@todo, :format=>:m)%>">
|
||||
<button>Toggle Star</button>
|
||||
<input type="hidden" name="_method" value="put" />
|
||||
</form><br/>
|
||||
|
||||
<form method="post" action="<%=toggle_check_todo_path(@todo, :format=>:m)%>">
|
||||
<button>Mark complete</button>
|
||||
<input type="hidden" name="_method" value="put" />
|
||||
</form><br/>
|
||||
|
||||
<form method="post" action="<%=defer_todo_path(@todo, :format=>:m, :days => 1)%>">
|
||||
<button>Defer 1 day</button>
|
||||
<input type="hidden" name="_method" value="put" />
|
||||
</form><br/>
|
||||
|
||||
<form method="post" action="<%=defer_todo_path(@todo, :format=>:m, :days => 7)%>">
|
||||
<button>Defer 7 days</button>
|
||||
<input type="hidden" name="_method" value="put" />
|
||||
</form><br/>
|
||||
Loading…
Add table
Add a link
Reference in a new issue