Making WordPress.org

Changeset 12168


Ignore:
Timestamp:
10/31/2022 07:08:18 AM (2 years ago)
Author:
dd32
Message:

Trac: Allow editing PR bot comments.

Closes https://github.com/WordPress/wordpress.org/pull/105.
Fixes #6555.

Location:
sites/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/trac.wordpress.org/templates/site.html

    r12156 r12168  
    55
    66<?python
    7     scripts_version = '207'
     7    scripts_version = '208'
    88    project_slug = req.environ['HTTP_HOST'].split(':')[0].split('.')[0]
    99    wporg_endpoint = 'https://make.wordpress.org/' + project_slug + '/'
  • sites/trunk/trac.wordpress.org/templates/ticket_change.html

    r11795 r12168  
    6969      <br /><span class="time-ago">${dateinfo(change.date)} ago</span>
    7070    </span>
     71    <span class="threading">
     72      <span py:if="'cnum' in change" id="comment:$cnum" class="cnum">${commentref('#', cnum)}</span>
     73    </span>
     74    <div py:if="show_buttons" class="trac-ticket-buttons">
     75      <form py:if="'cnum' in change and can_edit_comment" method="get" action="#comment:${cnum}">
     76        <div class="inlinebuttons">
     77        <input type="hidden" name="cnum_edit" value="${cnum}"/>
     78        <input type="submit" value="${captioned_button('✎', _('Edit'))}" title="${_('Edit comment %(cnum)s', cnum=cnum)}" />
     79        </div>
     80      </form>
     81    </div>
    7182  </h3>
    7283  <ul py:if="change.fields" class="changes">
     
    8899    </li>
    89100  </ul>
    90   <div py:if="pr_comment" class="comment searchable" xml:space="preserve">
     101  <div py:if="pr_comment and not show_editor" class="comment searchable" xml:space="preserve">
    91102    ${wiki_to_html(context, pr_comment, escape_newlines=preserve_newlines)}
    92103  </div>
     104  <form py:if="show_editor" id="trac-comment-editor" method="post" action="${href.ticket(ticket.id) + '#comment:%d' % cnum}">
     105    <div>
     106      <textarea name="edited_comment" class="wikitext trac-resizable" rows="10" cols="78">
     107${edited_comment if edited_comment is not None else change.comment}</textarea>
     108      <input type="hidden" name="cnum_edit" value="${cnum}"/>
     109    </div>
     110    <div class="buttons">
     111      <input type="submit" name="edit_comment" value="${_('Submit changes')}" title="${_('Submit changes to comment %(cnum)s', cnum=cnum)}"/>
     112      <input type="submit" name="cancel_comment" value="${_('Cancel')}" title="Cancel comment edit"/>
     113    </div>
     114  </form>
    93115</py:when>
    94116<py:otherwise>
  • sites/trunk/wordpress.org/public_html/style/trac/wp-trac.css

    r12076 r12168  
    934934}
    935935#changelog h3.chat-bot .trac-ticket-buttons {
     936    display: none;
     937}
     938#changelog h3.chat-bot.pr-bot:hover .trac-ticket-buttons {
     939    display: inherit;
     940}
     941#changelog h3.chat-bot.pr-bot .trac-ticket-buttons .trac-delete {
    936942    display: none;
    937943}
Note: See TracChangeset for help on using the changeset viewer.