Making WordPress.org


Ignore:
Timestamp:
01/11/2014 07:22:00 PM (11 years ago)
Author:
nacin
Message:

Trac template cleanup.

  • Move After the Deadline JS to the footer.
  • Add some missing comments.
  • Remove old Trac email preferences reminders, as the WP cookie auth plugin synchronizes them from the WP.org profile.
  • Strip a lot of Trac wiki UI cruft off the home page.
File:
1 edited

Legend:

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

    r262 r270  
    4343    <meta name="viewport" content="width=device-width" />
    4444    <link rel="stylesheet" type="text/css" href="//wordpress.org/style/trac/wp-trac.css?${scripts_version}" />
    45     <script src="//openatd.svn.wordpress.org/atd-jquery/scripts/jquery.atd.textarea.js"></script>
    46     <script src="//openatd.svn.wordpress.org/atd-jquery/scripts/csshttprequest.js"></script>
    4745    <link rel="stylesheet" type="text/css" href="//openatd.svn.wordpress.org/atd-jquery/css/atd.css" media="screen" />
    4846    <link py:if="req.session['authenticated']" rel="stylesheet" href="//s.w.org/wp-includes/css/wp-auth-check.css?ver=3.9-alpha" type="text/css" media="all" />
     
    5351<div py:match="div[@id='footer']" py:strip=""></div>
    5452
     53<!--! Notices and instructions when creating a new ticket -->
    5554<py:if test="req.environ['PATH_INFO'] == '/newticket'">
    5655    <py:match path="div[@id='content' and @class='ticket']/form">
     
    6968                <li>Does the problem occur even when you deactivate all plugins and use the default theme?</li>
    7069                <li>Please provide any additional information that you think we'd find useful. (OS and browser for UI defects, server environment for crashes, etc.)</li>
    71                 <li py:if="not req.session['email']">Please add your email address to <a href="/prefs">Trac preferences</a> so you are sent updates.</li>
    7270            </ul>
    7371            </py:if>
     
    7977</py:if>
    8078
    81 <!--! Reports are collapsed by default but flicker because it waits for DOM ready to collapse them -->
    82 <div py:match="div[@id='content' and @class='report']/div[@class='reports']//div" py:if="req.environ['PATH_INFO'] == '/report'" py:attrs="select('@*')" class="collapsed">
    83     ${select('*|comment()|text()')}
    84 </div>
    85 
    86 <!--! new ticket modifications -->
     79<!--! New ticket modifications -->
    8780<py:if test="req.environ['PATH_INFO'] == '/newticket'">
    8881
    8982    <py:if test="'preview' in req.args">
    9083        <py:match path="form[@id='propertyform']/div[@class='buttons']" once="true">
    91 
    92         <!--! reminder on preview about setting a Trac email -->
    93             <py:if test="not req.session['email']">
    94                 <div class="wp-caution" id="wp-email-pref-notice">
    95                     <p><strong>Please</strong> add your email address to <a target="_blank" href="/prefs">Trac preferences</a> so you are sent updates.</p>
    96                 </div>
    97             </py:if>
    9884
    9985            <!--! security component alert on preview -->
     
    124110</py:if>
    125111
     112<!--! Reports are collapsed by default but flicker because it waits for DOM ready to collapse them -->
     113<div py:match="div[@id='content' and @class='report']/div[@class='reports']//div" py:if="req.environ['PATH_INFO'] == '/report'" py:attrs="select('@*')" class="collapsed">
     114    ${select('*|comment()|text()')}
     115</div>
     116
    126117<!--! reporter-feedback notice. deliberately shows for closed tickets other than 'fixed' -->
    127118<py:match path="div[@id='content' and @class='ticket']//div[@id='ticketchange']" once="true">
     
    131122    <div class="wp-notice" id="wp-reporter-feedback-notice" py:if="ticket.reporter == req.authname and 'reporter-feedback' in ticket.keywords and ticket.resolution != 'fixed'">
    132123        <p><strong>Howdy!</strong></p><p></p>
    133         <p>A developer marked this ticket with the reporter-feedback keyword. <strong>That means we need feedback from you.</strong></p>
     124        <p>A contributor marked this ticket with the reporter-feedback keyword. <strong>That means we need feedback from you.</strong></p>
    134125        <p>Please answer their questions and address their concerns, then remove the keyword, below.</p>
    135126        <p>If this is a support question, you're better off in the <a href="${support_link}" class="ext-link"><span class="icon">&nbsp;</span>support forums</a>.</p>
     
    137128</py:match>
    138129
    139 <!--! remove 'Replace existing attachment of the same name' checkbox for non-gardeners -->
     130<!--! Remove 'wiki:Wikistart' and other wiki cruft from home page -->
     131<py:if test="req.environ['PATH_INFO'] == '/'">
     132    <py:match path="div[@id='pagepath']" py:strip="" />
     133    <py:match path="div[@id='ctxtnav']" py:strip="" />
     134    <py:match path="div[@class='trac-modifiedby']" py:strip="" />
     135    <py:match path="div[@id='altlinks']/h3" py:strip="" />
     136    <py:match path="div[@id='altlinks']/ul" py:strip="" />
     137</py:if>
     138
     139<!--! Remove 'Replace existing attachment of the same name' checkbox for non-gardeners -->
    140140<py:if test="not ( 'TICKET_ADMIN' in perm(resource) or 'Bug Gardener' in perm(resource) )">
    141141    <py:match path="form[@id='attachment']//div[@class='options']" py:strip="" />
    142142</py:if>
    143143
    144 <!--! license notes when uploading patches -->
     144<!--! License notes when uploading patches -->
    145145<py:match path="form[@id='attachment']/div[@class='buttons']" once="true">
    146146    <div class="wp-caution" id="wp-contributions-caution">
     
    156156</py:match>
    157157
    158 <!--! gravatars for the ticket reporter -->
     158<!--! Gravatars for the ticket reporter -->
    159159<td py:match="td[@headers='h_reporter']" py:attrs="select('@*')">
    160160    <a href="${profile_link + ticket.reporter}">
     
    164164</td>
    165165
    166 <!--! gravatars for the ticket owner -->
     166<!--! Gravatars for the ticket owner -->
    167167<td py:match="td[@headers='h_owner']" py:attrs="select('@*')">
    168168    <a href="${profile_link + ticket.owner}" py:if="ticket.owner">
     
    186186</div>
    187187
    188 <!--! remove anonymous 'Advanced' session management tab -->
     188<!--! Remove anonymous 'Advanced' session management tab -->
    189189<py:match path="div[@id='content' and @class='prefs']/ul[@id='tabs']/li[@id='tab_advanced']" once="true" py:strip=""></py:match>
    190190<!--! remove useless 'Keyboard Shortcuts' preferences tab -->
    191191<py:match path="div[@id='content' and @class='prefs']/ul[@id='tabs']/li[@id='tab_keybindings']" once="true" py:strip=""></py:match>
    192192
    193 <!--! email addresses are synced with Trac from WP.org, so remove the preference pane -->
    194 <py:if test="req.environ['PATH_INFO'] == '/prefs' and project_slug == 'core' and req.session['email'] and req.session['authenticated']">
     193<!--! Email addresses are synced with Trac from WP.org, so remove the preference pane -->
     194<py:if test="req.environ['PATH_INFO'] == '/prefs' and req.session['email'] and req.session['authenticated']">
    195195    <py:match path="div[@id='content' and @class='prefs']/div[@id='tabcontent']" once="true">
    196196        <div id="tabcontent">
     
    219219    <xi:include href="wporg-footer.html" />
    220220
    221     <!--! footer javascript and such -->
    222221    <script py:if="'TICKET_ADMIN' in perm(resource) or 'Bug Gardener' in perm(resource)">
    223222    var wpBugGardener = true;
    224223    </script>
     224
     225    <!--! JavaScript -->
    225226    <script src="//wordpress.org/style/trac/wp-trac.js?${scripts_version}"></script>
     227
     228    <!--! Check for security buzzwords on new tickets -->
    226229    <script py:if="req.environ['PATH_INFO'] == '/newticket'" src="//wordpress.org/style/trac/trac-security.js?${scripts_version}"></script>
     230
     231    <!--! New ticket possibly related tickets for Core Trac -->
     232    <script py:if="req.environ['PATH_INFO'] == '/newticket' and project_slug == 'core'" src="//wordpress.org/style/trac/trac-search.js?${scripts_version}"></script>
     233
     234    <!-- After the Deadline -->
     235    <script src="//openatd.svn.wordpress.org/atd-jquery/scripts/jquery.atd.textarea.js"></script>
     236    <script src="//openatd.svn.wordpress.org/atd-jquery/scripts/csshttprequest.js"></script>
     237
     238    <!--! Analytics for Core Trac -->
    227239    <py:if test="project_slug == 'core'">
    228         <script py:if="req.environ['PATH_INFO'] == '/newticket'" src="//wordpress.org/style/trac/trac-search.js?${scripts_version}"></script>
    229     <script type="text/javascript">
    230     var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
    231     document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
    232     </script>
    233     <script type="text/javascript">
    234     try {
    235     var pageTracker = _gat._getTracker("UA-52447-27");
    236     pageTracker._trackPageview();
    237     } catch(err) {}</script>
     240        <script type="text/javascript">
     241        var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
     242        document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
     243        </script>
     244        <script type="text/javascript">
     245        try {
     246        var pageTracker = _gat._getTracker("UA-52447-27");
     247        pageTracker._trackPageview();
     248        } catch(err) {}</script>
    238249    </py:if>
    239250
Note: See TracChangeset for help on using the changeset viewer.