public
Description: Tracks is a GTD(TM) web application, built with Ruby on Rails
Homepage: http://www.rousette.org.uk/projects/
Clone URL: git://github.com/bsag/tracks.git
Click here to lend your support to: tracks and make a donation at www.pledgie.com !
fix #764 where unnecessary space is removed in the recurrence pattern

also fixes the case that a rec todo that has a start date but no end date is not 
showing the from xx-xx-xxxx on the page
lrbalt (author)
Sat Nov 29 11:15:49 -0800 2008
commit  5659b8adbb321311673611c53bf4af9de0f73c82
tree    8a229ee0d45f8f9bf87f8d15a08ddac59831cdbd
parent  9d246f70cd515f3bea6774e72eda0c1424da2149
...
3
4
5
6
 
7
8
9
...
11
12
13
14
 
15
16
17
...
28
29
30
31
 
32
33
34
 
35
36
37
...
44
45
46
47
 
48
49
50
...
3
4
5
 
6
7
8
9
...
11
12
13
 
14
15
16
17
...
28
29
30
 
31
32
33
 
34
35
36
37
...
44
45
46
 
47
48
49
50
0
@@ -3,7 +3,7 @@ module RecurringTodosHelper
0
   def recurrence_time_span(rt)
0
     case rt.ends_on
0
     when "no_end_date"
0
-      return ""
0
+      return rt.start_from.nil? ? "" : "from " + format_date(rt.start_from)
0
     when "ends_on_number_of_times"
0
       return "for "+rt.number_of_occurences.to_s + " times"
0
     when "ends_on_end_date"
0
@@ -11,7 +11,7 @@ module RecurringTodosHelper
0
       ends = rt.end_date.nil? ? "" : " until " + format_date(rt.end_date)
0
       return starts+ends
0
     else
0
-      raise Exception.new, "unknown recurrence time span selection (#{self.ends_on})"    
0
+      raise Exception.new, "unknown recurrence time span selection (#{self.ends_on})"
0
     end
0
   end
0
   
0
@@ -28,10 +28,10 @@ module RecurringTodosHelper
0
     
0
   def recurring_todo_tag_list
0
     tags_except_starred = @recurring_todo.tags.reject{|t| t.name == Todo::STARRED_TAG_NAME}
0
-    tag_list = tags_except_starred.collect{|t| "<span class=\"tag #{t.name.gsub(' ','-')}\">" + 
0
+    tag_list = tags_except_starred.collect{|t| "<span class=\"tag #{t.name.gsub(' ','-')}\">" +
0
         # link_to(t.name, :controller => "todos", :action => "tag", :id =>
0
         # t.name) + TODO: tag view for recurring_todos (yet?)
0
-      t.name + 
0
+      t.name +
0
         "</span>"}.join('')
0
     "<span class='tags'>#{tag_list}</span>"
0
   end
0
@@ -44,7 +44,7 @@ module RecurringTodosHelper
0
     str
0
   end
0
   
0
-  def recurring_todo_remote_star_icon 
0
+  def recurring_todo_remote_star_icon
0
     str = link_to( image_tag_for_star(@recurring_todo),
0
       toggle_star_recurring_todo_path(@recurring_todo),
0
       :class => "icon star_item", :title => "star the action '#{@recurring_todo.description}'")
...
6
7
8
9
 
 
 
 
 
 
 
 
 
 
10
11
12
...
6
7
8
 
9
10
11
12
13
14
15
16
17
18
19
20
21
0
@@ -6,7 +6,16 @@
0
   <div class="description">
0
     <span class="todo.descr"><%= sanitize(recurring_todo.description) %></span> <%= recurring_todo_tag_list %>
0
     <span class='recurrence_pattern'>
0
-      [<%=recurrence_target(recurring_todo)%> <%= recurring_todo.recurrence_pattern %> <%= recurrence_time_span(recurring_todo) %>]
0
+      <%
0
+         rt = recurrence_target(recurring_todo)
0
+         rp = recurring_todo.recurrence_pattern
0
+         # only add space if recurrence_pattern has content
0
+         rp = " " + rp if !rp.nil?
0
+         rts = recurrence_time_span(recurring_todo)
0
+         # only add space if recurrence_time_span has content
0
+         rts = " " + rts if !(rts == "")
0
+      %>
0
+      [<%=rt%><%=rp%><%=rts%>]
0
     </span>
0
   </div>
0
 </div>

Comments