Edgewall Software

Ticket #5126: 5126.diff

File 5126.diff, 2.2 KB (added by eblot, 19 months ago)

Combination of both patches

  • trac/ticket/templates/ticket.html

     
    116116                <td py:if="idx == 0 or not fullrow" 
    117117                    class="${field and field.name in ('cc', 'keywords') and 'searchable' or None}" 
    118118                    colspan="${fullrow and 3 or None}"> 
    119                   <py:if test="field">${ticket[field.name]}</py:if> 
     119                  <py:if test="field"> 
     120                    <py:choose> 
     121                      <py:when test='field.name == "cc"'> 
     122                        <py:with vars='addrs=",".join([x.split("@")[0] for x in ticket[field.name].split(",")])'> 
     123                          ${addrs} 
     124                        </py:with> 
     125                      </py:when> 
     126                      <py:otherwise> 
     127                        ${ticket[field.name]} 
     128                      </py:otherwise> 
     129                    </py:choose> 
     130                  </py:if> 
    120131                </td> 
    121132              </py:for> 
    122133            </tr> 
     
    195206                      <py:when test="field_name == 'attachment'"> 
    196207                        <a href="${href.attachment('ticket', ticket.id, field.new)}"><em>${field.new}</em></a> added 
    197208                      </py:when> 
     209                      <py:when test="field_name == 'cc'"> 
     210                        <py:with vars='newcc=map(lambda s: s.strip(), field.new.split(","));  
     211                                       oldcc=map(lambda s: s.strip(), field.old.split(",")); 
     212                                       added=", ".join([x.split("@")[0] for x in newcc if x and x not in oldcc]); 
     213                                       removed=", ".join([x.split("@")[0] for x in oldcc if x and x not in newcc])'> 
     214                          <py:if test='added'>added: <em>${added}</em></py:if><py:if test='added and removed'>;</py:if> 
     215                          <py:if test='removed'>removed: <em>${removed}</em></py:if> 
     216                        </py:with> 
     217                      </py:when> 
    198218                      <py:when test="field.old and field.new"> 
    199219                        changed 
    200220                        <py:choose>