bfd00564 by Jeff Balicki

member dir

Signed-off-by: Jeff <jeff@gotenzing.com>
1 parent ba9eb32d
...@@ -224,10 +224,9 @@ if ( ( ( $search && $show_search ) || ( $filters && $show_filters && count( $sea ...@@ -224,10 +224,9 @@ if ( ( ( $search && $show_search ) || ( $filters && $show_filters && count( $sea
224 <?php if ( $search && $show_search ) { ?> 224 <?php if ( $search && $show_search ) { ?>
225 <div class="um-member-directory-header-row um-member-directory-search-row"> 225 <div class="um-member-directory-header-row um-member-directory-search-row">
226 <div class="um-member-directory-search-line"> 226 <div class="um-member-directory-search-line">
227 <label> 227
228 <span><?php _e( 'Search:', 'ultimate-member' ); ?></span> 228 <label for="quicksearch">Search:</label><input type="text" class="um-search-line" type="text" id="quicksearch" placeholder="" />
229 <input type="search" class="um-search-line" placeholder="<?php esc_attr_e( 'Search', 'ultimate-member' ) ?>" value="<?php echo esc_attr( $search_from_url ) ?>" aria-label="<?php esc_attr_e( 'Search', 'ultimate-member' ) ?>" speech /> 229
230 </label>
231 <input type="button" class="um-do-search um-button" value="<?php esc_attr_e( 'Search', 'ultimate-member' ); ?>" /> 230 <input type="button" class="um-do-search um-button" value="<?php esc_attr_e( 'Search', 'ultimate-member' ); ?>" />
232 </div> 231 </div>
233 </div> 232 </div>
...@@ -284,12 +283,12 @@ if ( ( ( $search && $show_search ) || ( $filters && $show_filters && count( $sea ...@@ -284,12 +283,12 @@ if ( ( ( $search && $show_search ) || ( $filters && $show_filters && count( $sea
284 <?php } 283 <?php }
285 284
286 if ( $filters && $show_filters && count( $search_filters ) && $filters_collapsible ) { ?> 285 if ( $filters && $show_filters && count( $search_filters ) && $filters_collapsible ) { ?>
287 <span class="um-member-directory-filters"> 286 <span class="um-member-directory-filters directory-filters-top">
288 <span class="um-member-directory-filters-a<?php if ( $filters_expanded ) { ?> um-member-directory-filters-visible<?php } ?>"> 287 <span class="um-member-directory-filters-a<?php if ( $filters_expanded ) { ?> um-member-directory-filters-visible<?php } ?>">
289 <a href="javascript:void(0);"> 288 <a href="javascript:void(0);">
290 <?php _e( 'More filters', 'ultimate-member' ); ?> 289 <?php _e( 'FILTERS', 'ultimate-member' ); ?> <span aria-hidden="true" class="glyphicon glyphicon-chevron-up"></span>
291 </a> 290 </a>
292 &nbsp;<i class="um-faicon-caret-down"></i><i class="um-faicon-caret-up"></i> 291
293 </span> 292 </span>
294 </span> 293 </span>
295 <?php } ?> 294 <?php } ?>
...@@ -318,7 +317,7 @@ if ( ( ( $search && $show_search ) || ( $filters && $show_filters && count( $sea ...@@ -318,7 +317,7 @@ if ( ( ( $search && $show_search ) || ( $filters && $show_filters && count( $sea
318 <# } #> 317 <# } #>
319 </script> 318 </script>
320 319
321 <div class="um-member-directory-header-row um-member-directory-filters-bar<?php if ( ! $filters_expanded ) { ?> um-header-row-invisible<?php } ?>"> 320 <div class="um-member-directory-header-row directory-filters-bottom um-member-directory-filters-bar<?php if ( ! $filters_expanded ) { ?> um-header-row-invisible<?php } ?>">
322 <div class="um-search um-search-<?php echo count( $search_filters ) ?><?php if ( ! $filters_expanded ) { ?> um-search-invisible<?php } ?>"> 321 <div class="um-search um-search-<?php echo count( $search_filters ) ?><?php if ( ! $filters_expanded ) { ?> um-search-invisible<?php } ?>">
323 <?php $i = 0; 322 <?php $i = 0;
324 foreach ( $search_filters as $filter ) { 323 foreach ( $search_filters as $filter ) {
......
...@@ -14497,7 +14497,7 @@ h1 + p, .h1 + p { ...@@ -14497,7 +14497,7 @@ h1 + p, .h1 + p {
14497 } 14497 }
14498 14498
14499 .um-logout, 14499 .um-logout,
14500 .um:not(.um-um_account_id):not(.um-register):not(.um-login) { 14500 .um:not(.um-um_account_id):not(.um-register):not(.um-login):not(.um-directory) {
14501 width: 275px !important; 14501 width: 275px !important;
14502 display: flex !important; 14502 display: flex !important;
14503 flex-basis: auto; 14503 flex-basis: auto;
...@@ -14505,11 +14505,11 @@ h1 + p, .h1 + p { ...@@ -14505,11 +14505,11 @@ h1 + p, .h1 + p {
14505 align-self: flex-end; 14505 align-self: flex-end;
14506 } 14506 }
14507 .um-logout .um-form, 14507 .um-logout .um-form,
14508 .um:not(.um-um_account_id):not(.um-register):not(.um-login) .um-form { 14508 .um:not(.um-um_account_id):not(.um-register):not(.um-login):not(.um-directory) .um-form {
14509 margin-bottom: 40px; 14509 margin-bottom: 40px;
14510 } 14510 }
14511 .um-logout .um-form .um-misc-with-img, 14511 .um-logout .um-form .um-misc-with-img,
14512 .um:not(.um-um_account_id):not(.um-register):not(.um-login) .um-form .um-misc-with-img { 14512 .um:not(.um-um_account_id):not(.um-register):not(.um-login):not(.um-directory) .um-form .um-misc-with-img {
14513 width: 28%; 14513 width: 28%;
14514 display: inline-block; 14514 display: inline-block;
14515 border-bottom: 0px solid #eee; 14515 border-bottom: 0px solid #eee;
...@@ -14517,11 +14517,11 @@ h1 + p, .h1 + p { ...@@ -14517,11 +14517,11 @@ h1 + p, .h1 + p {
14517 padding: 0px; 14517 padding: 0px;
14518 } 14518 }
14519 .um-logout .um-form .um-misc-with-img div strong, 14519 .um-logout .um-form .um-misc-with-img div strong,
14520 .um:not(.um-um_account_id):not(.um-register):not(.um-login) .um-form .um-misc-with-img div strong { 14520 .um:not(.um-um_account_id):not(.um-register):not(.um-login):not(.um-directory) .um-form .um-misc-with-img div strong {
14521 display: none; 14521 display: none;
14522 } 14522 }
14523 .um-logout .um-form .um-misc-ul, 14523 .um-logout .um-form .um-misc-ul,
14524 .um:not(.um-um_account_id):not(.um-register):not(.um-login) .um-form .um-misc-ul { 14524 .um:not(.um-um_account_id):not(.um-register):not(.um-login):not(.um-directory) .um-form .um-misc-ul {
14525 width: 60%; 14525 width: 60%;
14526 display: inline-block; 14526 display: inline-block;
14527 list-style: none; 14527 list-style: none;
...@@ -14529,7 +14529,7 @@ h1 + p, .h1 + p { ...@@ -14529,7 +14529,7 @@ h1 + p, .h1 + p {
14529 vertical-align: top; 14529 vertical-align: top;
14530 } 14530 }
14531 .um-logout .um-form .um-misc-ul a, 14531 .um-logout .um-form .um-misc-ul a,
14532 .um:not(.um-um_account_id):not(.um-register):not(.um-login) .um-form .um-misc-ul a { 14532 .um:not(.um-um_account_id):not(.um-register):not(.um-login):not(.um-directory) .um-form .um-misc-ul a {
14533 font-size: 16px; 14533 font-size: 16px;
14534 text-decoration: none; 14534 text-decoration: none;
14535 color: #000000; 14535 color: #000000;
...@@ -14537,7 +14537,7 @@ h1 + p, .h1 + p { ...@@ -14537,7 +14537,7 @@ h1 + p, .h1 + p {
14537 font-weight: 400; 14537 font-weight: 400;
14538 } 14538 }
14539 .um-logout .um-form .um-misc-ul a:hover, 14539 .um-logout .um-form .um-misc-ul a:hover,
14540 .um:not(.um-um_account_id):not(.um-register):not(.um-login) .um-form .um-misc-ul a:hover { 14540 .um:not(.um-um_account_id):not(.um-register):not(.um-login):not(.um-directory) .um-form .um-misc-ul a:hover {
14541 font-weight: 700 !important; 14541 font-weight: 700 !important;
14542 font-family: "trade-gothic-next"; 14542 font-family: "trade-gothic-next";
14543 } 14543 }
...@@ -14799,6 +14799,63 @@ h1 + p, .h1 + p { ...@@ -14799,6 +14799,63 @@ h1 + p, .h1 + p {
14799 display: none !important; 14799 display: none !important;
14800 } 14800 }
14801 14801
14802 .directory-filters-top {
14803 border-top: 1px solid #3eaf49 !important;
14804 padding: 10px 0 0px 0;
14805 }
14806
14807 .directory-filters-bottom {
14808 border-bottom: 1px solid #3eaf49 !important;
14809 padding: 0px !important;
14810 margin-bottom: 40px !important;
14811 }
14812
14813 .um-directory .um-member-directory-header .um-member-directory-header-row .um-member-directory-nav-line .um-member-directory-filters .um-member-directory-filters-a {
14814 font-size: 18px;
14815 line-height: 24px;
14816 color: #1a3668;
14817 text-transform: uppercase;
14818 text-decoration: none;
14819 padding: 10px 0;
14820 display: block;
14821 font-weight: 800;
14822 }
14823
14824 .um-member-directory-filters {
14825 justify-content: flex-start;
14826 }
14827
14828 .um-directory .um-member-directory-header .um-member-directory-header-row .um-member-directory-nav-line .um-member-directory-filters {
14829 justify-content: flex-start !important;
14830 }
14831
14832 .glyphicon-chevron-up::after {
14833 content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='19.432' height='11.567' viewBox='0 0 19.432 11.567'%3E%3Cpath id='Path_1875' data-name='Path 1875' d='M395.235 274.525a1.19 1.19 0 0 0 1.681.063l9.188-8.526a1.19 1.19 0 0 0 0-1.744l-9.187-8.526a1.19 1.19 0 1 0-1.619 1.744l8.248 7.654-8.248 7.654a1.19 1.19 0 0 0-.063 1.681Z' transform='translate(274.905 -394.917) rotate(90)' fill='%231A3668'/%3E%3C/svg%3E");
14834 }
14835
14836 .glyphicon-chevron-down::after {
14837 content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='19.631' height='11.905' viewBox='0 0 19.631 11.905'%3E%3Cpath id='Path_1875' data-name='Path 1875' d='M395.235 274.525a1.19 1.19 0 0 0 1.681.063l9.188-8.526a1.19 1.19 0 0 0 0-1.744l-9.187-8.526a1.19 1.19 0 1 0-1.619 1.744l8.248 7.654-8.248 7.654a1.19 1.19 0 0 0-.063 1.681Z' transform='matrix(-0.017 -1 1 -0.017 -248.34 411.22)' fill='%231A3668'/%3E%3C/svg%3E");
14838 }
14839
14840 .um-directory .um-member-directory-header .um-member-directory-header-row.um-member-directory-search-row {
14841 justify-content: flex-start !important;
14842 }
14843
14844 #quicksearch {
14845 width: 600px;
14846 border: 1px solid #fff !important;
14847 border-bottom: 1px solid #8e908f !important;
14848 margin-bottom: 15px;
14849 }
14850
14851 .um-do-search.um-button {
14852 display: none;
14853 }
14854
14855 .um-directory .um-member-directory-header .um-member-directory-header-row .um-member-directory-search-line label {
14856 flex: unset !important;
14857 }
14858
14802 .entry-content .is-layout-constrained.wp-block-group { 14859 .entry-content .is-layout-constrained.wp-block-group {
14803 box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.1607843137); 14860 box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.1607843137);
14804 padding: 40px 32px; 14861 padding: 40px 32px;
......
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
...@@ -25029,7 +25029,19 @@ ...@@ -25029,7 +25029,19 @@
25029 c2.classList.add('image-loaded'), c2.style.backgroundImage = 'linear-gradient(90deg, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 91%, rgba(0, 0, 0, 0) 100%), url(' + b2 + ')'; 25029 c2.classList.add('image-loaded'), c2.style.backgroundImage = 'linear-gradient(90deg, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 91%, rgba(0, 0, 0, 0) 100%), url(' + b2 + ')';
25030 }; 25030 };
25031 }); 25031 });
25032 $$1(document).ready(function ($) {}); 25032 $$1(document).ready(function ($) {
25033 var timerid;
25034 $("#quicksearch").on("input", function (e) {
25035 var value = $(this).val();
25036 if ($(this).data("lastval") != value) {
25037 $(this).data("lastval", value);
25038 clearTimeout(timerid);
25039 timerid = setTimeout(function () {
25040 $('.um-do-search.um-button').click();
25041 }, 500);
25042 }
25043 });
25044 });
25033 25045
25034 exports.Alert = alert$1; 25046 exports.Alert = alert$1;
25035 exports.Button = button; 25047 exports.Button = button;
......
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
...@@ -38,5 +38,18 @@ document.addEventListener("DOMContentLoaded", function() { ...@@ -38,5 +38,18 @@ document.addEventListener("DOMContentLoaded", function() {
38 }); 38 });
39 39
40 jQuery(document).ready(function($) { 40 jQuery(document).ready(function($) {
41 var timerid;
42 $("#quicksearch").on("input", function(e) {
43 var value = $(this).val();
44 if ($(this).data("lastval") != value) {
41 45
46 $(this).data("lastval", value);
47 clearTimeout(timerid);
48
49 timerid = setTimeout(function() {
50 $('.um-do-search.um-button').click();
51 }, 500);
52 };
53 });
42 }); 54 });
55
......
...@@ -143,3 +143,54 @@ ...@@ -143,3 +143,54 @@
143 .um-account-profile-link{ 143 .um-account-profile-link{
144 display: none !important; 144 display: none !important;
145 } 145 }
146
147 .directory-filters-top{
148 border-top: 1px solid #3eaf49!important;
149 padding: 10px 0 0px 0;
150 }
151 .directory-filters-bottom{
152 border-bottom: 1px solid #3eaf49!important;
153 padding: 0px !important;
154 margin-bottom: 40px !important;
155 }
156
157 .um-directory .um-member-directory-header .um-member-directory-header-row .um-member-directory-nav-line .um-member-directory-filters .um-member-directory-filters-a{
158 font-size: 18px;
159 line-height: 24px;
160 color: #1a3668;
161 text-transform: uppercase;
162 text-decoration: none;
163 padding: 10px 0;
164 display: block;
165 font-weight: 800;
166 }
167 .um-member-directory-filters{
168 justify-content:flex-start;
169 }
170 .um-directory .um-member-directory-header .um-member-directory-header-row .um-member-directory-nav-line .um-member-directory-filters{
171 justify-content: flex-start !important;
172 }
173 .glyphicon-chevron-up::after {
174 content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='19.432' height='11.567' viewBox='0 0 19.432 11.567'%3E%3Cpath id='Path_1875' data-name='Path 1875' d='M395.235 274.525a1.19 1.19 0 0 0 1.681.063l9.188-8.526a1.19 1.19 0 0 0 0-1.744l-9.187-8.526a1.19 1.19 0 1 0-1.619 1.744l8.248 7.654-8.248 7.654a1.19 1.19 0 0 0-.063 1.681Z' transform='translate(274.905 -394.917) rotate(90)' fill='%231A3668'/%3E%3C/svg%3E");
175 }
176 .glyphicon-chevron-down::after {
177 content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='19.631' height='11.905' viewBox='0 0 19.631 11.905'%3E%3Cpath id='Path_1875' data-name='Path 1875' d='M395.235 274.525a1.19 1.19 0 0 0 1.681.063l9.188-8.526a1.19 1.19 0 0 0 0-1.744l-9.187-8.526a1.19 1.19 0 1 0-1.619 1.744l8.248 7.654-8.248 7.654a1.19 1.19 0 0 0-.063 1.681Z' transform='matrix(-0.017 -1 1 -0.017 -248.34 411.22)' fill='%231A3668'/%3E%3C/svg%3E");
178 }
179
180 .um-directory .um-member-directory-header .um-member-directory-header-row.um-member-directory-search-row{
181 justify-content: flex-start !important;
182 }
183
184 #quicksearch {
185 width: 600px;
186 border: 1px solid #fff !important;
187 border-bottom: 1px solid #8e908f!important;
188 margin-bottom: 15px;
189 }
190 .um-do-search.um-button{
191 display: none;
192 }
193
194 .um-directory .um-member-directory-header .um-member-directory-header-row .um-member-directory-search-line label{
195 flex:unset !important;
196 }
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -104,7 +104,7 @@ ...@@ -104,7 +104,7 @@
104 } 104 }
105 } 105 }
106 .um-logout, 106 .um-logout,
107 .um:not(.um-um_account_id):not(.um-register):not(.um-login){ 107 .um:not(.um-um_account_id):not(.um-register):not(.um-login):not(.um-directory){
108 width: 275px !important; 108 width: 275px !important;
109 display: flex!important; 109 display: flex!important;
110 flex-basis: auto; 110 flex-basis: auto;
......
1 <?php if ( ! defined( 'ABSPATH' ) ) exit;
2
3 $unique_hash = substr( md5( $args['form_id'] ), 10, 5 ); ?>
4
5 <script type="text/template" id="tmpl-um-member-list-<?php echo esc_attr( $unique_hash ) ?>">
6 <div class="um-members um-members-list">
7
8 <# if ( data.length > 0 ) { #>
9 <# _.each( data, function( user, key, list ) { #>
10
11 <div id="um-member-{{{user.card_anchor}}}-<?php echo esc_attr( $unique_hash ) ?>" class="um-member um-role-{{{user.role}}} {{{user.account_status}}} <?php if ( $cover_photos ) { echo 'with-cover'; } ?>">
12 <span class="um-member-status {{{user.account_status}}}">
13 {{{user.account_status_name}}}
14 </span>
15 <div class="um-member-card-container">
16 <?php if ( $profile_photo ) { ?>
17 <div class="um-member-photo radius-<?php echo esc_attr( UM()->options()->get( 'profile_photocorner' ) ); ?>">
18 <a href="{{{user.profile_url}}}" title="<# if ( user.display_name ) { #>{{{user.display_name}}}<# } #>">
19 {{{user.avatar}}}
20
21 <?php do_action( 'um_members_list_in_profile_photo_tmpl', $args ); ?>
22 </a>
23 </div>
24 <?php } ?>
25
26 <div class="um-member-card <?php echo ! $profile_photo ? 'no-photo' : '' ?>">
27 <div class="um-member-card-content">
28 <div class="um-member-card-header">
29 <?php if ( $show_name ) { ?>
30 <# if ( user.display_name_html ) { #>
31 <div class="um-member-name">
32 <a href="{{{user.profile_url}}}" title="<# if ( user.display_name ) { #>{{{user.display_name}}}<# } #>">
33 {{{user.display_name_html}}}
34 </a>
35 </div>
36 <# } #>
37 <?php } ?>
38
39 {{{user.hook_just_after_name}}}
40
41 <?php do_action( 'um_members_list_after_user_name_tmpl', $args ); ?>
42
43 {{{user.hook_after_user_name}}}
44 </div>
45
46 <?php if ( $show_tagline && ! empty( $tagline_fields ) && is_array( $tagline_fields ) ) {
47 foreach ( $tagline_fields as $key ) {
48 if ( empty( $key ) ) {
49 continue;
50 } ?>
51
52 <# if ( typeof user['<?php echo $key; ?>'] !== 'undefined' ) { #>
53 <div class="um-member-tagline um-member-tagline-<?php echo esc_attr( $key ); ?>"
54 data-key="<?php echo esc_attr( $key ); ?>">
55 {{{user['<?php echo $key; ?>']}}}
56 </div>
57 <# } #>
58
59 <?php }
60 }
61
62 if ( $show_userinfo ) { ?>
63
64 <# var $show_block = false; #>
65
66 <?php foreach ( $reveal_fields as $k => $key ) {
67 if ( empty( $key ) ) {
68 unset( $reveal_fields[ $k ] );
69 } ?>
70
71 <# if ( typeof user['<?php echo $key; ?>'] !== 'undefined' ) {
72 $show_block = true;
73 } #>
74 <?php }
75
76 if ( $show_social ) { ?>
77 <# if ( ! $show_block ) { #>
78 <# $show_block = user.social_urls #>
79 <# } #>
80 <?php } ?>
81
82 <# if ( $show_block ) { #>
83 <div class="um-member-meta-main<?php if ( ! $userinfo_animate ) { echo ' no-animate'; } ?>">
84
85 <div class="um-member-meta">
86 <?php foreach ( $reveal_fields as $key ) { ?>
87
88 <# if ( typeof user['<?php echo $key; ?>'] !== 'undefined' ) { #>
89 <div class="um-member-metaline um-member-metaline-<?php echo $key; ?>">
90 <strong>{{{user['label_<?php echo $key;?>']}}}:</strong>&nbsp;{{{user['<?php echo $key;?>']}}}
91 </div>
92 <# } #>
93
94 <?php }
95
96 if ( $show_social ) { ?>
97 <div class="um-member-connect">
98 {{{user.social_urls}}}
99 </div>
100 <?php } ?>
101 </div>
102 </div>
103 <# } #>
104 <?php } ?>
105 </div>
106
107 <div class="um-member-card-actions">
108
109 <# if ( Object.keys( user.dropdown_actions ).length > 0 ) { #>
110 <div class="um-member-cog">
111 <a href="javascript:void(0);" class="um-member-actions-a">
112 <i class="um-faicon-cog"></i>
113 </a>
114 <?php UM()->member_directory()->dropdown_menu_js( '.um-member-cog', 'click', 'user' ); ?>
115 </div>
116 <# } #>
117
118 </div>
119
120 </div>
121 </div>
122 <div class="um-member-card-footer <?php echo ! $profile_photo ? 'no-photo' : '' ?> <?php if ( $show_userinfo && $userinfo_animate ) { ?><# if ( ! $show_block ) { #>no-reveal<# } #><?php } ?>">
123
124 <div class="um-member-card-footer-buttons">
125 <?php do_action( 'um_members_list_just_after_actions_tmpl', $args ); ?>
126 </div>
127
128 <?php if ( $show_userinfo && $userinfo_animate ) { ?>
129 <# if ( $show_block ) { #>
130 <div class="um-member-card-reveal-buttons">
131 <div class="um-member-more">
132 <a href="javascript:void(0);"><i class="um-faicon-angle-down"></i></a>
133 </div>
134 <div class="um-member-less">
135 <a href="javascript:void(0);"><i class="um-faicon-angle-up"></i></a>
136 </div>
137 </div>
138 <# } #>
139 <?php } ?>
140 </div>
141 </div>
142
143 <# }); #>
144 <# } else { #>
145
146 <div class="um-members-none">
147 <p><?php echo $no_users; ?></p>
148 </div>
149
150 <# } #>
151
152 </div>
153 </script>
1 <?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
2
3
4 <script type="text/template" id="tmpl-um-members-pagination">
5 <# if ( data.pagination.pages_to_show.length > 0 ) { #>
6 <div class="um-members-pagidrop uimob340-show uimob500-show">
7 <?php _e( 'Jump to page:','ultimate-member' ); ?>
8 <select class="um-s2 um-members-pagi-dropdown" style="width: 100px;display:inline-block;">
9 <# _.each( data.pagination.pages_to_show, function( page, key, list ) { #>
10 <option value="{{{page}}}" <# if ( page == data.pagination.current_page ) { #>selected<# } #>>{{{page}}} <?php _e( 'of','ultimate-member' ) ?> {{{data.pagination.total_pages}}}</option>
11 <# }); #>
12 </select>
13 </div>
14
15 <div class="um-members-pagi uimob340-hide uimob500-hide">
16 <span class="pagi pagi-arrow <# if ( data.pagination.current_page == 1 ) { #>disabled<# } #>" data-page="first" aria-label="<?php esc_attr_e( 'First page', 'ultimate-member' ); ?>"><i class="um-faicon-angle-double-left"></i></span>
17 <span class="pagi pagi-arrow <# if ( data.pagination.current_page == 1 ) { #>disabled<# } #>" data-page="prev" aria-label="<?php esc_attr_e( 'Previous page', 'ultimate-member' ); ?>"><i class="um-faicon-angle-left"></i></span>
18
19 <# _.each( data.pagination.pages_to_show, function( page, key, list ) { #>
20 <span class="pagi <# if ( page == data.pagination.current_page ) { #>current<# } #>" data-page="{{{page}}}">{{{page}}}</span>
21 <# }); #>
22
23 <span class="pagi pagi-arrow <# if ( data.pagination.current_page == data.pagination.total_pages ) { #>disabled<# } #>" data-page="next" aria-label="<?php esc_attr_e( 'Next page', 'ultimate-member' ); ?>"><i class="um-faicon-angle-right"></i></span>
24 <span class="pagi pagi-arrow <# if ( data.pagination.current_page == data.pagination.total_pages ) { #>disabled<# } #>" data-page="last" aria-label="<?php esc_attr_e( 'Last page', 'ultimate-member' ); ?>"><i class="um-faicon-angle-double-right"></i></span>
25 </div>
26 <# } #>
27 </script>
...\ No newline at end of file ...\ No newline at end of file
1 <?php if ( ! defined( 'ABSPATH' ) ) exit;
2
3 global $post;
4
5 // Get default and real arguments
6 $def_args = array();
7 foreach ( UM()->config()->core_directory_meta['members'] as $k => $v ) {
8 $key = str_replace( '_um_', '', $k );
9 $def_args[ $key ] = $v;
10 }
11
12 $unique_hash = substr( md5( $args['form_id'] ), 10, 5 );
13
14 $args = array_merge( $def_args, $args );
15
16 //current user priority role
17 $priority_user_role = false;
18 if ( is_user_logged_in() ) {
19 $priority_user_role = UM()->roles()->get_priority_user_role( um_user( 'ID' ) );
20 }
21
22 $args = apply_filters( 'um_member_directory_agruments_on_load', $args );
23
24 // Views
25 $single_view = false;
26 $current_view = 'grid';
27
28 if ( ! empty( $args['view_types'] ) && is_array( $args['view_types'] ) ) {
29 $args['view_types'] = array_filter( $args['view_types'], function( $item ) {
30 return in_array( $item, array_keys( UM()->member_directory()->view_types ) );
31 });
32 }
33
34 if ( empty( $args['view_types'] ) || ! is_array( $args['view_types'] ) ) {
35 $args['view_types'] = array(
36 'grid',
37 'list'
38 );
39 }
40
41 if ( count( $args['view_types'] ) == 1 ) {
42 $single_view = true;
43 $current_view = $args['view_types'][0];
44 $default_view = $current_view;
45 } else {
46 $args['default_view'] = ! empty( $args['default_view'] ) ? $args['default_view'] : $args['view_types'][0];
47 $default_view = $args['default_view'];
48 $current_view = ( ! empty( $_GET[ 'view_type_' . $unique_hash ] ) && in_array( $_GET[ 'view_type_' . $unique_hash ], $args['view_types'] ) ) ? sanitize_text_field( $_GET[ 'view_type_' . $unique_hash ] ) : $args['default_view'];
49 }
50
51 // Sorting
52 $default_sorting = ! empty( $args['sortby'] ) ? $args['sortby'] : 'user_registered_desc';
53 if ( $default_sorting == 'other' && ! empty( $args['sortby_custom'] ) ) {
54 $default_sorting = $args['sortby_custom'];
55 }
56
57 $sort_from_url = '';
58 $custom_sorting_titles = array();
59 if ( ! empty( $args['enable_sorting'] ) ) {
60 $sorting_options = empty( $args['sorting_fields'] ) ? array() : $args['sorting_fields'];
61
62 $sorting_options_prepared = array();
63 if ( ! empty( $sorting_options ) ) {
64 foreach ( $sorting_options as $option ) {
65 if ( is_array( $option ) ) {
66 $option_keys = array_keys( $option );
67 $sorting_options_prepared[] = $option_keys[0];
68
69 $custom_sorting_titles[ $option_keys[0] ] = $option[ $option_keys[0] ];
70 } else {
71 $sorting_options_prepared[] = $option;
72 }
73 }
74 }
75
76 $all_sorting_options = UM()->member_directory()->sort_fields;
77
78 if ( ! in_array( $default_sorting, $sorting_options_prepared ) ) {
79 $sorting_options_prepared[] = $default_sorting;
80
81 $label = $default_sorting;
82 if ( ! empty( $args['sortby_custom_label'] ) && 'other' == $args['sortby'] ) {
83 $label = $args['sortby_custom_label'];
84 } elseif ( ! empty( $all_sorting_options[ $default_sorting ] ) ) {
85 $label = $all_sorting_options[ $default_sorting ];
86 }
87
88 $label = ( $label == 'random' ) ? __( 'Random', 'ultimate-member' ) : $label;
89
90 $custom_sorting_titles[ $default_sorting ] = $label;
91 }
92
93 if ( ! empty( $sorting_options_prepared ) ) {
94 $sorting_options = array_intersect_key( array_merge( $all_sorting_options, $custom_sorting_titles ), array_flip( $sorting_options_prepared ) );
95 }
96
97 $sorting_options = apply_filters( 'um_member_directory_pre_display_sorting', $sorting_options, $args );
98 $sort_from_url = ( ! empty( $_GET[ 'sort_' . $unique_hash ] ) && in_array( sanitize_text_field( $_GET[ 'sort_' . $unique_hash ] ), array_keys( $sorting_options ) ) ) ? sanitize_text_field( $_GET[ 'sort_' . $unique_hash ] ) : $default_sorting;
99 }
100
101 $current_page = ( ! empty( $_GET[ 'page_' . $unique_hash ] ) && is_numeric( $_GET[ 'page_' . $unique_hash ] ) ) ? absint( $_GET[ 'page_' . $unique_hash ] ) : 1;
102
103 //Search
104 $search = isset( $args['search'] ) ? $args['search'] : false;
105 $show_search = empty( $args['roles_can_search'] ) || ( ! empty( $priority_user_role ) && in_array( $priority_user_role, $args['roles_can_search'] ) );
106 $search_from_url = '';
107 if ( $search && $show_search ) {
108 $search_from_url = ! empty( $_GET[ 'search_' . $unique_hash ] ) ? stripslashes( sanitize_text_field( $_GET[ 'search_' . $unique_hash ] ) ) : '';
109 }
110
111
112 //Filters
113 $filters = isset( $args['filters'] ) ? $args['filters'] : false;
114 $show_filters = empty( $args['roles_can_filter'] ) || ( ! empty( $priority_user_role ) && in_array( $priority_user_role, $args['roles_can_filter'] ) );
115 $search_filters = array();
116 if ( isset( $args['search_fields'] ) ) {
117 $search_filters = apply_filters( 'um_frontend_member_search_filters', array_unique( array_filter( $args['search_fields'] ) ) );
118 }
119
120 if ( ! empty( $search_filters ) ) {
121 $search_filters = array_filter( $search_filters, function( $item ) {
122 return in_array( $item, array_keys( UM()->member_directory()->filter_fields ) );
123 });
124
125 $search_filters = array_values( $search_filters );
126 }
127
128 // Classes
129 $classes = '';
130 if ( $search && $show_search ) {
131 $classes .= ' um-member-with-search';
132 }
133
134 if ( $filters && $show_filters && count( $search_filters ) ) {
135 $classes .= ' um-member-with-filters';
136 }
137
138 if ( ! $single_view ) {
139 $classes .= ' um-member-with-view';
140 }
141
142 if ( ! empty( $args['enable_sorting'] ) && ! empty( $sorting_options ) && count( $sorting_options ) > 1 ) {
143 $classes .= ' um-member-with-sorting';
144 }
145
146 $filters_collapsible = true;
147 $filters_expanded = ! empty( $args['filters_expanded'] ) ? true : false;
148 if ( $filters_expanded ) {
149 $filters_collapsible = ! empty( $args['filters_is_collapsible'] ) ? true : false;
150 }
151
152 //send $args variable to the templates
153 $args['args'] = $args;
154 foreach ( $args['view_types'] as $type ) {
155 $basename = UM()->member_directory()->get_type_basename( $type );
156 UM()->get_template( 'members-' . $type . '.php', $basename, $args, true );
157 }
158 UM()->get_template( 'members-header.php', '', $args, true );
159 UM()->get_template( 'members-pagination.php', '', $args, true );
160
161 $must_search = 0;
162 $not_searched = false;
163 if ( ( ( $search && $show_search ) || ( $filters && $show_filters && count( $search_filters ) ) ) && isset( $args['must_search'] ) && $args['must_search'] == 1 ) {
164 $must_search = 1;
165 $not_searched = true;
166 if ( $search && $show_search && ! empty( $search_from_url ) ) {
167 $not_searched = false;
168 } elseif ( $filters && $show_filters && count( $search_filters ) ) {
169 foreach ( $search_filters as $filter ) {
170 // getting value from GET line
171 switch ( UM()->member_directory()->filter_types[ $filter ] ) {
172 default: {
173
174 $not_searched = apply_filters( 'um_member_directory_filter_value_from_url', $not_searched, $filter );
175
176 break;
177 }
178 case 'select': {
179
180 // getting value from GET line
181 $filter_from_url = ! empty( $_GET[ 'filter_' . $filter . '_' . $unique_hash ] ) ? explode( '||', sanitize_text_field( $_GET[ 'filter_' . $filter . '_' . $unique_hash ] ) ) : array();
182
183 if ( ! empty( $filter_from_url ) ) {
184 $not_searched = false;
185 }
186
187 break;
188 }
189 case 'slider': {
190 // getting value from GET line
191 $filter_from_url = ! empty( $_GET[ 'filter_' . $filter . '_' . $unique_hash ] ) ? sanitize_text_field( $_GET[ 'filter_' . $filter . '_' . $unique_hash ] ) : '';
192 if ( ! empty( $filter_from_url ) ) {
193 $not_searched = false;
194 }
195
196 break;
197 }
198 case 'datepicker':
199 case 'timepicker': {
200 // getting value from GET line
201 $filter_from_url = ! empty( $_GET[ 'filter_' . $filter . '_from_' . $unique_hash ] ) ? sanitize_text_field( $_GET[ 'filter_' . $filter . '_from_' . $unique_hash ] ) : '';
202 if ( ! empty( $filter_from_url ) ) {
203 $not_searched = false;
204 }
205
206 break;
207 }
208 }
209 }
210 }
211 } ?>
212
213 <div class="um <?php echo esc_attr( $this->get_class( $mode ) ); ?> um-<?php echo esc_attr( substr( md5( $form_id ), 10, 5 ) ); ?>"
214 data-hash="<?php echo esc_attr( substr( md5( $form_id ), 10, 5 ) ) ?>" data-base-post="<?php echo esc_attr( $post->ID ) ?>"
215 data-must-search="<?php echo esc_attr( $must_search ); ?>" data-searched="<?php echo $not_searched ? '0' : '1'; ?>"
216 data-view_type="<?php echo esc_attr( $current_view ) ?>" data-page="<?php echo esc_attr( $current_page ) ?>"
217 data-sorting="<?php echo esc_attr( $sort_from_url ) ?>">
218 <div class="um-members-overlay"><div class="um-ajax-loading"></div></div>
219
220 <div class="um-member-directory-header um-form">
221
222 <?php do_action( 'um_members_directory_before_head', $args, $form_id, $not_searched ); ?>
223
224 <?php if ( $search && $show_search ) { ?>
225 <div class="um-member-directory-header-row um-member-directory-search-row">
226 <div class="um-member-directory-search-line">
227 <label>
228 <span><?php _e( 'Search:', 'ultimate-member' ); ?></span>
229 <input type="search" class="um-search-line" placeholder="<?php esc_attr_e( 'Search', 'ultimate-member' ) ?>" value="<?php echo esc_attr( $search_from_url ) ?>" aria-label="<?php esc_attr_e( 'Search', 'ultimate-member' ) ?>" speech />
230 </label>
231 <input type="button" class="um-do-search um-button" value="<?php esc_attr_e( 'Search', 'ultimate-member' ); ?>" />
232 </div>
233 </div>
234 <?php }
235
236 if ( ( ! empty( $args['enable_sorting'] ) && ! empty( $sorting_options ) && count( $sorting_options ) > 1 ) ||
237 ( $filters && $show_filters && count( $search_filters ) ) ||
238 ! $single_view ) { ?>
239 <div class="um-member-directory-header-row">
240 <div class="um-member-directory-nav-line">
241 <?php if ( ! $single_view ) {
242 $view_types = 0;
243
244 foreach ( UM()->member_directory()->view_types as $key => $value ) {
245 if ( in_array( $key, $args['view_types'] ) ) {
246 if ( empty( $view_types ) ) { ?>
247 <span class="um-member-directory-view-type<?php if ( $not_searched ) {?> um-disabled<?php } ?>">
248 <?php }
249
250 $view_types++; ?>
251
252 <a href="javascript:void(0)"
253 class="um-member-directory-view-type-a<?php if ( ! $not_searched ) {?> um-tip-n<?php } ?>"
254 data-type="<?php echo $key; ?>"
255 data-default="<?php echo ( $default_view == $key ) ? 1 : 0; ?>"
256 title="<?php printf( esc_attr__( 'Change to %s', 'ultimate-member' ), $value['title'] ) ?>"
257 default-title="<?php echo esc_attr( $value['title'] ); ?>"
258 next-item="" ><i class="<?php echo $value['icon']; ?>"></i></a>
259 <?php }
260 }
261
262 if ( ! empty( $view_types ) ) { ?>
263 </span>
264 <?php }
265 }
266
267 if ( ! empty( $args['enable_sorting'] ) && ! empty( $sorting_options ) && count( $sorting_options ) > 1 ) { ?>
268 <div class="um-member-directory-sorting">
269 <span><?php _e( 'Sort by:', 'ultimate-member' ); ?>&nbsp;</span>
270 <div class="um-member-directory-sorting-a">
271 <a href="javascript:void(0);" class="um-member-directory-sorting-a-text"><?php echo $sorting_options[ $sort_from_url ] ?></a>
272 &nbsp;<i class="um-faicon-caret-down"></i><i class="um-faicon-caret-up"></i>
273 </div>
274 </div>
275
276 <?php $items = array();
277
278 foreach ( $sorting_options as $value => $title ) {
279 $items[] = '<a href="javascript:void(0);" data-directory-hash="' . esc_attr( substr( md5( $form_id ), 10, 5 ) ) . '" class="um-sortyng-by-' . esc_attr( $value ) . '" data-value="' . esc_attr( $value ) . '" data-selected="' . ( ( $sort_from_url == $value ) ? '1' : '0' ) . '" data-default="' . ( ( $default_sorting == $value ) ? '1' : '0' ) . '">' . $title . '</a>'; ?>
280 <?php }
281
282 UM()->member_directory()->dropdown_menu( '.um-member-directory-sorting-a', 'click', $items ); ?>
283
284 <?php }
285
286 if ( $filters && $show_filters && count( $search_filters ) && $filters_collapsible ) { ?>
287 <span class="um-member-directory-filters">
288 <span class="um-member-directory-filters-a<?php if ( $filters_expanded ) { ?> um-member-directory-filters-visible<?php } ?>">
289 <a href="javascript:void(0);">
290 <?php _e( 'More filters', 'ultimate-member' ); ?>
291 </a>
292 &nbsp;<i class="um-faicon-caret-down"></i><i class="um-faicon-caret-up"></i>
293 </span>
294 </span>
295 <?php } ?>
296 </div>
297 </div>
298 <?php } ?>
299
300
301 <?php if ( $filters && $show_filters && count( $search_filters ) ) {
302
303 if ( is_array( $search_filters ) ) { ?>
304 <script type="text/template" id="tmpl-um-members-filtered-line">
305 <# if ( data.filters.length > 0 ) { #>
306 <# _.each( data.filters, function( filter, key, list ) { #>
307 <div class="um-members-filter-tag">
308 <# if ( filter.type == 'slider' ) { #>
309 {{{filter.value_label}}}
310 <# } else { #>
311 <strong>{{{filter.label}}}</strong>: {{{filter.value_label}}}
312 <# } #>
313 <div class="um-members-filter-remove um-tip-n" data-name="{{{filter.name}}}"
314 data-value="{{{filter.value}}}" data-range="{{{filter.range}}}"
315 data-type="{{{filter.type}}}" title="<?php esc_attr_e( 'Remove filter', 'ultimate-member' ) ?>">&times;</div>
316 </div>
317 <# }); #>
318 <# } #>
319 </script>
320
321 <div class="um-member-directory-header-row um-member-directory-filters-bar<?php if ( ! $filters_expanded ) { ?> um-header-row-invisible<?php } ?>">
322 <div class="um-search um-search-<?php echo count( $search_filters ) ?><?php if ( ! $filters_expanded ) { ?> um-search-invisible<?php } ?>">
323 <?php $i = 0;
324 foreach ( $search_filters as $filter ) {
325 $filter_content = UM()->member_directory()->show_filter( $filter, $args );
326 if ( empty( $filter_content ) ) {
327 continue;
328 }
329
330 $type = UM()->member_directory()->filter_types[ $filter ]; ?>
331
332 <div class="um-search-filter um-<?php echo esc_attr( $type ) ?>-filter-type <?php echo ( $i != 0 && $i%2 !== 0 ) ? 'um-search-filter-2' : '' ?>">
333 <?php echo $filter_content; ?>
334 </div>
335
336 <?php $i++;
337 } ?>
338 </div>
339 </div>
340 <div class="um-member-directory-header-row">
341 <div class="um-filtered-line">
342 <div class="um-clear-filters"><a href="javascript:void(0);" class="um-clear-filters-a" title="<?php esc_attr_e( 'Remove all filters', 'ultimate-member' ) ?>"><?php _e( 'Clear all', 'ultimate-member' ); ?></a></div>
343 </div>
344 </div>
345 <?php
346 }
347 }
348 do_action( 'um_members_directory_head', $args ); ?>
349 </div>
350
351 <div class="um-members-wrapper"></div>
352
353 <div class="um-members-pagination-box"></div>
354
355 <?php
356 /**
357 * UM hook
358 *
359 * @type action
360 * @title um_members_directory_footer
361 * @description Member directory display footer
362 * @input_vars
363 * [{"var":"$args","type":"array","desc":"Member directory shortcode arguments"}]
364 * @change_log
365 * ["Since: 2.0"]
366 * @usage add_action( 'um_members_directory_footer', 'function_name', 10, 1 );
367 * @example
368 * <?php
369 * add_action( 'um_members_directory_footer', 'my_members_directory_footer', 10, 1 );
370 * function my_members_directory_footer( $args ) {
371 * // your code here
372 * }
373 * ?>
374 */
375 do_action( 'um_members_directory_footer', $args, $form_id, $not_searched ); ?>
376
377 </div>