Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge branch 'master' of github.com:TracksApp/tracks

  • Loading branch information...
commit 9421ae76bb2ae0e11142dcea835380ff0ff47c4c 2 parents 05695c1 + 0a7c19a
Reinier Balt authored June 28, 2012
3  app/assets/javascripts/tracks.js
@@ -35,7 +35,7 @@ var TracksForm = {
35 35
         $('#project_name').html(name);
36 36
     },
37 37
     set_tag_list: function (name) {
38  
-        $('input#todo_tag_list').val(name);
  38
+        $('input#tag_list').val(name);
39 39
     },
40 40
     set_tag_list_for_multi_add: function (name) {
41 41
         $('#multi_tag_list').val(name);
@@ -252,7 +252,6 @@ var TracksPages = {
252 252
         ContextItems.setup_autocomplete_for_contexts('input[name=context_name]');
253 253
         ContextItems.setup_autocomplete_for_contexts('input[id="project_default_context_name"]');
254 254
         TracksPages.setup_autocomplete_for_tag_list('input[name=tag_list]'); // todo edit form
255  
-        TracksPages.setup_autocomplete_for_tag_list('input[name=todo_tag_list]'); // new todo form
256 255
         TracksPages.setup_autocomplete_for_tag_list('input[id="project_default_tags"]');
257 256
         TodoItems.setup_autocomplete_for_predecessor();
258 257
     },
2  app/assets/stylesheets/mobile.css
@@ -230,7 +230,7 @@ table.c {
230 230
   display:inline;
231 231
 }
232 232
 
233  
-input#todo_description, input#todo_tag_list, textarea#todo_notes, select#todo_project_id, select#todo_context_id {
  233
+input#todo_description, input#tag_list, textarea#todo_notes, select#todo_project_id, select#todo_context_id {
234 234
   width: 95%;
235 235
 }
236 236
 
6  app/controllers/todos_controller.rb
@@ -1269,8 +1269,8 @@ def update_context
1269 1269
   end
1270 1270
 
1271 1271
   def update_tags
1272  
-    if params[:todo_tag_list]
1273  
-      @todo.tag_with(params[:todo_tag_list])
  1272
+    if params[:tag_list]
  1273
+      @todo.tag_with(params[:tag_list])
1274 1274
       @todo.tags(true) #force a reload for proper rendering
1275 1275
     end
1276 1276
   end
@@ -1423,7 +1423,7 @@ def context_id
1423 1423
     end
1424 1424
 
1425 1425
     def tag_list
1426  
-      @params['todo_tag_list']
  1426
+      @params['tag_list']
1427 1427
     end
1428 1428
 
1429 1429
     def predecessor_list
2  app/models/recurring_todo.rb
@@ -411,7 +411,7 @@ def recurrence_pattern
411 411
         return I18n.t("todos.recurrence.pattern.on_work_days")
412 412
       else
413 413
         if every_other1 > 1
414  
-          return I18n.t("todos.recurrence.pattern.every_n", :n => every_other1) + " " + I18n.t("common.days")
  414
+          return I18n.t("todos.recurrence.pattern.every_n", :n => every_other1) + " " + I18n.t("common.days_midsentence.other")
415 415
         else
416 416
           return I18n.t("todos.recurrence.pattern.every_day")
417 417
         end
4  app/views/todos/_edit_form.html.erb
@@ -30,8 +30,8 @@
30 30
     <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 %>" />
31 31
   </div>
32 32
 
33  
-  <label class="tag_list_label" for="<%= dom_id(@todo, 'todo_tag_list') %>"><%= t('todos.tags') %></label>
34  
-  <%= text_field_tag 'todo_tag_list', tag_list_text, :id => dom_id(@todo, 'todo_tag_list'), :size => 30, :tabindex => next_tab_index %>
  33
+  <label class="tag_list_label" for="<%= dom_id(@todo, 'tag_list') %>"><%= t('todos.tags') %></label>
  34
+  <%= text_field_tag 'tag_list', tag_list_text, :id => dom_id(@todo, 'tag_list'), :size => 30, :tabindex => next_tab_index %>
35 35
 
36 36
   <div class="due_input">
37 37
     <label for="<%= dom_id(@todo, 'due_label') %>"><%= Todo.human_attribute_name('due') %></label>
4  app/views/todos/_edit_form.m.erb
@@ -6,8 +6,8 @@
6 6
 <% this_year = current_user.time.to_date.strftime("%Y").to_i -%>
7 7
 <h2><label for="todo_description"><%= t('common.description') %></label></h2>
8 8
 <%= text_field( "todo", "description", "tabindex" => 1, "maxlength" => 100, "size" => 50) %>
9  
-<h2><label for="todo_tag_list"><%= t('todos.tags') %></label></h2>
10  
-<%= text_field_tag "todo_tag_list", @tag_list_text, :size => 50, :tabindex => 2 %>
  9
+<h2><label for="tag_list"><%= t('todos.tags') %></label></h2>
  10
+<%= text_field_tag "tag_list", @tag_list_text, :size => 50, :tabindex => 2 %>
11 11
 <h2><label for="todo_context_id"><%= t('common.context') %></label></h2>
12 12
 <%= unless @mobile_from_context
13 13
   collection_select( "todo", "context_id", @contexts, "id", "name", {}, {"tabindex" => 3} )
4  app/views/todos/_new_todo_form.html.erb
@@ -30,9 +30,9 @@
30 30
     <label for="todo_context_name"><%= Todo.human_attribute_name('context') %></label>
31 31
     <input id="todo_context_name" name="context_name" autocomplete="off" tabindex="<%= next_tab_index%>" size="30" type="text" value="<%= h(@initial_context_name) %>" />
32 32
 
33  
-    <label for="todo_tag_list"><%= Todo.human_attribute_name('tags') + ' (' + t('shared.separate_tags_with_commas') + ')' %></label>
  33
+    <label for="tag_list"><%= Todo.human_attribute_name('tags') + ' (' + t('shared.separate_tags_with_commas') + ')' %></label>
34 34
     <%= hidden_field_tag "initial_tag_list", @initial_tags%>
35  
-    <%= text_field_tag "todo_tag_list", @initial_tags, :size => 30, :tabindex => next_tab_index %>
  35
+    <%= text_field_tag "tag_list", @initial_tags, :size => 30, :tabindex => next_tab_index %>
36 36
     <%= content_tag("div", "", :id => "tag_list_auto_complete", :class => "auto_complete") %>
37 37
 
38 38
     <div class="due_input">
8  features/step_definitions/todo_create_steps.rb
@@ -215,7 +215,7 @@
215 215
 
216 216
 When /^I submit a new action with description "([^"]*)" and the tags "([^"]*)" in the context "([^"]*)"$/ do |description, tags, context_name|
217 217
   fill_in "todo[description]", :with => description
218  
-  fill_in "todo_tag_list", :with => tags
  218
+  fill_in "tag_list", :with => tags
219 219
 
220 220
   # fill_in does not seem to work when the field is prefilled with something. Empty the field first
221 221
   clear_context_name_from_next_action_form
@@ -231,7 +231,7 @@
231 231
 
232 232
   fill_in "todo_project_name", :with => project_name
233 233
   fill_in "todo_context_name", :with => context_name
234  
-  fill_in "todo_tag_list", :with => tags
  234
+  fill_in "tag_list", :with => tags
235 235
 
236 236
   submit_next_action_form
237 237
 end
@@ -263,7 +263,7 @@
263 263
   clear_context_name_from_next_action_form
264 264
   fill_in "todo_context_name", :with => context_name
265 265
 
266  
-  fill_in "todo_tag_list", :with => tags
  266
+  fill_in "tag_list", :with => tags
267 267
   fill_in "todo[show_from]", :with => format_date(@current_user.time + 1.week)
268 268
   submit_next_action_form
269 269
 end
@@ -276,7 +276,7 @@
276 276
 
277 277
   fill_in "todo_project_name", :with => project_name
278 278
   fill_in "todo_context_name", :with => context_name
279  
-  fill_in "todo_tag_list", :with => tags
  279
+  fill_in "tag_list", :with => tags
280 280
   fill_in "todo[show_from]", :with => format_date(@current_user.time + 1.week)
281 281
 
282 282
   submit_next_action_form
6  features/step_definitions/todo_steps.rb
@@ -122,12 +122,12 @@
122 122
 end
123 123
 
124 124
 Then /^the tag field in the new todo form should be empty$/ do
125  
-  xpath= "//form[@id='todo-form-new-action']/input[@id='todo_tag_list']"
  125
+  xpath= "//form[@id='todo-form-new-action']/input[@id='tag_list']"
126 126
   page.find(:xpath, xpath).value.blank?.should be_true
127 127
 end
128 128
 
129 129
 Then /^the tag field in the new todo form should be "([^"]*)"$/ do |tag_list|
130  
-  xpath= "//form[@id='todo-form-new-action']/input[@id='todo_tag_list']"
  130
+  xpath= "//form[@id='todo-form-new-action']/input[@id='tag_list']"
131 131
   tag_list.should == page.find(:xpath, xpath).value
132 132
 end
133 133
 
@@ -161,4 +161,4 @@
161 161
   todo.should_not be_nil
162 162
   
163 163
   page.find("div#notes_todo_#{todo.id}").send(visible=="see" ? "should" : "should_not", be_visible)
164  
-end
  164
+end
4  test/functional/todos_controller_test.rb
@@ -49,7 +49,7 @@ def test_tagging_changes_to_tag_with_numbers
49 49
     assert_difference 'Todo.count' do
50 50
       put :create, :_source_view => 'todo', "context_name"=>"library", "project_name"=>"Build a working time machine", "todo"=>{
51 51
         "notes"=>"", "description"=>"test tags", "due"=>"30/11/2006"},
52  
-        "todo_tag_list"=>"1234,5667,9876"
  52
+        "tag_list"=>"1234,5667,9876"
53 53
       # default has_many_polymorphs will fail on these high numbers as tags with those id's do not exist
54 54
     end
55 55
     t = assigns['todo']
@@ -63,7 +63,7 @@ def test_tagging_changes_to_handle_empty_tags
63 63
     assert_difference 'Todo.count' do
64 64
       put :create, :_source_view => 'todo', "context_name"=>"library", "project_name"=>"Build a working time machine", "todo"=>{
65 65
         "notes"=>"", "description"=>"test tags", "due"=>"30/11/2006"},
66  
-        "todo_tag_list"=>"a,,b"
  66
+        "tag_list"=>"a,,b"
67 67
       # default has_many_polymorphs will fail on the empty tag
68 68
     end
69 69
     t = assigns['todo']
4  test/unit/todo_create_params_helper_test.rb
@@ -34,7 +34,7 @@ def test_due_accessor
34 34
   end
35 35
 
36 36
   def test_tag_list_accessor
37  
-    params = { 'todo' => { }, 'todo_tag_list' => 'foo, bar'}
  37
+    params = { 'todo' => { }, 'tag_list' => 'foo, bar'}
38 38
     prefs = users(:admin_user).prefs
39 39
     params_helper = TodosController::TodoCreateParamsHelper.new(params, prefs)
40 40
     assert_equal('foo, bar', params_helper.tag_list)
@@ -133,4 +133,4 @@ def test_context_specified_by_name_is_false_when_context_name_is_blank
133 133
     assert_equal false, params_helper.context_specified_by_name?
134 134
   end
135 135
 
136  
-end
  136
+end

0 notes on commit 9421ae7

Please sign in to comment.
Something went wrong with that request. Please try again.