33af68b9 by Jeff Balicki

search

Signed-off-by: Jeff <jeff@gotenzing.com>
1 parent 5378d9ac
......@@ -14798,6 +14798,51 @@ input[type=checkbox] {
background-image: url("data:image/svg+xml,%3Csvg id='Component_33_1' data-name='Component 33 %E2%80%93 1' xmlns='http://www.w3.org/2000/svg' width='35' height='35' viewBox='0 0 35 35'%3E%3Ccircle id='Ellipse_8' data-name='Ellipse 8' cx='17.5' cy='17.5' r='17.5' fill='%230484b8'/%3E%3Cg id='Group_1454' data-name='Group 1454' transform='translate(-1077.417 -15.667)'%3E%3Ccircle id='Ellipse_7' data-name='Ellipse 7' cx='6.701' cy='6.701' r='6.701' transform='translate(1086.75 25)' fill='none' stroke='%23fff' stroke-width='3'/%3E%3Cline id='Line_39' data-name='Line 39' x2='4.188' y2='4.188' transform='translate(1098.896 37.146)' fill='none' stroke='%23fff' stroke-linecap='round' stroke-width='3'/%3E%3C/g%3E%3C/svg%3E");
}
#search {
display: none;
}
#search .search-form {
width: 60%;
margin: auto;
margin-top: 40px;
}
#search .search-form label {
width: 90%;
}
#search .search-form .search-field {
all: unset;
width: 100%;
margin: auto;
border-bottom: 1px solid #2c2c2c;
}
#search .search-form .search-submit {
all: unset;
background-color: #0484B8;
color: #fff;
padding: 6px 12px;
position: relative;
top: -10px;
left: -56px;
}
#search .close {
all: unset;
display: inline-block;
font-size: 0px;
width: 30px;
height: 30px;
background-size: contain;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='33.996' height='33.996' viewBox='0 0 33.996 33.996'%3E%3Cg id='Group_1458' data-name='Group 1458' transform='translate(2.121 2.121)' opacity='0.997'%3E%3Cline id='Line_3' data-name='Line 3' x2='29.754' y2='29.754' transform='translate(0 0)' fill='none' stroke='%23156570' stroke-linecap='round' stroke-width='3'/%3E%3Cline id='Line_4' data-name='Line 4' x1='29.754' y2='29.754' transform='translate(0 0)' fill='none' stroke='%23156570' stroke-linecap='round' stroke-width='3'/%3E%3C/g%3E%3C/svg%3E");
}
#search.open {
display: block;
width: 100%;
height: 128px;
background-color: rgba(255, 255, 255, 0.9);
position: fixed;
z-index: 999;
}
#wrapper-footer-full {
background-color: #fff;
padding-bottom: 0px;
......@@ -15125,6 +15170,36 @@ input[type=checkbox] {
border-bottom: 20px solid #e04e39;
}
.course-carousel {
width: 100% !important;
margin-left: 0px !important;
position: relative;
}
@media only screen and (min-width: 1400px) {
.course-carousel {
max-width: 100% !important;
}
}
.course-carousel .swiper-wrapper {
margin: auto;
}
.course-carousel .swiper-slide {
margin-left: 0px !important;
width: 333px !important;
}
.course-carousel .card {
min-height: 540px;
}
.course-carousel .swiper-button-next {
right: 30px !important;
}
.course-carousel .swiper-button-prev {
left: 7px !important;
}
.course-carousel .swiper-pagination {
bottom: -40px !important;
}
.c-accordion__title:after {
content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='23.996' height='14.55' viewBox='0 0 23.996 14.55'%3E%3Cpath id='Path_1291' data-name='Path 1291' d='M23.327 192.9c.832-.842 1.647-1.677 2.473-2.5q2.971-2.969 5.948-5.931a1.334 1.334 0 0 1 1.972 0c.377.388.763.766 1.146 1.148a1.307 1.307 0 0 1-.007 1.956q-2.675 2.674-5.349 5.35-2.594 2.6-5.185 5.2a1.447 1.447 0 0 1-.97.463 1.381 1.381 0 0 1-1.067-.46q-2-2.008-4-4.015-2.724-2.727-5.45-5.453c-.371-.371-.744-.74-1.113-1.113a1.3 1.3 0 0 1 .013-1.919q.569-.567 1.136-1.136a1.333 1.333 0 0 1 2 0l4.825 4.807 3.494 3.479C23.224 192.8 23.259 192.831 23.327 192.9Z' transform='translate(-11.305 -184.028)' fill='%23156570'/%3E%3C/svg%3E");
top: 40%;
......@@ -15592,6 +15667,10 @@ label[for=quicksearch] {
border-bottom: 22px solid #e04e39;
}
#resources.dataTable {
width: 100% !important;
}
#dataTables_length,
#resources_filter,
#resources_length {
......
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.
......@@ -42,13 +42,27 @@ $navbar_type = get_theme_mod( 'understrap_navbar_type', 'collapse' );
</div>
<!-- ******************* The Navbar Area ******************* -->
<header id="wrapper-navbar">
<div id="search">
<form role="search" method="get" class="search-form" action="<?php echo home_url( '/' ); ?>">
<label>
<span class="screen-reader-text"><?php echo _x( 'Search for:', 'label' ) ?></span>
<input type="search" class="search-field"
placeholder="<?php echo esc_attr_x( 'Search …', 'placeholder' ) ?>"
value="<?php echo get_search_query() ?>" name="s"
title="<?php echo esc_attr_x( 'Search for:', 'label' ) ?>" />
</label>
<input type="submit" class="search-submit" value="<?php echo esc_attr_x( 'GO', 'submit button' ) ?>" />
<button class="close" type="button">close</button>
</form>
<!-- <a class="skip-link" href="#content"><?php //esc_html_e( 'Skip to content', 'understrap' ); ?></a> -->
</div>
<!-- <a class="skip-link" href="#content"><z?php //esc_html_e( 'Skip to content', 'understrap' ); ?></a> -->
<?php get_template_part( 'global-templates/navbar', $navbar_type . '-' . $bootstrap_version ); ?>
<button type="button" class="btn btn-floating btn-lg" id="btn-back-to-top">
</button>
<?php echo do_shortcode('[share-this]'); ?>
</header><!-- #wrapper-navbar -->
\ No newline at end of file
......
......@@ -44,6 +44,33 @@ function course_list(){
return $output;
}
add_shortcode('my-course-list', 'my_course_list');
function my_course_list(){
ob_start();
$enrolled_courses = learndash_user_get_enrolled_courses(get_current_user_id());
if (is_array($enrolled_courses)): ?>
<div class="carousel course">
<div id="<?php echo $uniqid; ?>" class="course-carousel carousel-items">
<div class='swiper-wrapper'>
<?php foreach($enrolled_courses as $enrolled){
echo course_card($enrolled);
}; ?>
</div>
<div class="swiper-pagination"></div>
<div class="swiper-button-prev" data-id="<?= $uniqid; ?>"></div>
<div class="swiper-button-next" data-id="<?= $uniqid; ?>"></div>
</div>
</div>
<?php endif;
wp_reset_query();
$output = ob_get_clean();
return $output;
}
function course_card($id){
......@@ -56,7 +83,7 @@ function course_card($id){
$categories = get_the_terms( $id, 'ld_course_category' );
$cat =""; foreach( $categories as $category ) { $cat .= " ".$category->slug; }; ?>
<div data-name="<?php echo $post->post_name; ?>" data-ticks="<?php echo get_post_time('U',false, $id ); ?>" class="element-item <?php echo $cat; ?> " data-category="<?php echo $cat; ?>">
<div data-name="<?php echo $post->post_name; ?>" data-ticks="<?php echo get_post_time('U',false, $id ); ?>" class="swiper-slide element-item <?php echo $cat; ?> " data-category="<?php echo $cat; ?>">
<article id="post-<?php echo $id; ?>" class="post post-<?php echo $id; ?> sfwd-courses type-sfwd-courses">
<div class="card">
<div class="thumbnail"><div class="ribbon"><?php echo get_post_meta( $id, '_learndash_course_grid_custom_ribbon_text', true);?></div>
......
......@@ -60,6 +60,35 @@ function resources_list(){
}
add_shortcode('resources-fav', 'resources_fav');
function resources_fav(){
$favorites = get_user_favorites(get_current_user_id());
ob_start();
$uniqid = uniqid();
if (is_array( $favorites)): ?>
<div class="course-list resources">
<table id="resources" class="resources-fav">
<thead><tr><th class="hidden"></th><th class="hidden"></th><th></th><th class="hidden"></th><th></th></tr></thead>
<tbody>
<?php foreach($favorites as $fav){
echo resources($fav);
}; ?>
</tbody>
</table>
</div>
<?php endif;
wp_reset_query();
$output = ob_get_clean();
return $output;
}
function resources($id){
......@@ -86,7 +115,7 @@ function resources($id){
</td>
<td class="hidden"> <?php echo $cat; ?></td>
<td class="hidden"><?php echo get_post_time('U',false, $id ); ?></td>
<td><?php echo do_shortcode('[favorite_button post_id="'.$id.'"]'); ?></td>
<td><?php echo do_shortcode('[favorite_button post_id="'.$id.'"]'); ?></td>
</tr>
<?php
$output = ob_get_clean();
......
......@@ -99,3 +99,12 @@ function share_this($atts){
<?php
return ob_get_clean();
}
add_shortcode( 'firstname', 'firstname' );
function firstname(){
$user = get_userdata( get_current_user_id() );
return $user->first_name;;
}
\ No newline at end of file
......
......@@ -32973,17 +32973,28 @@
var offsetAfter = 0;
var PerView = 'auto';
var space = 20;
var SlidesPerGroup = 1;
var _id = jQuery(this).parent().attr('id');
if (jQuery(this).hasClass('promo-carousel')) {
offset = 0;
PerView = 1;
space = 0;
SlidesPerGroup = 1;
offsetAfter = 0;
_id = jQuery(this).attr('id');
}
if (jQuery(this).hasClass('course-carousel')) {
offset = (window.innerWidth - $('.entry-content').width()) / 2 - 28;
PerView = 3;
space = 0;
SlidesPerGroup = 3;
offsetAfter = (window.innerWidth - $('.entry-content').width()) / 2 - 28;
_id = jQuery(this).attr('id');
}
if ($(window).width() < 600) {
offset = 0;
PerView = 1;
SlidesPerGroup = 1;
space = 0;
offsetAfter = 0;
}
......@@ -32993,7 +33004,7 @@
slidesOffsetAfter: offsetAfter,
slidesOffsetBefore: offset,
spaceBetween: space,
slidesPerGroup: 1,
slidesPerGroup: SlidesPerGroup,
pagination: {
el: ".swiper-pagination",
type: 'bullets',
......@@ -33526,8 +33537,12 @@
if (!$('#resources').length) {
return;
}
var pageL = 10;
if ($('#resources').hasClass('resources-fav')) {
pageL = 4;
}
var myTable = $('#resources').DataTable({
"pageLength": 10,
"pageLength": pageL,
"searchable": false,
"paging": true,
"info": false,
......@@ -33639,6 +33654,12 @@
document.body.scrollTop = 0;
document.documentElement.scrollTop = 0;
}
$__default["default"](document).ready(function ($) {
$(document).on("click", ".search-button a", function (e) {
e.preventDefault();
$('#search').toggleClass('open');
});
});
exports.Alert = alert$1;
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.
......@@ -20,6 +20,7 @@ jQuery(document).ready(function($) {
var offsetAfter = 0;
var PerView = 'auto';
var space = 20;
var SlidesPerGroup= 1;
var _id = jQuery(this).parent().attr('id');
......@@ -27,15 +28,27 @@ jQuery(document).ready(function($) {
offset = 0;
PerView = 1;
space = 0;
SlidesPerGroup =1;
offsetAfter = 0;
_id = jQuery(this).attr('id');
}
if (jQuery(this).hasClass('course-carousel')) {
offset = ((window.innerWidth - $('.entry-content').width()) / 2) - 28;
PerView = 3;
space = 0;
SlidesPerGroup = 3;
offsetAfter = ((window.innerWidth - $('.entry-content').width()) / 2) - 28;
_id = jQuery(this).attr('id');
}
if ($(window).width() < 600) {
offset = 0;
PerView = 1;
SlidesPerGroup = 1;
space = 0;
offsetAfter = 0;
}
......@@ -46,7 +59,7 @@ jQuery(document).ready(function($) {
slidesOffsetAfter: offsetAfter,
slidesOffsetBefore: offset,
spaceBetween: space,
slidesPerGroup: 1,
slidesPerGroup: SlidesPerGroup ,
pagination: {
el: ".swiper-pagination",
type: 'bullets',
......
......@@ -4,8 +4,12 @@ jQuery(document).ready(function($) {
return;
}
var pageL = 10;
if($('#resources').hasClass('resources-fav')){
pageL = 4;
}
var myTable = $('#resources').DataTable({
"pageLength": 10,
"pageLength": pageL,
"searchable": false,
"paging": true,
"info": false,
......
......@@ -11,6 +11,8 @@ import "./jssocials.min";
import "./_course_list";
import "./_resources_list";
var a = document.querySelector('.blur-image');
document.addEventListener("DOMContentLoaded", function() {
......@@ -63,4 +65,14 @@ mybutton.addEventListener("click", backToTop);
function backToTop() {
document.body.scrollTop = 0;
document.documentElement.scrollTop = 0;
}
\ No newline at end of file
}
jQuery(document).ready(function($) {
$(document).on("click", ".search-button a", function(e) {
e.preventDefault();
$('#search').toggleClass('open');
});
});
\ No newline at end of file
......
......@@ -227,4 +227,38 @@
}
}
}
.course-carousel {
width: 100% !important;
margin-left: 0px !important;
position: relative;
@media only screen and (min-width: 1400px) {
max-width: 100% !important;
}
.swiper-wrapper{
// max-width: 1344px;
margin: auto;
}
.swiper-slide {
margin-left: 0px !important;
width: 333px !important;
}
.card{
min-height: 540px;
}
.swiper-button-next {
right: 30px !important;
}
.swiper-button-prev {
left: 7px !important;
}
.swiper-pagination {
bottom: -40px !important;
}
}
\ No newline at end of file
......
......@@ -179,4 +179,54 @@
height: 35px;
background-image: url("data:image/svg+xml,%3Csvg id='Component_33_1' data-name='Component 33 %E2%80%93 1' xmlns='http://www.w3.org/2000/svg' width='35' height='35' viewBox='0 0 35 35'%3E%3Ccircle id='Ellipse_8' data-name='Ellipse 8' cx='17.5' cy='17.5' r='17.5' fill='%230484b8'/%3E%3Cg id='Group_1454' data-name='Group 1454' transform='translate(-1077.417 -15.667)'%3E%3Ccircle id='Ellipse_7' data-name='Ellipse 7' cx='6.701' cy='6.701' r='6.701' transform='translate(1086.75 25)' fill='none' stroke='%23fff' stroke-width='3'/%3E%3Cline id='Line_39' data-name='Line 39' x2='4.188' y2='4.188' transform='translate(1098.896 37.146)' fill='none' stroke='%23fff' stroke-linecap='round' stroke-width='3'/%3E%3C/g%3E%3C/svg%3E");
}
\ No newline at end of file
#search{
display: none;
.search-form{
width: 60%;
margin: auto;
margin-top: 40px;
label{
width: 90%;
}
.search-field{
all: unset;
width: 100%;
margin: auto;
border-bottom:1px solid #2c2c2c;
}
.search-submit{
all: unset;
background-color: #0484B8;
color: #fff;
padding: 6px 12px;
position:relative;
top: -10px;
left: -56px;
}
}
.close{
all: unset;
display: inline-block;
font-size: 0px;
width: 30px;
height: 30px;
background-size: contain;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='33.996' height='33.996' viewBox='0 0 33.996 33.996'%3E%3Cg id='Group_1458' data-name='Group 1458' transform='translate(2.121 2.121)' opacity='0.997'%3E%3Cline id='Line_3' data-name='Line 3' x2='29.754' y2='29.754' transform='translate(0 0)' fill='none' stroke='%23156570' stroke-linecap='round' stroke-width='3'/%3E%3Cline id='Line_4' data-name='Line 4' x1='29.754' y2='29.754' transform='translate(0 0)' fill='none' stroke='%23156570' stroke-linecap='round' stroke-width='3'/%3E%3C/g%3E%3C/svg%3E");
}
}
#search.open{
display: block;
width: 100%;
height: 128px;
background-color:rgba(255,255,255,0.9);
position: fixed;
z-index: 999;
}
\ No newline at end of file
......
#resources.dataTable{
width: 100% !important;
}
#dataTables_length,
#resources_filter,
#resources_length {
......