mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-18 21:28:08 +01:00
migrate adding to actions on all pages
This commit is contained in:
parent
25c6e2cc9c
commit
e13e946295
24 changed files with 356 additions and 276 deletions
|
|
@ -1,5 +1,4 @@
|
|||
<%
|
||||
@todo = nil
|
||||
@initial_context_name = @context.name unless @context.nil?
|
||||
@initial_context_name ||= @project.default_context.name unless @project.nil? || @project.default_context.nil?
|
||||
@initial_context_name ||= current_user.contexts.first.name unless current_user.contexts.first.nil?
|
||||
|
|
@ -12,102 +11,7 @@
|
|||
<a title="<%= t('shared.toggle_multi_title') %>" accesskey="m" href="#" id="toggle_multi"><%= t('shared.toggle_multi') %></a>
|
||||
</div>
|
||||
|
||||
<div id="todo_new_action" style="display:block">
|
||||
<% form_remote_tag(
|
||||
:url => todos_path, :method => :post,
|
||||
:html=> { :id=>'todo-form-new-action', :name=>'todo', :class => 'inline-form' },
|
||||
:before => "$('#todo_new_action_submit').block({message:null})",
|
||||
:complete => "$('#todo_new_action_submit').unblock()",
|
||||
:condition => "TodoItems.askIfNewContextProvided('')") do -%>
|
||||
|
||||
<div id="status"><%= error_messages_for("item", :object_name => 'action') %></div>
|
||||
|
||||
<label for="todo_description"><%= Todo.human_attribute_name('description') %></label>
|
||||
<%= text_field( "todo", "description", "size" => 30, "tabindex" => 1, "maxlength" => 100, "autocomplete" => "off", :autofocus => 1) %>
|
||||
|
||||
<label for="todo_notes"><%= Todo.human_attribute_name('notes') %></label>
|
||||
<%= text_area( "todo", "notes", "cols" => 29, "rows" => 6, "tabindex" => 2) %>
|
||||
|
||||
<input id="default_project_name_id" name="default_project_name" type="hidden" value="<%=@initial_project_name-%>" />
|
||||
|
||||
<label for="todo_project_name"><%= Todo.human_attribute_name('project') %></label>
|
||||
<input id="todo_project_name" name="project_name" autocomplete="off" tabindex="3" size="30" type="text" value="<%= @initial_project_name %>" />
|
||||
<div class="page_name_auto_complete" id="project_list" style="display:none"></div>
|
||||
|
||||
<input id="default_context_name_id" name="default_context_name" type="hidden" value="<%=@initial_context_name-%>" />
|
||||
|
||||
<label for="todo_context_name"><%= Todo.human_attribute_name('context') %></label>
|
||||
<input id="todo_context_name" name="context_name" autocomplete="off" tabindex="4" size="30" type="text" value="<%= @initial_context_name %>" />
|
||||
|
||||
<label for="tag_list"><%= Todo.human_attribute_name('tags') + ' (' + t('shared.separate_tags_with_commas') + ')' %></label>
|
||||
<%= text_field_tag "tag_list", @default_tags, :size => 30, :tabindex => 5 %>
|
||||
<%= content_tag("div", "", :id => "tag_list_auto_complete", :class => "auto_complete") %>
|
||||
|
||||
<div class="due_input">
|
||||
<label for="todo_due"><%= Todo.human_attribute_name('due') %></label>
|
||||
<%= text_field("todo", "due", "size" => 12, "class" => "Date", "tabindex" => 6, "autocomplete" => "off") %>
|
||||
</div>
|
||||
|
||||
<div class="show_from_input">
|
||||
<label for="todo_show_from"><%= Todo.human_attribute_name('show_from') %></label>
|
||||
<%= text_field("todo", "show_from", "size" => 12, "class" => "Date", "tabindex" => 7, "autocomplete" => "off") %>
|
||||
</div>
|
||||
|
||||
<label for="predecessor_list"><%= Todo.human_attribute_name('predecessors')%></label>
|
||||
<%= text_field_tag "predecessor_list", nil, :size => 30, :tabindex => 8 %>
|
||||
<%= source_view_tag( @source_view ) %>
|
||||
<%= hidden_field_tag :_tag_name, @tag_name.underscore.gsub(/\s+/,'_') if source_view_is :tag %>
|
||||
|
||||
<div class="submit_box">
|
||||
<div class="widgets">
|
||||
<button type="submit" class="positive" id="todo_new_action_submit" tabindex="8">
|
||||
<%= image_tag("accept.png", :alt => "") + t('shared.add_action') %>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% end # form-remote-tag -%>
|
||||
</div>
|
||||
|
||||
<div id="todo_multi_add" style="display:none">
|
||||
<% form_remote_tag(
|
||||
:url => todos_path, :method => :post,
|
||||
:html=> { :id=>'todo-form-multi-new-action', :name=>'todo', :class => 'inline-form' },
|
||||
:before => "$('#todo_multi_new_action_submit').block({message:null})",
|
||||
:complete => "$('#todo_multi_new_action_submit').unblock()",
|
||||
:condition => "TodoItems.askIfNewContextProvided('multi_')") do -%>
|
||||
|
||||
<div id="multiple_status"><%= error_messages_for("item", :object_name => 'action') %></div>
|
||||
|
||||
<label for="todo_notes"><%= t('shared.multiple_next_actions') %></label>
|
||||
<%= text_area( "todo", "multiple_todos", "cols" => 29, "rows" => 6, "tabindex" => 2) %>
|
||||
|
||||
<input id="default_project_name_id" name="default_project_name" type="hidden" value="<%=@initial_project_name-%>" />
|
||||
|
||||
<label for="todo_project_name"><%= t('shared.project_for_all_actions') %></label>
|
||||
<input id="multi_todo_project_name" name="project_name" autocomplete="off" tabindex="3" size="30" type="text" value="<%= @initial_project_name %>" />
|
||||
<div class="page_name_auto_complete" id="project_list" style="display:none"></div>
|
||||
|
||||
<input id="default_context_name_id" name="default_context_name" type="hidden" value="<%=@initial_context_name-%>" />
|
||||
|
||||
<label for="todo_context_name"><%= t('shared.context_for_all_actions') %></label>
|
||||
<input id="multi_todo_context_name" name="context_name" autocomplete="off" tabindex="4" size="30" type="text" value="<%= @initial_context_name %>" />
|
||||
<div class="page_name_auto_complete" id="context_list" style="display:none"></div>
|
||||
|
||||
<label for="tag_list"><%= t('shared.tags_for_all_actions') + ' (' + t('shared.separate_tags_with_commas') +')' %></label>
|
||||
<%= text_field_tag "multi_tag_list", @default_tags, :name=>:tag_list, :size => 30, :tabindex => 5 %>
|
||||
<%= content_tag("div", "", :id => "tag_list_auto_complete", :class => "auto_complete") %>
|
||||
|
||||
<div class="submit_box">
|
||||
<div class="widgets">
|
||||
<button type="submit" class="positive" id="todo_multi_new_action_submit" tabindex="8">
|
||||
<%= image_tag("accept.png", :alt => "") %><%= t('shared.add_actions') %>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% end -%>
|
||||
|
||||
</div>
|
||||
<%= render :partial => 'todos/new_todo_form', :object => Todo.new %>
|
||||
<%= render :partial => 'todos/new_multi_todo_form', :object => Todo.new %>
|
||||
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue