Making WordPress.org

Changeset 11674


Ignore:
Timestamp:
03/15/2022 08:03:17 AM (3 years ago)
Author:
dd32
Message:

Trac: Show the "please report this elsewhere" text on ticket pages after being opened.

Location:
sites/trunk
Files:
2 edited

Legend:

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

    r11638 r11674  
    55
    66<?python
    7     scripts_version = '171'
     7    scripts_version = '172'
    88    project_slug = req.environ['HTTP_HOST'].split(':')[0].split('.')[0]
    99    wporg_endpoint = 'https://make.wordpress.org/' + project_slug + '/'
  • sites/trunk/wordpress.org/public_html/style/trac/wp-trac.js

    r11635 r11674  
    8686            enable_copy: true
    8787        },
    88         'learn.wordpress.org': {
     88        'Learn (learn.wordpress.org)': {
    8989            tracker: 'https://github.com/WordPress/learn/issues/new',
    9090            tracker_text: 'WordPress.org Learn GitHub Repository',
     
    774774                    }
    775775                }
    776                 return;
    777776            }
    778777
     
    794793
    795794                // If the component (ie. Editor) allows bypassing the warning show the create buttons.
    796                 if ( tracker.allow_bypass ) {
     795                if ( ! wpTrac.isNewTicket() || tracker.allow_bypass ) {
    797796                    toggle.show();
    798797                }
     
    803802                        '<a href="' + tracker.tracker + '">' + ( tracker.tracker_text || tracker.tracker ) + '</a>' +
    804803                    '</p><p>' +
    805                         'Would you mind opening this ticket over there instead? ' +
     804                        'Would you mind creating this ticket over there instead if appropriate? ' +
    806805                        ( tracker.enable_copy ? '<a href="' + tracker.tracker + '" id="new-tracker-ticket">Click here to copy your summary and description over</a>.' : '' ) +
    807806                    '</p>' +
    808                         ( tracker.allow_bypass ? '<p>If this isn\'t related to ' + ( tracker.bug_text || selectedComponent ) + ', please continue to open this ticket here.</p>' : '' ) +
     807                        ( wpTrac.isNewTicket() && tracker.allow_bypass ? "<p>If this isn't related to " + ( tracker.bug_text || selectedComponent ) + ', please continue to open this ticket here.</p>' : '' ) +
    809808                    '</div>'
    810809                );
    811810            });
     811
     812            if ( ! wpTrac.isNewTicket() && ! $('#action_reopen').length ) {
     813                component.trigger('change');
     814            }
    812815
    813816            $('#propertyform').on( 'click', '#new-tracker-ticket', function() {
     
    824827                url_params[description_field] = $('#field-description').val()
    825828
    826                 url = href + ( href.indexOf( '?' ) ? '&' : '?' ) + $.param( url_params );
     829                url = href + ( href.indexOf( '?' ) !== -1 ? '&' : '?' ) + $.param( url_params );
    827830                if ( url.length > 1500 ) {
    828831                    url_params[description_field] = '(Couldn\'t copy over your description as it was too long. Please paste it here. Your old window was not closed.)';
    829                     url = href + '?' + $.param( url_params );
     832                    url = href + ( href.indexOf( '?' ) !== -1 ? '&' : '?' ) + $.param( url_params );
    830833                    window.open( url );
    831834                } else {
Note: See TracChangeset for help on using the changeset viewer.