Making WordPress.org


Ignore:
Timestamp:
07/17/2018 07:24:58 PM (6 years ago)
Author:
coreymckrill
Message:

CampTix Attendance: Add sorting options to attendance UI.

Update the Attendance UI filters with the ability to sort Attendees by First
Name, Last Name and Order Date.

Also:

  • Assure defaults for model and filter settings (id was missing from model).
  • Fix console error about viewport tag using semicolons instead of commas.

Fixes #1097
Props dryanpress

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/camptix-attendance/addons/attendance-ui.php

    r919 r7472  
    2020    </script>
    2121
    22     <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" />
     22    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
    2323    <meta name="referrer" content="never" />
    2424</head>
     
    2727        <div class="spinner-container"><span class="spinner"></span></div>
    2828        <a href="#" class="status toggle <# if ( data.status ) { #> yes <# } #>"><div class="dashicons dashicons-admin-users"></div></a>
     29
    2930        <span class="name">
    30             {{ data.name }}
     31            <# if ( 'lastName' == data.sort ) { #>
     32                {{ data.lastName }}, {{ data.firstName }}
     33            <# } else { #>
     34                {{ data.firstName }} {{ data.lastName }}
     35            <# } #>
    3136        </span>
    3237    </script>
     
    3439    <script id="tmpl-attendee-toggle" type="text/template">
    3540        <img src="{{ data.avatar }}" />
    36         <p>Did <strong>{{ data.name }}</strong> attend <?php echo esc_html( $camptix_options['event_name'] ); ?>?</p>
     41        <p>Did <strong>{{ data.firstName }} {{ data.lastName }}</strong> attend <?php echo esc_html( $camptix_options['event_name'] ); ?>?</p>
    3742
    3843        <div class="yes-no-container">
     
    5257                <div class="submenu">
    5358                    <a href="#" class="search">Search</a>
    54                     <a href="#" class="filter">Filter</a>
     59                    <a href="#" class="filter">Sort & Filter</a>
    5560                    <a href="#" class="refresh">Refresh</a>
    5661                </div>
     
    7984        <a href="#" class="close dashicons dashicons-no"></a>
    8085        <div class="wrapper">
    81             <h1>Filters</h1>
     86            <h1>Sort & Filter</h1>
     87
     88            <h1 class="section-title">Sort Attendees By</h1>
     89            <ul class="filter-sort section-controls">
     90                <li data-sort="firstName" <# if ( data.sort == 'firstName' ) { #> class="selected" <# } #> >First Name</li>
     91                <li data-sort="lastName" <# if ( data.sort == 'lastName' ) { #> class="selected" <# } #> >Last Name</li>
     92                <li data-sort="orderDate" <# if ( data.sort == 'orderDate' ) { #> class="selected" <# } #> >Order Date</li>
     93            </ul>
    8294
    8395            <h1 class="section-title">Attendance</h1>
Note: See TracChangeset for help on using the changeset viewer.