Making WordPress.org


Ignore:
Timestamp:
12/15/2022 06:14:16 PM (22 months ago)
Author:
coffee2code
Message:

Theme Directory: Add initial theme categorization features to the theme.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/view-templates/theme-single.php

    r12106 r12338  
    88    </div>
    99    <div class="theme-wrap">
    10         <div class="theme-about hentry">
     10        <div class="theme-about hentry" data-slug="{{{ data.slug }}}">
    1111            <# if ( data.is_outdated ) { #>
    1212            <div class="theme-notice notice notice-warning notice-alt">
     
    2929
    3030            <div class="theme-head">
     31                <# if ( data.is_community ) { #>
     32                <div class="widget categorization-widget categorization-widget-community">
     33                    <div class="widget-head">
     34                        <h3><?php esc_html_e( 'Community Theme', 'wporg-themes' ); ?></h3>
     35                        <a href="{{{ data.external_repository_url }}}" rel="nofollow"><?php _e( 'Contribute', 'wporg-themes' ); ?></a>
     36                    </div>
     37                    <p><?php esc_html_e( 'This theme is developed and supported by a community.', 'wporg-themes' ); ?></p>
     38                </div>
     39                <# } #>
     40
     41                <# if ( data.is_commercial ) { #>
     42                <div class="widget categorization-widget categorization-widget-commercial">
     43                    <div class="widget-head">
     44                        <h3><?php esc_html_e( 'Commercial Theme', 'wporg-themes' ); ?></h3>
     45                        <a href="{{{ data.external_support_url }}}" rel="nofollow"><?php _e( 'Support', 'wporg-themes' ); ?></a>
     46                    </div>
     47                    <p><?php esc_html_e( 'This theme is free but offers additional paid commercial upgrades or support.', 'wporg-themes' ); ?></p>
     48                </div>
     49                <# } #>
     50
    3151                <div class="theme-actions clear">
    3252                    <a href="{{{ data.preview_url }}}" class="button button-secondary alignleft"><?php _e( 'Preview', 'wporg-themes' ); ?></a>
     
    92112                    <div id="theme-download-stats-{{data.id}}" class="chart"></div>
    93113                </div><!-- .theme-downloads -->
     114
     115                <# if ( data.can_configure_categorization_options && data.is_community ) { #>
     116                <div class="theme-categorization-options">
     117                    <h3><?php _e( 'Community Options', 'wporg-themes' ); ?></h3>
     118                    <p><?php esc_html_e( 'This theme is developed and supported by a community.', 'wporg-themes' ); ?></p>
     119                    <form id="community" class="categorization" method="POST">
     120                    <p>
     121                        <label for="external_repository_url"><?php esc_html_e( 'Development repository URL', 'wporg-themes' ); ?></label>
     122                        <input id="external_repository_url" type="text" name="external_repository_url" value="{{{ data.external_repository_url }}}" data-original-value="{{{ data.external_repository_url}}}">
     123                        <span class="help"><?php esc_html_e( 'Optional. The URL where development happens, such as at github.com.', 'wporg-themes' ); ?></span>
     124                    </p>
     125                    <p>
     126                        <button class="button button-secondary" type="submit"><?php esc_html_e( 'Save', 'wporg-themes' ); ?></button>
     127                        <span class="success-msg"><?php esc_html_e( 'Saved!', 'wporg-themes' ) ?></span>
     128                    </p>
     129                    </form>
     130                </div><!-- .theme-categorization-options -->
     131                <# } #>
     132
     133                <# if ( data.can_configure_categorization_options && data.is_commercial ) { #>
     134                <div class="theme-categorization-options">
     135                    <h3><?php _e( 'Commercial Options', 'wporg-themes' ); ?></h3>
     136                    <p><?php esc_html_e( 'This theme is free but offers paid upgrades, support, and/or add-ons.', 'wporg-themes' ); ?></p>
     137                    <form id="commercial" class="categorization" method="POST">
     138                    <p>
     139                        <label for="external_support_url"><?php esc_html_e( 'Commercial support URL', 'wporg-themes' ); ?></label>
     140                        <input id="external_support_url" type="text" name="external_support_url" value="{{{ data.external_support_url }}}" data-original-value="{{{ data.external_support_url }}}">
     141                        <span class="help"><?php esc_html_e( 'Optional. The URL for theme support, other than its support forum on wordpress.org.', 'wporg-themes' ); ?></span>
     142                    </p>
     143                    <p>
     144                        <button class="button button-secondary" type="submit"><?php esc_html_e( 'Save', 'wporg-themes' ); ?></button>
     145                        <span class="success-msg"><?php esc_html_e( 'Saved!', 'wporg-themes' ) ?></span>
     146                    </p>
     147                    </form>
     148                </div><!-- .theme-categorization-options -->
     149                <# } #>
    94150            </div>
    95151
Note: See TracChangeset for help on using the changeset viewer.