Changeset 3400
- Timestamp:
- Jun 13, 2006, 7:49:42 PM (19 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/htdocs/css/timeline.css
r3323 r3400 46 46 dt.wiki, dt.wiki a { background-image: url(../wiki.png) !important } 47 47 dt.milestone, dt.milestone a { background-image: url(../milestone.png) !important } 48 dt.attachment, dt.attachment a { background-image: url(../attachment.png) !important } 48 49 49 50 /* styles for the 'changeset_long_messages' option */ -
trunk/trac/attachment.py
r3399 r3400 35 35 from trac.web.chrome import add_link, add_stylesheet, INavigationContributor 36 36 from trac.wiki import IWikiSyntaxProvider 37 from trac.Timeline import ITimelineEventProvider 37 38 38 39 … … 374 375 yield ('attachment', self._format_link) 375 376 377 # Public methods 378 379 def get_attachment_history(self, start, stop, type): 380 """Return an iterable of tuples describing changes to attachments on 381 a particular object type. 382 383 The tuples are in the form (change, type, id, filename, time, 384 description, author). `change` can currently only be `created`.""" 385 # Traverse attachment directory 386 db = self.env.get_db_cnx() 387 cursor = db.cursor() 388 cursor.execute("SELECT type, id, filename, time, description, author " 389 " FROM attachment " 390 " WHERE time > %s AND time < %s " 391 " AND type = %s", (start, stop, type)) 392 for type, id, filename, time, description, author in cursor: 393 yield ('created', type, id, filename, time, description, author) 394 376 395 # Internal methods 377 396 -
trunk/trac/ticket/web_ui.py
r3399 r3400 20 20 from StringIO import StringIO 21 21 22 from trac.attachment import attachments_to_hdf, Attachment 22 from trac.attachment import attachments_to_hdf, Attachment, AttachmentModule 23 23 from trac.config import BoolOption, Option 24 24 from trac.core import * … … 418 418 yield produce(row, 'new', {}, None, None) 419 419 420 # Attachments 421 if 'ticket_details' in filters: 422 for change, type, id, filename, time, description, author in \ 423 AttachmentModule(self.env). \ 424 get_attachment_history(start, stop, 'ticket'): 425 title = Markup('<em>%s</em> attached to ticket <em>#%s</em> by %s' % 426 (os.path.basename(filename), id, author)) 427 yield ('attachment', 428 self.env.href('attachment', type, id, filename), 429 title, time, author, description) 430 420 431 # Internal methods 421 432 -
trunk/trac/wiki/web_ui.py
r3399 r3400 17 17 # Christopher Lenz <[email protected]> 18 18 19 import os 19 20 import re 20 21 import StringIO 21 22 22 from trac.attachment import attachments_to_hdf, Attachment 23 from trac.attachment import attachments_to_hdf, Attachment, AttachmentModule 23 24 from trac.core import * 24 25 from trac.perm import IPermissionRequestor … … 163 164 yield 'wiki', href, title, t, author, comment 164 165 166 # Attachments 167 for change, type, id, filename, time, description, author in \ 168 AttachmentModule(self.env).get_attachment_history(start, stop, 169 'wiki'): 170 title = Markup('<em>%s</em> attached to <em>%s</em> by %s' % 171 (os.path.basename(filename), id, author)) 172 yield ('attachment', 173 self.env.href('attachment', type, id, filename), 174 title, time, author, description) 175 176 165 177 # Internal methods 166 178
Note:
See TracChangeset
for help on using the changeset viewer.