WordPress.org

Making WordPress.org

Changeset 1999


Ignore:
Timestamp:
10/18/2015 10:23:21 PM (4 years ago)
Author:
nacin
Message:

Trac: Ensure site.html changes are applied to ticket previews.

site.html is not loaded in this case. Thus, split off the functionality into site-ticket.html,
then load site-ticket.html in an overloaded ticket_preview.html.

fixes #418.

Location:
sites/trunk/trac.wordpress.org/templates
Files:
1 added
2 edited

Legend:

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

    r1997 r1999  
    2020        support_link = '//wordpress.org/support/'
    2121
    22     profile_link = '//profiles.wordpress.org/'
    2322    profile_to_edit = '//wordpress.org/support/profile/'
    2423
     
    3231    except (IndexError, KeyError):
    3332        pass
    34 
    35     field_types = [ 'milestone', 'priority', 'type', 'severity', 'version', 'component', 'keywords', 'focuses', ]
    36 
    37     # Sorting function
    38     def sort_nicely(field1, field2):
    39         try:
    40             idx1 = field_types.index(field1['name'])
    41         except ValueError:
    42             idx1 = 1000 # no match, push to the end
    43 
    44         try:
    45             idx2 = field_types.index(field2['name'])
    46         except ValueError:
    47             idx2 = 1000 # no match, push to the end
    48 
    49         return cmp(idx1, idx2)
    50 
    51     if ticket and 'fields' in locals():
    52         # Sort the fields
    53         fields.sort(cmp=sort_nicely)
    54 
    55         # Re-generate fields_map for use within the ticket template
    56         fields_map = {}
    57         for i in xrange(0, len(fields)):
    58             fields_map[ fields[i]['name'] ] = i
    5933?>
    6034
     
    221195    <input type="submit" value="Agree and Upload" />
    222196</py:match>
    223 
    224 <!--! Gravatars for the ticket reporter -->
    225 <td py:match="td[@headers='h_reporter']" py:attrs="select('@*')">
    226     <a href="${profile_link + ticket.reporter}">
    227         <img class="avatar" src="//wordpress.org/grav-redirect.php?user=${ticket.reporter}&amp;s=48" srcset="//wordpress.org/grav-redirect.php?user=${ticket.reporter}&amp;s=96 2x" height="48" width="48" />
    228     </a>
    229     ${select('*|comment()|text()')}
    230 </td>
    231 
    232 <!--! Gravatars for the ticket owner -->
    233 <td py:match="td[@headers='h_owner']" py:attrs="select('@*')">
    234     <a href="${profile_link + ticket.owner}" py:if="ticket.owner">
    235         <img class="avatar" src="//wordpress.org/grav-redirect.php?user=${ticket.owner}&amp;s=48" srcset="//wordpress.org/grav-redirect.php?user=${ticket.owner}&amp;s=96 2x" height="48" width="48" />
    236     </a>
    237     ${select('*|comment()|text()')}
    238 </td>
    239197
    240198<!--! Show number of Query results even when they fit on one page -->
     
    369327</body>
    370328
     329<xi:include href="site-ticket.html" />
    371330<xi:include href="site-specific.html"><xi:fallback /></xi:include>
    372331</html>
  • sites/trunk/trac.wordpress.org/templates/ticket_preview.html

    r1998 r1999  
    99               has_edit_comment = 'TICKET_EDIT_COMMENT' in perm(ticket.resource);"
    1010      py:strip="">
     11  <xi:include href="site-ticket.html"/>
    1112  <xi:include href="ticket_box.html"/>
    1213  <div id="changelog">
Note: See TracChangeset for help on using the changeset viewer.