WordPress.org

Making WordPress.org

Changeset 260


Ignore:
Timestamp:
01/10/2014 05:04:48 AM (7 years ago)
Author:
nacin
Message:

Trac: Template updates to go with [259]. see #127.

File:
1 edited

Legend:

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

    r257 r260  
    88    project_slug = req.environ['HTTP_HOST'].split(':')[0].split('.')[0]
    99    wporg_endpoint = '//make.wordpress.org/core/'
     10
     11    if project_slug == 'core':
     12        notifications_enabled = 1
    1013
    1114    if project_slug == 'bbpress' :
     
    242245            <div id="wp-auth-check">
    243246                <div class="wp-auth-check-close" tabindex="0" title="Close"></div>
    244                 <div class="wp-auth-fallback"><p><b class="wp-auth-fallback-expired" tabindex="0">Session expired</b></p><p><a href="${wporg_endpoint}wp-login.php" target="_blank">Please log in again.</a> The login page will open in a new window. After logging in you can close it and return to this page.</p>
     247                <div class="wp-auth-fallback"><p><b class="wp-auth-fallback-expired" tabindex="0">Session expired</b></p><p><a href="//wordpress.org/support/bb-login.php" target="_blank">Please log in again.</a> The login page will open in a new window. After logging in you can close it and return to this page.</p>
    245248                </div>
    246249            </div>
     
    263266
    264267    <!--! Trac notifications -->
    265     <py:if test="project_slug == 'core'">
     268    <py:if test="notifications_enabled">
    266269        <script>
    267         jQuery( wpTrac.hide_cc_field );
    268         </script>
    269         <script py:if="ticket and ticket.exists">
    270         if ( 'notifications' in wpTrac ) {
    271             jQuery(document).ready( function( $ ) {
    272                 var endpoint = '${wporg_endpoint}', ticket = ${ticket.id};
    273                 $.ajax({
    274                     url: endpoint + '?trac-notifications=' + ticket,
    275                     xhrFields: { withCredentials: true }
    276                 }).success( function( data ) {
    277                     if ( data.success ) {
    278                         $( '#propertyform' ).before( data.data['notifications-box'] );
    279                         wpTrac.notifications.init( endpoint, ticket );
    280                     }
    281                 });
    282             });
    283         }
     270        (function() {
     271            var settings = { endpoint: '${wporg_endpoint}' };
     272            <py:if test="ticket and ticket.exists">
     273            settings.ticket = ${ticket.id};
     274            </py:if>
     275            wpTrac.notifications.init(settings);
     276        })();
    284277        </script>
    285278    </py:if>
Note: See TracChangeset for help on using the changeset viewer.