# 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 } |
| 110 | 110 | } |
| 111 | 111 | #trac-comment-editor .wikitoolbar { margin-left: -1px } |
| 112 | 112 | #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; } |
| 114 | 114 | #changelog h3, #ticketchange h3 { |
| 115 | 115 | border-bottom: 1px solid #d7d7d7; |
| 116 | 116 | color: #999; |
| … |
… |
form .field .wikitoolbar { margin-left: |
| 138 | 138 | form .field div.trac-resizable { width: 100% } |
| 139 | 139 | |
| 140 | 140 | #propertyform { margin-bottom: 2em; } |
| 141 | | #trac-edit-warning .trac-new { background-color: #c0f0c0; } |
| 142 | 141 | #properties { white-space: nowrap; line-height: 160%; padding: .5em } |
| 143 | 142 | #properties table { border-spacing: 0; width: 100%; padding: 0 .5em } |
| 144 | 143 | #properties table th { |
diff -r 9ce137a90d5f trac/htdocs/js/threaded_comments.js
|
a
|
b
|
jQuery(document).ready(function($){ |
| 2 | 2 | var comments = null; |
| 3 | 3 | var toggle = $('#trac-threaded-toggle'); |
| 4 | 4 | toggle.click(function() { |
| 5 | | if ($(this).checked()) { |
| | 5 | $(this).toggleClass('checked'); |
| | 6 | if ($(this).hasClass('checked')) { |
| 6 | 7 | comments = $("div.change"); |
| 7 | 8 | comments.each(function() { |
| 8 | 9 | var children = $("a.follow-up", this).map(function() { |
diff -r 9ce137a90d5f trac/ticket/templates/ticket.html
|
a
|
b
|
|
| 44 | 44 | // Unthread and update changelog |
| 45 | 45 | var threaded_toggle = $('#trac-threaded-toggle'); |
| 46 | 46 | if (threaded_toggle.checked()) |
| 47 | | threaded_toggle.attr('checked', false).click().attr('checked', false); |
| | 47 | threaded_toggle.click(); |
| 48 | 48 | $("#changelog .trac-new").remove(); |
| 49 | 49 | var new_changes = items.filter("#new-changes").children(); |
| 50 | 50 | $("#changelog").append(new_changes); |
| 51 | 51 | // Show warning |
| 52 | 52 | $("#trac-edit-warning").toggle(new_changes.length != 0); |
| | 53 | if (new_changes.length != 0) |
| | 54 | $("#changelog").parent().show().removeClass("collapsed"); |
| 53 | 55 | // Update view time |
| 54 | 56 | $("#propertyform input[name='view_time']").replaceWith(items.filter("input[name='view_time']")); |
| 55 | 57 | // Update preview |
| … |
… |
|
| 130 | 132 | py:with="alist = attachments; foldable = True"/> |
| 131 | 133 | </py:if> |
| 132 | 134 | |
| 133 | | <div py:if="ticket.exists and changes"> |
| | 135 | <div style="${None if ticket.exists and changes else 'display: none'}"> |
| 134 | 136 | <form id="trac-threaded-form" method="get" action="" style="display: none"> |
| 135 | 137 | <div> |
| 136 | 138 | <input id="trac-threaded-toggle" type="checkbox" /> |
| … |
… |
|
| 151 | 153 | action="${href.ticket(ticket.id) + '#trac-add-comment' if ticket.exists |
| 152 | 154 | else href.newticket() + '#ticket'}"> |
| 153 | 155 | <!--! 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"> |
| 155 | 157 | <div class="trac-nav"> |
| 156 | 158 | <a href="#content" title="View ticket fields and description">View</a> ↑ |
| 157 | 159 | </div> |
| 158 | | <h2 id="trac-add-comment"> |
| | 160 | <h2> |
| 159 | 161 | <a id="edit" onfocus="$('#comment').get(0).focus()">Add a comment</a> |
| 160 | 162 | </h2> |
| 161 | 163 | <div id="trac-edit-warning" class="warning system-message" |
| 162 | 164 | 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. |
| 165 | 168 | </div> |
| 166 | 169 | <!--! Comment field --> |
| 167 | 170 | <fieldset class="iefix"> |
| … |
… |
|
| 306 | 309 | </div> |
| 307 | 310 | </div> |
| 308 | 311 | |
| | 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('↑ ', 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 | |
| 309 | 325 | <!--! Author or Reporter --> |
| 310 | 326 | <div py:if="authname == 'anonymous'" class="field"> |
| 311 | 327 | <fieldset py:choose=""> |
| … |
… |
|
| 328 | 344 | </fieldset> |
| 329 | 345 | </div> |
| 330 | 346 | |
| 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('↑ ', 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 | | |
| 344 | 347 | <!--! Attachment on creation checkbox --> |
| 345 | 348 | <p py:if="not ticket.exists and 'ATTACHMENT_CREATE' in perm(ticket.resource.child('attachment'))"> |
| 346 | 349 | <label> |