Edgewall Software

Ticket #2703: reply_to_description_static_buttons.2.diff

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

Same as above, with a few more fixes. Ready to commit ;)

  • 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 } 
  • trac/ticket/web_ui.py

     
    574574 
    575575        # -- Ticket Change History 
    576576 
     577        def quote_original(author, original, link): 
     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 [%s %s]:' % (link, author)] + 
     581                    ['> %s' % line for line in original.splitlines()] + ['']) 
     582 
     583        if replyto == 'description': 
     584            quote_original(reporter_id, ticket['description'], 
     585                           'ticket:%d' % ticket.id) 
     586 
    577587        changelog = ticket.get_changelog(db=db) 
    578588        autonum = 0 # used for "root" numbers 
    579589        replies = {} 
     
    604614                        else: 
    605615                            this_num = old 
    606616                    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()] + ['']) 
     617                    if replyto == this_num: 
     618                        quote_original(author, new, 'comment:%s' % replyto) 
    613619            elif field == 'description': 
    614620                current['fields'][field] = '' 
    615621            else: 
  • templates/ticket.cs

     
    7171   /if ?><?cs 
    7272  /each ?></tr> 
    7373 </table> 
    74  <?cs if:ticket.description ?><div class="description"> 
     74 <?cs if:ticket.description ?><div id="description" 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 
     
    8993 each:change = ticket.changes ?> 
    9094 <div class="change"> 
    9195  <h3 <?cs if:change.cnum ?>id="comment:<?cs var:change.cnum ?>"<?cs /if ?>><?cs 
    92    if:change.cnum ?><?cs 
    93     set:nreplies = len(ticket.replies[change.cnum]) ?><?cs 
    94     if:nreplies || change.replyto ?><span class="threading"> (<?cs 
    95      if:change.replyto ?>in reply to: <?cs  
    96       call:commentref('&uarr;', change.replyto) ?><?cs if nreplies ?>; <?cs /if ?><?cs 
    97      /if ?><?cs 
    98      if nreplies ?><?cs 
    99       call:plural('follow-up', nreplies) ?>: <?cs  
    100       each:reply = ticket.replies[change.cnum] ?><?cs  
    101        call:commentref('&darr;', reply) ?><?cs  
    102       /each ?><?cs  
    103      /if ?>)<?cs 
    104     /if ?></span><?cs 
     96   if:change.cnum ?> 
     97    <span class="threading"><?cs 
     98     set:nreplies = len(ticket.replies[change.cnum]) ?><?cs 
     99     if:nreplies || change.replyto ?>(<?cs 
     100      if:change.replyto ?>in reply to: <?cs  
     101       call:commentref('&uarr;&nbsp;', change.replyto) ?><?cs if nreplies ?>; <?cs /if ?><?cs 
     102      /if ?><?cs 
     103      if nreplies ?><?cs 
     104       call:plural('follow-up', nreplies) ?>: <?cs  
     105       each:reply = ticket.replies[change.cnum] ?><?cs  
     106        call:commentref('&darr;&nbsp;', reply) ?><?cs  
     107       /each ?><?cs  
     108      /if ?>)<?cs 
     109    /if ?><form method="get" action="<?cs var:ticket.href ?>#comment"><span class="inlinebuttons"> 
     110    <input type="hidden" name="replyto" value="<?cs var:change.cnum ?>" /> 
     111    <input type="submit" value="Reply" title="Reply to comment <?cs var:change.cnum ?>" /></span> 
     112   </form> 
     113    </span><?cs 
    105114   /if ?><?cs 
    106115   var:change.date ?> changed by <?cs var:change.author ?><?cs 
    107116   if:change.cnum ?>&nbsp;<a href="#comment:<?cs var:change.cnum ?>" class="anchor" 
    108117      title="Permalink to comment:<?cs var:change.cnum ?>">&para;</a><?cs 
    109118   /if ?> 
    110119  </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 
    117120  if:len(change.fields) ?> 
    118121   <ul class="changes"><?cs 
    119122   each:field = change.fields ?> 
     
    176179   </tr><?cs 
    177180   /if ?><?cs 
    178181   if:trac.acl.TICKET_ADMIN ?><tr> 
    179     <th><label for="description">Description:</label></th> 
     182    <th><label for="description-editor">Description:</label></th> 
    180183    <td class="fullrow" colspan="3"> 
    181      <textarea id="description" name="description" class="wikitext" rows="10" cols="68"><?cs 
     184     <textarea id="description-editor" name="description" class="wikitext" rows="10" cols="68"><?cs 
    182185        var:ticket.description ?></textarea> 
    183186    </td> 
    184187   </tr><tr>