Changeset 3130
- Timestamp:
- 01/22/08 22:07:43 (1 year ago)
- Files:
-
- announcerplugin/0.11/announcerplugin/formatters/ticket_email.py (modified) (6 diffs)
- announcerplugin/0.11/announcerplugin/subscribers/wiki.py (modified) (2 diffs)
- announcerplugin/0.11/announcerplugin/templates/ticket_email_mimic.html (modified) (1 diff)
- announcerplugin/0.11/announcerplugin/templates/ticket_email_plaintext.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
announcerplugin/0.11/announcerplugin/formatters/ticket_email.py
r3107 r3130 1 1 from trac.core import Component, implements 2 2 from announcerplugin.api import IAnnouncementFormatter 3 from trac.config import Option, IntOption 3 from trac.config import Option, IntOption, ListOption 4 4 from genshi.template import NewTextTemplate, MarkupTemplate 5 5 from genshi import HTML … … 33 33 ticket_email_subject = Option('announcer', 'ticket_email_subject', 34 34 "Ticket #${ticket.id}: ${ticket['summary']} {% if action %}[${action}]{% end %}") 35 36 ticket_email_header_fields = ListOption('announcer', 'ticket_email_header_fields', 'owner, reporter, milestone, priority, severity') 35 37 36 38 def get_format_transport(self): … … 68 70 69 71 def format_subject(self, transport, realm, style, event): 72 action = None 70 73 if transport == "email": 71 74 if realm == "ticket": … … 73 76 if 'status' in event.changes: 74 77 action = 'Status -> %s' % (event.target['status']) 75 else: 76 action = None 78 77 79 template = NewTextTemplate(self.ticket_email_subject) 78 80 return template.generate(ticket=event.target, event=event, action=action).render() … … 115 117 author = event.author, 116 118 comment = event.comment, 119 header = self.ticket_email_header_fields, 117 120 category = event.category, 118 121 ticket_link = self.env.abs_href('ticket', ticket.id), … … 170 173 ticket = ticket, 171 174 author = event.author, 175 header = self.ticket_email_header_fields, 172 176 comment = event.comment, 173 177 category = event.category, announcerplugin/0.11/announcerplugin/subscribers/wiki.py
r3107 r3130 58 58 59 59 sess['announcer_wiki_interests'] = ' '.join( 60 urllib.quote(x) for x in options 60 urllib.quote( 61 x.replace('*', '.*?') 62 ) for x in options 61 63 ) 62 64 … … 68 70 return "prefs_announcer_wiki.html", dict( 69 71 wiki_interests = '\n'.join( 70 urllib.unquote(x) for x in interests.split(' ') 72 urllib.unquote( 73 x.replace('.*?', '*') 74 ) for x in interests.split(' ') 71 75 ) 72 76 ) announcerplugin/0.11/announcerplugin/templates/ticket_email_mimic.html
r3107 r3130 118 118 <div class="title" style="font-weight: bold; border-bottom: 1pt inset #dfdfdf; padding-bottom: .5em;">${ticket['summary']}</div> 119 119 <table class="header" width="100%"> 120 <tr> 121 <td class="label" width="30%" style="font-size: x-small; color: #7e7e7e; border-bottom: 1pt inset #dfdfdf; padding-bottom: .5em; width: 30%;">Owned by:</td> 122 <td class="value" width="70%" style="border-bottom: 1pt inset #dfdfdf; padding-bottom: .5em; font-size: small;">${ticket['owner']}</td> 123 </tr> 124 <tr> 125 <td class="label" style="font-size: x-small; color: #7e7e7e; border-bottom: 1pt inset #dfdfdf; padding-bottom: .5em; width: 30%;">Reported by:</td> 126 <td class="value" style="border-bottom: 1pt inset #dfdfdf; padding-bottom: .5em; font-size: small;">${ticket['reporter']}</td> 127 </tr> 128 <tr py:if="ticket['milestone']"> 129 <td class="label" style="font-size: x-small; color: #7e7e7e; border-bottom: 1pt inset #dfdfdf; padding-bottom: .5em; width: 30%;">Milestone:</td> 130 <td class="value" style="border-bottom: 1pt inset #dfdfdf; padding-bottom: .5em; font-size: small;">${ticket['milestone']}</td> 131 </tr> 132 <tr py:if="ticket['priority']"> 133 <td class="label" style="font-size: x-small; color: #7e7e7e; border-bottom: 1pt inset #dfdfdf; padding-bottom: .5em; width: 30%;">Priority:</td> 134 <td class="value" style="border-bottom: 1pt inset #dfdfdf; padding-bottom: .5em; font-size: small;">${ticket['priority']}</td> 135 </tr> 136 <tr py:if="ticket['severity']"> 137 <td class="label" style="font-size: x-small; color: #7e7e7e; border-bottom: 1pt inset #dfdfdf; padding-bottom: .5em; width: 30%;">Severity:</td> 138 <td class="value" style="border-bottom: 1pt inset #dfdfdf; padding-bottom: .5em; font-size: small;">${ticket['severity']}</td> 120 <tr py:for="field in header"> 121 <td class="label" width="30%" style="font-size: x-small; color: #7e7e7e; border-bottom: 1pt inset #dfdfdf; padding-bottom: .5em; width: 30%;">${field.capitalize()}:</td> 122 <td class="value" width="70%" style="border-bottom: 1pt inset #dfdfdf; padding-bottom: .5em; font-size: small;">${ticket[field] or 'None'}</td> 139 123 </tr> 140 124 </table> announcerplugin/0.11/announcerplugin/templates/ticket_email_plaintext.txt
r3046 r3130 2 2 ${ticket['status']} ${ticket['type']} 3 3 --------------------------------------------------------------------- 4 Owner: {% choose %}\ 5 {% when ticket['owner'] %}\ 6 ${ticket['owner']}\ 4 {% for field in header %}\ 5 {% choose %}\ 6 {% when ticket[field] %}\ 7 ${field.capitalize()}: ${ticket[field]} 7 8 {% end %}\ 8 9 {% otherwise %}\ 9 (None)\ 10 ${field.capitalize()}: (None) 10 11 {% end %}\ 11 {% end %} 12 Reporter: ${ticket['reporter']} 13 {% if ticket['milestone'] %}Milestone: ${ticket['milestone']} {% end %} 14 {% if ticket['priority'] %}Priority: ${ticket['priority']} {% end %} 15 {% if ticket['severity'] %}Severity: ${ticket['severity']} {% end %} 12 {% end %}\ 13 {% end %}\ 16 14 {% if category == 'created' %}\ 17 15 --------------------------------------------------------------------- … … 39 37 Attachment: 40 38 * File '${attachment.filename}' added{% if attachment.description %}: ${attachment.description} {% end %} 41 {% end %} 39 {% end %}\ 42 40 {% if comment %}\ 43 41 ---------------------------------------------------------------------
