Anonymous avatar Anonymous committed 8dc5226

The admin command "milestone add <name> <time>" no actually sets the time as
well. Don't Wiki format ticket summary on the timeline. Closes #397.

Comments (0)

Files changed (3)

scripts/trac-admin

                 self._do_mile_ver_list(type)
             elif arg[0] == 'add' and len(arg) in [2,3]:
                 name = arg[1]
-                time = len(arg) == 3 and arg[2]
-                self._do_mile_ver_add(type, name, time)
+                self._do_mile_ver_add(type, name)
+                if len(arg) == 3:
+                    time = arg[2]
+                    self._do_mile_ver_time(type, name, time)
             elif arg[0] == 'rename'  and len(arg)==3:
                 name = arg[1]
                 newname = arg[2]
         data = self.db_execsql("UPDATE %(type)s SET name='%(newname)s'" 
                                " WHERE name='%(name)s'" % d)
 
-    def _do_mile_ver_add(self, type, name, time):
-        sql = ("INSERT INTO %(type)s('name','time') "
-               " VALUES('%(name)s', '%(time)s')" 
-               % {'type':type, 'name':name, 'time':time})
+    def _do_mile_ver_add(self, type, name):
+        sql = ("INSERT INTO %(type)s('name') "
+               " VALUES('%(name)s')" 
+               % {'type':type, 'name':name})
         data = self.db_execsql(sql)
 
     def _do_mile_ver_remove(self, type, name):

templates/timeline.cs

          edited by '+$item.author, item.message) ?>
     <?cs elif:item.type == #6 ?><!-- milestone -->
       <?cs call:tlitem('', 'milestone.png',
-	 '<b class="tl-item-link">Milestone '+$item.tdata+' reached</b>', '') ?>
+	 '<b class="tl-item-link">Milestone '+$item.message+' reached</b>', '') ?>
     <?cs /if ?>
   </div>
 <?cs /each ?>
             pass
 
 	if milestone:
-	    q.append("SELECT time, -1 AS idata, name AS tdata, 6 AS type, "
-	             "'' AS message, '' AS author " 
+	    q.append("SELECT time, -1 AS idata, '' AS tdata, 6 AS type, "
+	             "name AS message, '' AS author " 
 		     "FROM milestone WHERE time>=%s AND time<=%s" %
 		     (start, stop))
 
 
             if item['type'] == CHANGESET:
                 item['changeset_href'] = self.env.href.changeset(item['idata'])
-                item['shortmsg'] = wiki_to_oneliner(shorten_line(item['message']),
-                                                    self.req.hdf, self.env)
                 item['message'] = wiki_to_oneliner(item['message'],
                                                    self.req.hdf, self.env)
             elif item['type'] == WIKI:
                 item['message'] = wiki_to_oneliner(shorten_line(item['message']),
                                                    self.req.hdf, self.env)
 	    elif item['type'] == MILESTONE:
-		item['shortmsg'] = ''
+		item['message'] = escape(item['message'])
 	    else:
 		item['ticket_href'] = self.env.href.ticket(item['idata'])
 		msg = item['message']
 		shortmsg = shorten_line(msg)
-		item['message'] = wiki_to_oneliner(item['message'],
-                                                   self.req.hdf, self.env)
-		item['shortmsg'] = wiki_to_oneliner(shorten_line(item['message']),
-                                                    self.req.hdf, self.env)
+		item['message'] = escape(item['message'])
 
             info.append(item)
         return info
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.