Making WordPress.org


Ignore:
Timestamp:
05/14/2016 12:27:03 PM (9 years ago)
Author:
ocean90
Message:

Trac: Use user's nicename for gravatars and profile links.

Adds wporg_sanitize_user_nicename() which simulates bb_sanitize_with_dashes() from bbPress.

See #1462.

File:
1 edited

Legend:

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

    r3137 r3140  
    3333
    3434<py:choose>
    35 <py:when test="'author' in change and ('slackbot' == change.author or 'ircbot' == change.author)">
     35<py:when test="'author' in change and ('slackbot' == change.author or 'ircbot' == change.author)"
     36         py:with="wporg_user = wporg_sanitize_user_nicename(change.author)"  >
    3637  <h3 class="change chat-bot">
    3738    <span class="avatar" py:if="change">
    3839      <span class="username-line">
    39         <img src="https://wordpress.org/grav-redirect.php?user=${authorinfo(change.author)}&amp;s=48" srcset="https://wordpress.org/grav-redirect.php?user=${authorinfo(change.author)}&amp;s=96 2x" height="48" width="48" />
     40        <img src="https://wordpress.org/grav-redirect.php?user=${wporg_user}&amp;s=48" srcset="https://wordpress.org/grav-redirect.php?user=${wporg_user}&amp;s=96 2x" height="48" width="48" />
    4041        ${wiki_to_html(context, change.comment, escape_newlines=preserve_newlines)}
    4142      </span>
     
    7475    </span>
    7576    <py:choose>
    76       <py:when test="'author' in change">
     77      <py:when test="'author' in change" py:with="wporg_user = wporg_sanitize_user_nicename(change.author)">
    7778        <span class="avatar" py:if="change">
    78           <span class="username-line"><a href="https://profiles.wordpress.org/${authorinfo(change.author)}" class="profile-link">
    79             <img src="https://wordpress.org/grav-redirect.php?user=${authorinfo(change.author)}&amp;s=48" srcset="https://wordpress.org/grav-redirect.php?user=${authorinfo(change.author)}&amp;s=96 2x" height="48" width="48" /> @<span class="username" data-username="${change.author}">${authorinfo(change.author)}</span></a></span>
     79          <span class="username-line"><a href="https://profiles.wordpress.org/${wporg_user}" class="profile-link">
     80            <img src="https://wordpress.org/grav-redirect.php?user=${wporg_user}&amp;s=48" srcset="https://wordpress.org/grav-redirect.php?user=${wporg_user}&amp;s=96 2x" height="48" width="48" /> @<span class="username" data-username="${change.author}">${authorinfo(change.author)}</span></a></span>
    8081          <py:if test="'date' in change">
    8182            <br /><span class="time-ago">${dateinfo(change.date)} ago</span>
Note: See TracChangeset for help on using the changeset viewer.