Skip to content

Commit

Permalink
Merge branch 'degree-search'
Browse files Browse the repository at this point in the history
  • Loading branch information
cjg89 committed Aug 1, 2017
2 parents 2e3b3aa + a8ece3f commit af9b18c
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 59 deletions.
18 changes: 0 additions & 18 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,21 +213,3 @@ function colleges_post_list_search( $posts, $atts ) {

remove_action( 'ucf_post_list_search', 'ucf_post_list_search' );
add_action( 'ucf_post_list_search', 'colleges_post_list_search', 10, 2 );


/**
* Update post list search typeaheads to use Athena dropdown classes in this
* theme.
**/
function colleges_post_list_search_classnames( $classnames, $posts, $atts ) {
return json_encode( array(
'input' => 'form-control',
'menu' => 'dropdown',
'dataset' => 'dropdown-menu',
'open' => 'show',
'suggestion' => 'dropdown-item',
'cursor' => 'active'
) );
}

add_filter( 'ucf_post_list_search_classnames', 'colleges_post_list_search_classnames', 10, 3 );
34 changes: 25 additions & 9 deletions includes/degree-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,18 +226,18 @@ function get_degree_cta_btns_markup( $post ) {
* Add custom degree block list layout for UCF Post List shortcode
**/

function ucf_post_list_display_degree_block_before( $posts, $atts ) {
function colleges_post_list_display_degree_block_before( $posts, $atts ) {
ob_start();
?>
<div class="ucf-post-list ucf-post-list-degree-block">
<div class="ucf-post-list colleges-post-list-degree-block">
<?php
echo ob_get_clean();
}

add_action( 'ucf_post_list_display_degree_block_before', 'ucf_post_list_display_degree_block_before', 10, 2 );
add_action( 'ucf_post_list_display_degree_block_before', 'colleges_post_list_display_degree_block_before', 10, 2 );


function ucf_post_list_display_degree_block_title( $posts, $atts ) {
function colleges_post_list_display_degree_block_title( $posts, $atts ) {
$formatted_title = '';

if ( $atts['list_title'] ) {
Expand All @@ -247,10 +247,10 @@ function ucf_post_list_display_degree_block_title( $posts, $atts ) {
echo $formatted_title;
}

add_action( 'ucf_post_list_display_degree_block_title', 'ucf_post_list_display_degree_block_title', 10, 2 );
add_action( 'ucf_post_list_display_degree_block_title', 'colleges_post_list_display_degree_block_title', 10, 2 );


function ucf_post_list_display_degree_block( $posts, $atts ) {
function colleges_post_list_display_degree_block( $posts, $atts ) {
if ( ! is_array( $posts ) && $posts !== false ) { $posts = array( $posts ); }
ob_start();
?>
Expand Down Expand Up @@ -288,15 +288,31 @@ function ucf_post_list_display_degree_block( $posts, $atts ) {
echo ob_get_clean();
}

add_action( 'ucf_post_list_display_degree_block', 'ucf_post_list_display_degree_block', 10, 2 );
add_action( 'ucf_post_list_display_degree_block', 'colleges_post_list_display_degree_block', 10, 2 );


function ucf_post_list_display_degree_block_after( $posts, $atts ) {
function colleges_post_list_display_degree_block_after( $posts, $atts ) {
ob_start();
?>
</div>
<?php
echo ob_get_clean();
}

add_action( 'ucf_post_list_display_degree_block_after', 'ucf_post_list_display_degree_block_after', 10, 2 );
add_action( 'ucf_post_list_display_degree_block_after', 'colleges_post_list_display_degree_block_after', 10, 2 );


/**
* Modify the list of valid taxonomies for Degree posts used by the Degree
* Search plugin.
**/
function colleges_degree_taxonomies() {
return array(
'post_tag',
'program_types',
'departments',
'career_paths'
);
}

add_filter( 'ucf_degree_taxonomies', 'colleges_degree_taxonomies' );
2 changes: 1 addition & 1 deletion src/scss/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
@import 'header';
@import 'footer';

@import 'post-lists';
@import 'forms';
@import 'person';
@import 'events';
@import 'rss';
Expand Down
55 changes: 55 additions & 0 deletions src/scss/_forms.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
.twitter-typeahead {
width: 100%;

.tt-input {
@extend .form-control;
}

.tt-hint {
color: $gray-light;
height: 100%;
line-height: 1;
padding: calc(#{$input-padding-y} + #{$btn-border-width - $input-btn-border-width}) $input-padding-x;

@include media-breakpoint-up(md) {
padding: calc(#{$input-padding-y-md} + #{$btn-border-width - $input-btn-border-width}) $input-padding-x;
}
}

.tt-menu {
@extend .dropdown;
right: 0;
}

.tt-open {
@extend .show;
}

.tt-dataset {
@extend .dropdown-menu;
max-height: 40vh;
overflow-y: scroll;
width: 100%;

@include media-breakpoint-up(md) {
max-height: 75vh;
max-width: 100%;
width: 30rem;
}
}

.tt-suggestion {
@extend .dropdown-item;
white-space: normal;

&:hover {
cursor: pointer;
}
}

.tt-cursor {
background-color: $dropdown-link-active-bg;
color: $dropdown-link-active-color;
text-decoration: none;
}
}
29 changes: 0 additions & 29 deletions src/scss/_post-lists.scss

This file was deleted.

4 changes: 2 additions & 2 deletions static/css/style.min.css

Large diffs are not rendered by default.

0 comments on commit af9b18c

Please sign in to comment.