WordPress.org

Making WordPress.org

Changeset 228


Ignore:
Timestamp:
01/08/2014 05:00:22 PM (7 years ago)
Author:
nacin
Message:

Trac: Template changes for notifications. see #127.

File:
1 edited

Legend:

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

    r224 r228  
    55
    66<?python
    7     scripts_version = 24
     7    scripts_version = 25
    88    project_slug = req.environ['HTTP_HOST'].split(':')[0].split('.')[0]
     9    wporg_endpoint = '//make.wordpress.org/core/'
    910
    1011    if project_slug == 'bbpress' :
     
    189190    <py:match path="div[@id='content' and @class='prefs']/div[@id='tabcontent']" once="true">
    190191        <div id="tabcontent">
    191             Notifications <!--can be configured <a href="//make.wordpress.org/core/notifications/">here</a>. They--> are sent to the email listed in <a href="${profile_to_edit}${req.session['sid']}">your WordPress.org profile</a><py:if test="req.session['email']"> (${req.session['email']})</py:if>.
     192            Notifications <!--can be configured <a href="//${wporg_endpoint}notifications/">here</a>. They--> are sent to the email listed in <a href="${profile_to_edit}${req.session['sid']}">your WordPress.org profile</a><py:if test="req.session['email']"> (${req.session['email']})</py:if>.
    192193        </div>
    193194    </py:match>
     
    239240            <div id="wp-auth-check">
    240241                <div class="wp-auth-check-close" tabindex="0" title="Close"></div>
    241                 <div class="wp-auth-fallback"><p><b class="wp-auth-fallback-expired" tabindex="0">Session expired</b></p><p><a href="https://make.wordpress.org/core/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>
     242                <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>
    242243                </div>
    243244            </div>
     
    258259        </script>
    259260    </py:if>
     261
     262    <!--! Trac notifications -->
     263    <script py:if="ticket and ticket.exists and req.session['sid'] == 'nacin'">
     264    if ( 'notifications' in wpTrac ) {
     265        jQuery(document).ready( function( $ ) {
     266            var endpoint = '${wporg_endpoint}', ticket = ${ticket.id};
     267            $.ajax({
     268                url: endpoint + '?trac-notifications=' + ticket,
     269                xhrFields: { withCredentials: true }
     270            }).success( function( data ) {
     271                if ( data && data.success ) {
     272                    $( '#propertyform' ).before( data.data['notifications-box'] );
     273                    wpTrac.notifications.init( endpoint, ticket );
     274                }
     275            });
     276        });
     277    }
     278    </script>
    260279</body>
    261280
Note: See TracChangeset for help on using the changeset viewer.