Gary's right about lists; see the screenshots. Ignoring field.rendered: [image: Inline image 1]
Using field.rendered: [image: Inline image 2] On Thu, Jul 25, 2013 at 1:38 PM, Gary Martin <[email protected]>wrote: > Yup.. > > I think the best advice for new contributors is to reply to the email they > get from commenting on the issue tracker to get their work recognised on > this list. The dev list is expected to have a much greater readership. > > Anyway, thanks for investigating this issue - good job I think. The > _render_property_diff method is quite a big chunk of code to consider > overriding to get the changes implemented outside of the trac code so I > would wonder if it is worth passing this on to the Trac devs to see if they > wouldn't mind adding the classes as James suggests. > > I am not yet sure that the alternative of ignoring the pre-rendering of > fields will always work at this point. If we are talking about fields that > are treated as lists we may only want to see what is added or removed > rather than the whole before and after. Then again I haven't tested that > this is what we would get yet! Apart from that, I suspect that the > pre-rendering python code will be triggered regardless, even if we choose > not to make use of it so it may be slightly wasteful.. > > Cheers, > Gary > > > > On 25/07/13 11:53, James Wood wrote: > >> ^Is this worth asking about on the dev list? >> >> >> On Wed, Jul 24, 2013 at 5:50 PM, Apache Bloodhound < >> [email protected]> wrote: >> >> #359: Highlight field values in ticket comments feed >>> --------------------------+---**------------------------------** >>> --------- >>> Reporter: olemis | Owner: nobody >>> Type: enhancement | Status: new >>> Priority: trivial | Milestone: >>> Component: ui design | Version: >>> Resolution: | Keywords: ticket comments diff starter >>> --------------------------+---**------------------------------** >>> --------- >>> >>> Comment (by mudri): >>> >>> It works when this is added to the previous stuff: >>> {{{ >>> #!python >>> Index: trac/trac/ticket/web_ui.py >>> ==============================**==============================** >>> ======= >>> --- trac/trac/ticket/web_ui.py (revision 1505634) >>> +++ trac/trac/ticket/web_ui.py (working copy) >>> @@ -1743,9 +1743,9 @@ >>> 'EMAIL_VIEW' in req.perm(resource_new or >>> ticket.resource)): >>> render_elt = obfuscate_email_address >>> if (old_list, new_list) != (None, None): >>> - added = [tag.em(render_elt(x)) for x in new_list >>> + added = [tag.em(render_elt(x), class_="new-value") for x >>> in >>> new_list >>> if x not in old_list] >>> - remvd = [tag.em(render_elt(x)) for x in old_list >>> + remvd = [tag.em(render_elt(x), class_="old-value") for x >>> in >>> old_list >>> if x not in new_list] >>> added = added and tagn_("%(items)s added", "%(items)s >>> added", >>> len(added), items=separated(added, >>> sep)) >>> @@ -1759,12 +1759,12 @@ >>> old = obfuscate_email_address(old) >>> new = obfuscate_email_address(new) >>> if old and not new: >>> - rendered = tag_("%(value)s deleted", >>> value=tag.em(old)) >>> + rendered = tag_("%(value)s deleted", value=tag.em(old, >>> class_="old-value")) >>> elif new and not old: >>> - rendered = tag_("set to %(value)s", value=tag.em(new)) >>> + rendered = tag_("set to %(value)s", value=tag.em(new, >>> class_="new-value")) >>> elif old and new: >>> rendered = tag_("changed from %(old)s to %(new)s", >>> - old=tag.em(old), new=tag.em(new)) >>> + old=tag.em(old, class_="old-value"), >>> new=tag.em(new, class_="new-value")) >>> return rendered >>> >>> def grouped_changelog_entries(**self, ticket, db=None, >>> when=None): >>> }}} >>> That does mean modifying Trac, but it's only adding classes to >>> elements. >>> An alternative is to take out the line >>> {{{ >>> #!xml >>> <py:when test="'rendered' in field">${field.rendered}</py:**when> >>> }}} >>> from bh_ticket_change.html. This just ignores any rendering which has >>> been >>> done for us. >>> >>> -- >>> Ticket URL: <https://issues.apache.org/**bloodhound/ticket/359#comment:* >>> *6 <https://issues.apache.org/bloodhound/ticket/359#comment:6>> >>> Apache Bloodhound >>> <https://issues.apache.org/**bloodhound/<https://issues.apache.org/bloodhound/> >>> > >>> The Apache Bloodhound issue tracker >>> >>> >
