Edgewall Software

Ticket #2703: reply_to_description.diff

File reply_to_description.diff, 2.7 KB (added by cboos, 2 years ago)

Reply to description, on top of r3374.

  • htdocs/css/ticket.css

     
    6060.inlinebuttons > input { /* rule ignored by IE */ 
    6161 visibility: hidden; 
    6262} 
    63 div.change:hover .inlinebuttons input { 
    64  visibility: visible; 
    65 } 
     63div.change:hover .inlinebuttons input { visibility: visible; } 
     64div.description:hover .inlinebuttons input { visibility: visible; } 
    6665 
    6766#changelog .changes { list-style: square; margin-left: 2em; padding: 0 } 
    6867#changelog .comment { margin-left: 2em } 
  • templates/ticket.cs

     
    7272  /each ?></tr> 
    7373 </table> 
    7474 <?cs if:ticket.description ?><div class="description"> 
     75   <form method="get" action="<?cs var:ticket.href ?>#comment"><div class="inlinebuttons"> 
     76    <input type="hidden" name="replyto" value="description" /> 
     77    <input type="submit" value="Reply" title="Reply, quoting this description" /></div> 
     78   </form> 
    7579  <?cs var:ticket.description.formatted ?> 
    7680 </div><?cs /if ?> 
    7781</div> 
  • trac/ticket/web_ui.py

     
    574574 
    575575        # -- Ticket Change History 
    576576 
     577        def quote_original(author, original): 
     578            if not 'comment' in req.args: # i.e. the comment was not yet edited 
     579                req.hdf['ticket.comment'] = '\n'.join( 
     580                    ['Replying to [comment:%s %s]:' % (replyto, author)] + 
     581                    ['> %s' % line for line in original.splitlines()] + ['']) 
     582 
     583        if replyto == 'description': 
     584            quote_original(reporter_id, ticket['description']) 
     585 
    577586        changelog = ticket.get_changelog(db=db) 
    578587        autonum = 0 # used for "root" numbers 
    579588        replies = {} 
     
    604613                        else: 
    605614                            this_num = old 
    606615                    assert this_num == str(autonum) 
    607                     # if we replied to this comment, quote it (with '>' prefix) 
    608                     if replyto == this_num and not 'comment' in req.args: 
    609                         req.hdf['ticket.comment'] = '\n'.join( 
    610                             ['Replying to [comment:%s %s]:' % \ 
    611                              (replyto, author)] + 
    612                             ['> %s' % line for line in new.splitlines()] + ['']) 
     616                    if replyto == this_num: 
     617                        quote_original(author, new) 
    613618            elif field == 'description': 
    614619                current['fields'][field] = '' 
    615620            else: