Making WordPress.org


Ignore:
Timestamp:
06/05/2019 07:10:22 AM (7 years ago)
Author:
tellyworth
Message:

Make home theme: show next meeting time in user's TZ.

This uses the shortcode from [8922] to display the next meeting for each team, with a link to find additional meetings, rather than a single "Weekly" meeting per team. JS is used to convert the time into the user's local time zone. It also links to a filtered list of meetings per team.

Props ck3lee.
Fixes #3078.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-makehome/archive-meeting.php

    r7794 r8923  
    22
    33<div class="wrapper">
    4         <h2 class="title"><?php _e( 'Upcoming WordPress Meetings', 'make-wporg' ); ?></h2>
     4        <div class="header-section">
     5                <h2 class="title all"><?php _e( 'Upcoming WordPress Meetings', 'make-wporg' ); ?></h2>
     6                <h2 class="title team"><?php _e( 'Upcoming Team Meetings', 'make-wporg' ); ?></h2>
     7                <a class="team" href="/meetings"><?php _e( 'Show meetings for other teams', 'make-wporg' ); ?></a>
     8        </div>
    59<table class="schedule">
    610        <thead>
     
    112116                        }
    113117                }
     118
     119                // Allow client side filtering using # in url
     120                var hash = window.location.hash.replace('#','');
     121                if (hash) {
     122                        var rowsToRemove = $('.schedule').find('tr td:nth-child(1)').filter(function() {
     123                                var reg = new RegExp(hash, "i");
     124                                return !reg.test($(this).text());
     125                        });
     126
     127                        for (var i = 0; i < rowsToRemove.length; i++) {
     128                                $(rowsToRemove[i]).parent().remove();
     129                        }
     130
     131                        $('.header-section').find('.team').show();
     132                }
     133                else {
     134                        $('.header-section').find('.all').show();
     135                }
     136
     137                // avoid page flickers on load
     138                $('.schedule').show();
    114139        });
    115140        </script>
Note: See TracChangeset for help on using the changeset viewer.