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/site-ticket.html

    r3137 r3140  
    3434
    3535<!--! Gravatars for the ticket reporter -->
    36 <td py:match="td[@headers='h_reporter']" py:attrs="select('@*')">
    37   <a href="${profile_link + ticket.reporter}">
    38     <img class="avatar" src="https://wordpress.org/grav-redirect.php?user=${ticket.reporter}&amp;s=48" srcset="https://wordpress.org/grav-redirect.php?user=${ticket.reporter}&amp;s=96 2x" height="48" width="48" />
     36<td py:match="td[@headers='h_reporter']" py:attrs="select('@*')" py:with="wporg_user = wporg_sanitize_user_nicename(ticket.reporter)">
     37  <a href="${profile_link + wporg_user}">
     38    <img class="avatar" 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" />
    3939  </a>
    4040    ${select('*|comment()|text()')}
     
    4343<!--! Gravatars for the ticket owner -->
    4444<td py:match="td[@headers='h_owner']" py:attrs="select('@*')">
    45   <a href="${profile_link + ticket.owner}" py:if="ticket.owner">
    46     <img class="avatar" src="https://wordpress.org/grav-redirect.php?user=${ticket.owner}&amp;s=48" srcset="https://wordpress.org/grav-redirect.php?user=${ticket.owner}&amp;s=96 2x" height="48" width="48" />
     45  <a py:if="ticket.owner" py:with="wporg_user = wporg_sanitize_user_nicename(ticket.owner)" href="${profile_link + wporg_user}">
     46    <img class="avatar" 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" />
    4747  </a>
    4848    ${select('*|comment()|text()')}
Note: See TracChangeset for help on using the changeset viewer.