Edgewall Software

Ticket #7145: t7145-follow-up-comment28.diff

File t7145-follow-up-comment28.diff, 6.7 KB (added by cboos, 14 months ago)

a few follow-ups to attachment:7145-concurrent-editing-2-r10647.patch

  • trac/htdocs/css/ticket.css

    # HG changeset patch
    # Parent 9ce137a90d5f972acba25d56cbb7e65b1132e3c8
    #7145: a few follow-ups to attachment:7145-concurrent-editing-2-r10647.patch
    
     - correctly handle conflict reporting for the first comment
     - simplify switching off threaded mode
     - change the wording and the presentation of the //other modifications// notification
     - move the //Author or Reporter// block below the preview
    
    diff -r 9ce137a90d5f trac/htdocs/css/ticket.css
    a b div.comment ol { list-style: decimal } 
    110110} 
    111111#trac-comment-editor .wikitoolbar { margin-left: -1px } 
    112112#trac-add-comment :link, #trac-add-comment :visited { color: #b00 } 
    113 #changelog .trac-new { border-left: 0.3em solid #c0f0c0; padding-left: 0.3em; } 
     113.trac-new { border-left: 0.31em solid #c0f0c0; padding-left: 0.31em; } 
    114114#changelog h3, #ticketchange h3 { 
    115115 border-bottom: 1px solid #d7d7d7; 
    116116 color: #999; 
    form .field .wikitoolbar { margin-left:  
    138138form .field div.trac-resizable { width: 100% } 
    139139 
    140140#propertyform { margin-bottom: 2em; } 
    141 #trac-edit-warning .trac-new { background-color: #c0f0c0; } 
    142141#properties { white-space: nowrap; line-height: 160%; padding: .5em } 
    143142#properties table { border-spacing: 0; width: 100%; padding: 0 .5em } 
    144143#properties table th { 
  • trac/htdocs/js/threaded_comments.js

    diff -r 9ce137a90d5f trac/htdocs/js/threaded_comments.js
    a b jQuery(document).ready(function($){ 
    22  var comments = null; 
    33  var toggle = $('#trac-threaded-toggle'); 
    44  toggle.click(function() { 
    5     if ($(this).checked()) { 
     5    $(this).toggleClass('checked'); 
     6    if ($(this).hasClass('checked')) { 
    67      comments = $("div.change"); 
    78      comments.each(function() { 
    89        var children = $("a.follow-up", this).map(function() { 
  • trac/ticket/templates/ticket.html

    diff -r 9ce137a90d5f trac/ticket/templates/ticket.html
    a b  
    4444          // Unthread and update changelog 
    4545          var threaded_toggle = $('#trac-threaded-toggle'); 
    4646          if (threaded_toggle.checked()) 
    47             threaded_toggle.attr('checked', false).click().attr('checked', false); 
     47            threaded_toggle.click(); 
    4848          $("#changelog .trac-new").remove(); 
    4949          var new_changes = items.filter("#new-changes").children(); 
    5050          $("#changelog").append(new_changes); 
    5151          // Show warning 
    5252          $("#trac-edit-warning").toggle(new_changes.length != 0); 
     53          if (new_changes.length != 0) 
     54            $("#changelog").parent().show().removeClass("collapsed"); 
    5355          // Update view time 
    5456          $("#propertyform input[name='view_time']").replaceWith(items.filter("input[name='view_time']")); 
    5557          // Update preview 
     
    130132                      py:with="alist = attachments; foldable = True"/> 
    131133        </py:if> 
    132134 
    133         <div py:if="ticket.exists and changes"> 
     135        <div style="${None if ticket.exists and changes else 'display: none'}"> 
    134136          <form id="trac-threaded-form" method="get" action="" style="display: none"> 
    135137            <div> 
    136138              <input id="trac-threaded-toggle" type="checkbox" /> 
     
    151153            action="${href.ticket(ticket.id) + '#trac-add-comment' if ticket.exists 
    152154                      else href.newticket() + '#ticket'}"> 
    153155        <!--! Add comment --> 
    154         <div py:if="ticket.exists and can_append" class="field"> 
     156        <div py:if="ticket.exists and can_append" id="trac-add-comment" class="field"> 
    155157          <div class="trac-nav"> 
    156158            <a href="#content" title="View ticket fields and description">View</a> &uarr; 
    157159          </div> 
    158           <h2 id="trac-add-comment"> 
     160          <h2> 
    159161            <a id="edit" onfocus="$('#comment').get(0).focus()">Add a comment</a> 
    160162          </h2> 
    161163          <div id="trac-edit-warning" class="warning system-message" 
    162164               style="${'display: none' if start_time == ticket['changetime'] else None}"> 
    163             This ticket has been modified since you started editing. The 
    164             <span class="trac-new">other modifications</span> are highlighted. 
     165            This ticket has been modified since you started editing. You should review the 
     166            <em class="trac-new">other modifications</em> which have been appended above. 
     167            You can nevertheless proceed and submit your changes if you wish so. 
    165168          </div> 
    166169          <!--! Comment field --> 
    167170          <fieldset class="iefix"> 
     
    306309          </div> 
    307310        </div> 
    308311 
     312        <!--! Preview of ticket changes --> 
     313        <div py:if="ticket.exists and can_append" id="ticketchange" class="ticketdraft" 
     314             style="${'display: none' if not (change_preview.fields or change_preview.comment) 
     315                                         or cnum_edit is not None else None}"> 
     316          <h3 class="change" id="${'comment:%d' % change_preview.cnum if 'cnum' in change_preview else None}"> 
     317            <span class="threading" py:if="'replyto' in change_preview"> 
     318              in reply to: ${commentref('&uarr;&nbsp;', change_preview.replyto)} 
     319            </span> 
     320            <i18n:msg params="author">Changed by ${authorinfo(change_preview.author)}</i18n:msg> 
     321          </h3> 
     322          <div id="ticketchange-content"><xi:include href="ticket_change.html" py:with="change = change_preview"/></div> 
     323        </div> 
     324 
    309325        <!--! Author or Reporter --> 
    310326        <div py:if="authname == 'anonymous'" class="field"> 
    311327          <fieldset py:choose=""> 
     
    328344          </fieldset> 
    329345        </div> 
    330346 
    331         <!--! Preview of ticket changes --> 
    332         <div py:if="ticket.exists and can_append" id="ticketchange" class="ticketdraft" 
    333              style="${'display: none' if not (change_preview.fields or change_preview.comment) 
    334                                          or cnum_edit is not None else None}"> 
    335           <h3 class="change" id="${'comment:%d' % change_preview.cnum if 'cnum' in change_preview else None}"> 
    336             <span class="threading" py:if="'replyto' in change_preview"> 
    337               in reply to: ${commentref('&uarr;&nbsp;', change_preview.replyto)} 
    338             </span> 
    339             <i18n:msg params="author">Changed by ${authorinfo(change_preview.author)}</i18n:msg> 
    340           </h3> 
    341           <div id="ticketchange-content"><xi:include href="ticket_change.html" py:with="change = change_preview"/></div> 
    342         </div> 
    343  
    344347        <!--! Attachment on creation checkbox --> 
    345348        <p py:if="not ticket.exists and 'ATTACHMENT_CREATE' in perm(ticket.resource.child('attachment'))"> 
    346349          <label>