On Wed, Nov 10, 2010 at 8:08 PM, Steffen Hoffmann <[email protected]> wrote: >>> ITicketRelationPresenter >> >> I'm afraid I shan't be abstracting presentation logic. > > Why now? Certainly you don't have to do this on your own. But providing > an option to allow for different displays would be preferred over an > ExtensionPoint-free solution, where one would have to utilize a template > stream filter to remove that and replace with his/her own version. At > least give an option like ITicketRelationPresenter(nodelist) > > nodelist = [{'type': relation, 'node': tickedID}, {'type': ...}] > > with expected output being a dict like > > {'presentation_type': type; 'element': genshi_element} > > with type being png|html|rst|... and the element just some object ready > to be inserted into the ticket structure with Markup(genshi_element). > The longer I think about it, the type might be obsolete here, if we > don't expect different types of elements, i.e. by wrapping everything in > a element from the Genshi element factory. You could even start with a > dummy implementation returning an empty <div> or literally None and > postpone the «local gantt» or other display creation. > > I know, this needs to be backed by some real code to show, what I mean, > and maybe I'll really do that.
Thank you for the hints. I'm afraid I can't picture in my head the abstracted presentation and which bits of Ticket, TicketSystem and TicketModule I would need to alter. Given time looking at the versioncontrol.web_ui interfaces I might grasp it - code or pseudo code would be a great help. Other parts I can report on: 1. Ticket.populate_from() - Populate (some) fields of a new ticket from an existing one. The fields populated are configured in trac.ini under [ticket]/default_copy_fields, if not specified then the default is none. With this a visit to /newticket?template_ticket=7 will pre-populate the specified fields from ticket 7. This feature could be applied independently of ticket link work. 2. Create linked ticket - Using the same method a visit to /newticket?linked_field=children&linked_val=7 will pre-populate the new ticket fields from ticket 7 and pre-populate the child field with #7. The fields to populate can be overridden on a per-link basis, e.g. [ticket]/default_copy_fields = milestone [ticket-links]/children.copy_fields = summary, description It's still rough, the new code doesn't have unit tests or i18n, but I'm eager to hear your comments and queries. As before the code is in https://bitbucket.org/moreati/trac-ticketlinks/ Regards, Alex -- Alex Willmer <[email protected]> http://moreati.org.uk/blog http://twitter.com/moreati -- You received this message because you are subscribed to the Google Groups "Trac Development" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/trac-dev?hl=en.
