Edgewall Software

Ticket #2703: reply_to_description_static_buttons.diff

File reply_to_description_static_buttons.diff, 4.9 KB (added by cboos, 2 years ago)

Use unobtrusive static Reply buttons, instead of the auto-hide ones. The patch also contains the reply to description changes from above, adapted to the new style. Patch on r3379.

  • htdocs/css/ticket.css

     
    3939#ticket table.properties td { width: 30% } 
    4040#ticket table.properties .description { border-top: 1px solid #dd9 } 
    4141 
     42#ticket .description form {  
     43 float: right; 
     44 position: relative; 
     45 bottom: 1.8em; 
     46} 
     47 
    4248#changelog { border: 1px outset #996; padding: 1em } 
    4349#changelog h3 { 
    4450 border-bottom: 1px solid #d7d7d7; 
     
    4753 font-weight: normal; 
    4854} 
    4955#changelog .threading { 
    50         float: right; 
     56 float: right; 
     57 position: relative; 
     58 bottom: 0.3em; 
    5159} 
     60#changelog h3 .threading form {  
     61 display: inline 
     62} 
    5263.inlinebuttons input {  
    53  float: right; 
    5464 font-size: 70%; 
    5565 border-width: 1px; 
    56  margin: 0 .5em .1em 1.5em; 
     66 margin: 0 0 0 .5em; 
    5767 padding: 0.1em; 
    58  background-color: #f6f6f6; 
     68 background: none; 
    5969} 
    60 .inlinebuttons > input { /* rule ignored by IE */ 
    61  visibility: hidden; 
    62 } 
    63 div.change:hover .inlinebuttons input { 
    64  visibility: visible; 
    65 } 
    6670 
    6771#changelog .changes { list-style: square; margin-left: 2em; padding: 0 } 
    6872#changelog .comment { margin-left: 2em } 
  • templates/ticket.cs

     
    7373 </table> 
    7474 <?cs if:ticket.description ?><div class="description"> 
    7575  <?cs var:ticket.description.formatted ?> 
     76  <form method="get" action="<?cs var:ticket.href ?>#comment"><div class="inlinebuttons"> 
     77   <input type="hidden" name="replyto" value="description" /> 
     78   <input type="submit" value="Reply" title="Reply, quoting this description" /></div> 
     79  </form> 
    7680 </div><?cs /if ?> 
    7781</div> 
    7882 
     
    9397    set:nreplies = len(ticket.replies[change.cnum]) ?><?cs 
    9498    if:nreplies || change.replyto ?><span class="threading"> (<?cs 
    9599     if:change.replyto ?>in reply to: <?cs  
    96       call:commentref('&uarr;', change.replyto) ?><?cs if nreplies ?>; <?cs /if ?><?cs 
     100      call:commentref('&uarr;&nbsp;', change.replyto) ?><?cs if nreplies ?>; <?cs /if ?><?cs 
    97101     /if ?><?cs 
    98102     if nreplies ?><?cs 
    99103      call:plural('follow-up', nreplies) ?>: <?cs  
    100104      each:reply = ticket.replies[change.cnum] ?><?cs  
    101        call:commentref('&darr;', reply) ?><?cs  
     105       call:commentref('&darr;&nbsp;', reply) ?><?cs  
    102106      /each ?><?cs  
    103107     /if ?>)<?cs 
    104     /if ?></span><?cs 
     108    /if ?><form method="get" action="<?cs var:ticket.href ?>#comment"><span class="inlinebuttons"> 
     109    <input type="hidden" name="replyto" value="<?cs var:change.cnum ?>" /> 
     110    <input type="submit" value="Reply" title="Reply to comment <?cs var:change.cnum ?>" /></span> 
     111   </form> 
     112    </span><?cs 
    105113   /if ?><?cs 
    106114   var:change.date ?> changed by <?cs var:change.author ?><?cs 
    107115   if:change.cnum ?>&nbsp;<a href="#comment:<?cs var:change.cnum ?>" class="anchor" 
    108116      title="Permalink to comment:<?cs var:change.cnum ?>">&para;</a><?cs 
    109117   /if ?> 
    110118  </h3><?cs 
    111   if:change.cnum ?> 
    112    <form method="get" action="<?cs var:ticket.href ?>#comment"><div class="inlinebuttons"> 
    113     <input type="hidden" name="replyto" value="<?cs var:change.cnum ?>" /> 
    114     <input type="submit" value="Reply" title="Reply to comment <?cs var:change.cnum ?>" /></div> 
    115    </form><?cs  
    116   /if ?><?cs 
    117119  if:len(change.fields) ?> 
    118120   <ul class="changes"><?cs 
    119121   each:field = change.fields ?> 
  • 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: