fix for mobile new todo tags no being saved

the mobile interface shares the form for creating and updating todos.
the todo controller was using different names for them. this change
aligns them.
This commit is contained in:
tim madden 2012-04-28 22:34:03 -05:00
parent c8947519b7
commit b932ac210f
4 changed files with 7 additions and 7 deletions

View file

@ -1424,8 +1424,8 @@ class TodosController < ApplicationController
end
def update_tags
if params[:tag_list]
@todo.tag_with(params[:tag_list])
if params[:todo_tag_list]
@todo.tag_with(params[:todo_tag_list])
@todo.tags(true) #force a reload for proper rendering
end
end

View file

@ -23,8 +23,8 @@ form_for(todo, :html=> { :name=>'todo', :id => dom_id(@todo, 'form'), :class =>
<input id="<%= dom_id(@todo, 'context_name') %>" name="context_name" autocomplete="off" tabindex="<%= next_tab_index%>" size="30" type="text" value="<%= h @todo.context.name %>" />
</div>
<label class="tag_list_label" for="<%= dom_id(@todo, 'tag_list') %>"><%= t('todos.tags') %></label>
<%= text_field_tag 'tag_list', tag_list_text, :id => dom_id(@todo, 'tag_list'), :size => 30, :tabindex => next_tab_index %>
<label class="tag_list_label" for="<%= dom_id(@todo, 'todo_tag_list') %>"><%= t('todos.tags') %></label>
<%= text_field_tag 'todo_tag_list', tag_list_text, :id => dom_id(@todo, 'todo_tag_list'), :size => 30, :tabindex => next_tab_index %>
<div class="due_input">
<label for="<%= dom_id(@todo, 'due_label') %>"><%= Todo.human_attribute_name('due') %></label>

View file

@ -6,8 +6,8 @@
<% this_year = current_user.time.to_date.strftime("%Y").to_i -%>
<h2><label for="todo_description"><%= t('common.description') %></label></h2>
<%= text_field( "todo", "description", "tabindex" => 1, "maxlength" => 100, "size" => 50) %>
<h2><label for="tag_list"><%= t('todos.tags') %></label></h2>
<%= text_field_tag "tag_list", @tag_list_text, :size => 50, :tabindex => 2 %>
<h2><label for="todo_tag_list"><%= t('todos.tags') %></label></h2>
<%= text_field_tag "todo_tag_list", @tag_list_text, :size => 50, :tabindex => 2 %>
<h2><label for="todo_context_id"><%= t('common.context') %></label></h2>
<%= unless @mobile_from_context
collection_select( "todo", "context_id", @contexts, "id", "name", {}, {"tabindex" => 3} )

View file

@ -230,7 +230,7 @@ table.c {
display:inline;
}
input#todo_description, input#tag_list, textarea#todo_notes, select#todo_project_id, select#todo_context_id {
input#todo_description, input#todo_tag_list, textarea#todo_notes, select#todo_project_id, select#todo_context_id {
width: 95%;
}