Making WordPress.org

Ticket #1183: 1183.2.diff

File 1183.2.diff, 3.8 KB (added by hlashbrooke, 7 years ago)

Refreshing from origin

  • wordcamp.org/public_html/wp-content/plugins/wcpt/javascript/wcpt-wordcamp/admin.js

    diff --git wordcamp.org/public_html/wp-content/plugins/wcpt/javascript/wcpt-wordcamp/admin.js wordcamp.org/public_html/wp-content/plugins/wcpt/javascript/wcpt-wordcamp/admin.js
    index 5c7d544..91bd1de 100644
    window.wordCampPostType.WcptWordCamp = ( function( $ ) { 
    1010         */
    1111        self.initialize = function() {
    1212                var createSiteCheckbox = $( '#wcpt_create-site-in-network' ),
    13                         $mentorUserName = $( '#wcpt_mentor_wordpress_org_user_name' );
     13                        $mentorUserName = $( '#wcpt_mentor_wordpress_org_user_name' ),
     14                        hasContributor = $( '#wcpt_contributor_day' );
    1415
    1516                // Sponsor region
    1617                createSiteCheckbox.change( self.toggleSponsorRegionRequired );
    1718                createSiteCheckbox.trigger( 'change' );
    1819
     20                // Contributor day info
     21                hasContributor.change( self.toggleContributorInfo );
     22                hasContributor.trigger( 'change' );
     23
    1924                // Date fields
    2025                $( '.date-field' ).datepicker( {
    2126                        dateFormat: 'yy-mm-dd',
    window.wordCampPostType.WcptWordCamp = ( function( $ ) { 
    109114                }
    110115        };
    111116
     117        /**
     118         * Toggle the display of the Contributor Day Info fields
     119         *
     120         * @param {object} event
     121         */
     122        self.toggleContributorInfo = function( event ) {
     123
     124                if ( $( '#wcpt_contributor_day' ).is( ':checked' ) ) {
     125                        $( '#wcpt_contributor_day' ).closest( 'div' ).siblings().slideDown();
     126                } else {
     127                        $( '#wcpt_contributor_day' ).closest( 'div' ).siblings().slideUp();
     128                }
     129
     130        };
     131
    112132    /**
    113133         * Kick things off
    114134     */
  • wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-wordcamp/wordcamp-admin.php

    diff --git wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-wordcamp/wordcamp-admin.php wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-wordcamp/wordcamp-admin.php
    index da6ae5a..a789ab2 100644
    class WordCamp_Admin { 
    9393                );
    9494
    9595                add_meta_box(
     96                        'wcpt_contributor_info',
     97                        __( 'Contributor Day Information', 'wcpt' ),
     98                        'wcpt_contributor_metabox',
     99                        WCPT_POST_TYPE_ID,
     100                        'advanced',
     101                        'high'
     102                );
     103
     104                add_meta_box(
    96105                        'wcpt_original_application',
    97106                        'Original Application',
    98107                        array( $this, 'original_application_metabox' ),
    class WordCamp_Admin { 
    441450                                );
    442451                                break;
    443452
     453                        case 'contributor':
     454                                // These fields names need to be unique, hence the 'Contributor' prefix on each one
     455                                $retval = array (
     456                                        'Contributor Day'                               => 'checkbox',
     457                                        'Contributor Day Date (YYYY-mm-dd)' => 'date',
     458                                        'Contributor Venue Name'                => 'text',
     459                                        'Contributor Venue Address'             => 'textarea',
     460                                        'Contributor Venue Capacity'            => 'text',
     461                                        'Contributor Venue Website URL'         => 'text',
     462                                        'Contributor Venue Contact Info'        => 'textarea',
     463                                );
     464                                break;
     465
    444466                        case 'wordcamp':
    445467                                $retval = array (
    446468                                        'Start Date (YYYY-mm-dd)'           => 'date',
    class WordCamp_Admin { 
    521543                                        'Website URL'                     => 'text',
    522544                                        'Contact Information'             => 'textarea',
    523545                                        'Exhibition Space Available'      => 'checkbox',
     546
     547                                        'Contributor Day'                               => 'checkbox',
     548                                        'Contributor Day Date (YYYY-mm-dd)' => 'date',
     549                                        'Contributor Venue Name'                => 'text',
     550                                        'Contributor Venue Address'             => 'textarea',
     551                                        'Contributor Venue Capacity'            => 'text',
     552                                        'Contributor Venue Website URL'         => 'text',
     553                                        'Contributor Venue Contact Info'        => 'textarea',
    524554                                );
    525555                                break;
    526556
    function wcpt_venue_metabox() { 
    11551185        wcpt_metabox( $meta_keys );
    11561186}
    11571187
     1188function wcpt_contributor_metabox() {
     1189        $meta_keys = $GLOBALS['wordcamp_admin']->meta_keys( 'contributor' );
     1190        wcpt_metabox( $meta_keys );
     1191}
     1192
    11581193/**
    11591194 * wcpt_metabox ()
    11601195 *