Making WordPress.org

Changeset 2683


Ignore:
Timestamp:
03/03/2016 07:39:17 PM (9 years ago)
Author:
iandunn
Message:

WordCamp Budgets: Mark Reimbursement Request fields as required.

Location:
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/includes/reimbursement-request.php

    r2674 r2683  
    213213        plugins_url( 'javascript/reimbursement-requests.js', __DIR__ ),
    214214        array( 'wordcamp-budgets', 'wcb-attached-files', 'jquery', 'underscore', 'wp-util' ),
    215         1,
     215        2,
    216216        true
    217217    );
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/javascript/reimbursement-requests.js

    r2682 r2683  
    6666        toggleOtherReasonDescription : function( event ) {
    6767            try {
    68                 var otherCategoryDescription = $( '#_wcbrr_reason_other_container' );
     68                var otherReasonContainer = $( '#_wcbrr_reason_other_container' );
    6969
    7070                if ( 'other' == $( this ).find( 'option:selected' ).val() ) {
    71                     $( otherCategoryDescription ).removeClass( 'hidden' );
     71                    $( otherReasonContainer ).removeClass( 'hidden' );
     72                    $( otherReasonContainer ).find( 'input' ).prop( 'required', true );
    7273                } else {
    73                     $( otherCategoryDescription ).addClass( 'hidden' );
     74                    $( otherReasonContainer ).addClass( 'hidden' );
     75                    $( otherReasonContainer ).find( 'input' ).prop( 'required', false );
    7476                }
    7577
     
    246248         */
    247249        toggleOtherCategoryInput : function( category ) {
     250            var otherCategoryContainer = this.$( '#_wcbrr_category_other_container' );
     251
    248252            if ( 'other' === category ) {
    249                 this.$( '#_wcbrr_category_other_container' ).removeClass( 'hidden' );
     253                otherCategoryContainer.removeClass( 'hidden' );
     254                otherCategoryContainer.find( 'input' ).prop( 'required', true );
    250255            } else {
    251                 this.$( '#_wcbrr_category_other_container' ).addClass( 'hidden' );
     256                otherCategoryContainer.addClass( 'hidden' );
     257                otherCategoryContainer.find( 'input' ).prop( 'required', false );
    252258            }
    253259        },
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/views/reimbursement-request/metabox-expenses.php

    r2392 r2683  
    2020    <?php submit_button( __( 'Add Another Expense', 'wordcamporg' ), 'secondary', 'wcbrr-add-another-expense' ); ?>
    2121</fieldset>
     22
     23<p class="wcb-form-required">
     24    <?php _e( '* required', 'wordcamporg' ); ?>
     25</p>
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/views/reimbursement-request/metabox-general-information.php

    r2535 r2683  
    1919                name="_wcbrr_name_of_payer"
    2020                value="<?php echo esc_attr( $name_of_payer ); ?>"
     21                required
    2122            />
     23
     24            <?php \WordCamp_Budgets::render_form_field_required_indicator(); ?>
    2225        </li>
    2326
     
    4043                <?php endforeach; ?>
    4144            </select>
     45
     46            <?php \WordCamp_Budgets::render_form_field_required_indicator(); ?>
    4247        </li>
    4348
     
    5964                <?php endforeach; ?>
    6065            </select>
     66
     67            <?php \WordCamp_Budgets::render_form_field_required_indicator(); ?>
    6168        </li>
    6269
     
    7380                value="<?php echo esc_attr( $other_reason ); ?>"
    7481            />
     82
     83            <?php \WordCamp_Budgets::render_form_field_required_indicator(); ?>
    7584        </li>
    7685
     
    8796    </ul>
    8897</fieldset>
     98
     99<p class="wcb-form-required">
     100    <?php _e( '* required', 'wordcamporg' ); ?>
     101</p>
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/views/reimbursement-request/template-expense.php

    r2392 r2683  
    3131                <# } ); #>
    3232            </select>
     33
     34            <?php \WordCamp_Budgets::render_form_field_required_indicator(); ?>
    3335        </li>
    3436
     
    4648                value="{{data._wcbrr_category_other}}"
    4749            />
     50
     51            <?php \WordCamp_Budgets::render_form_field_required_indicator(); ?>
    4852        </li>
    4953
     
    5963                name="_wcbrr_vendor_name_{{data.id}}"
    6064                value="{{data._wcbrr_vendor_name}}"
     65                required
    6166            />
     67
     68            <?php \WordCamp_Budgets::render_form_field_required_indicator(); ?>
    6269        </li>
    6370
     
    7380                name="_wcbrr_description_{{data.id}}"
    7481                maxlength="75"
     82                required
    7583            >{{data._wcbrr_description}}</textarea>
     84
     85            <?php \WordCamp_Budgets::render_form_field_required_indicator(); ?>
    7686        </li>
    7787
     
    8797                name="_wcbrr_date_{{data.id}}"
    8898                value="{{data._wcbrr_date}}"
     99                required
    89100            />
     101
     102            <?php \WordCamp_Budgets::render_form_field_required_indicator(); ?>
    90103        </li>
    91104
     
    102115                    name="_wcbrr_amount_{{data.id}}"
    103116                    value="{{data._wcbrr_amount}}"
     117                    required
    104118                />
     119
     120                <?php \WordCamp_Budgets::render_form_field_required_indicator(); ?>
    105121
    106122                <p class="description">
     
    123139                        name="_wcbrr_vendor_location_{{data.id}}"
    124140                        value="local"
     141                        required
    125142                        {{checked}}
    126143                    />
     
    137154                        name="_wcbrr_vendor_location_{{data.id}}"
    138155                        value="online"
     156                        required
    139157                        {{checked}}
    140158                    />
    141159                    <?php _e( 'Not Local / Online', 'wordcamporg' ); ?>
    142160                </label>
     161
     162                <?php \WordCamp_Budgets::render_form_field_required_indicator(); ?>
    143163            </div>
    144164        </li>
Note: See TracChangeset for help on using the changeset viewer.