Skip to content
Snippets Groups Projects
Unverified Commit af159407 authored by weaver299's avatar weaver299 Committed by GitHub
Browse files

Merge pull request #318 from ASCWebServices/canini-2

Courses and Research Gallery Fixes
parents e2690abd a81d8563
No related branches found
No related tags found
No related merge requests found
......@@ -115,8 +115,6 @@ function asc_bootstrap_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $
($form['#id'] == 'views-exposed-form-research-project-directory-page-1')
|| ($form['#id'] == 'views-exposed-form-research-project-gallery-page-1')
|| ($form['#id'] == 'views-exposed-form-research-project-directory-mobile-page-1')
|| ($form['#id'] == 'views-exposed-form-courses-page-2')
|| ($form['#id'] == 'views-exposed-form-courses-page-3')
|| ($form['#id'] == 'views-exposed-form-research-project-directory-block-1')
|| ($form['#id'] == 'views-exposed-form-research-project-gallery-block-1')
|| ($form['#id'] == 'views-exposed-form-research-project-directory-mobile-block-1')
......@@ -150,6 +148,32 @@ function asc_bootstrap_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $
//courses
if ($form['#id'] == 'views-exposed-form-courses-page-2') {
/*
* add new HTML content to filters (headers and spacer)
* and setting weights for where they should appear in the form hierarchy
*/
if((count($form['field_course_term_1_target_id']['#options']) > 1)
|| (count($form['field_course_term_2_target_id']['#options']) > 1)) {
$form['filter_heading'] = array(
'#markup' => '<h2 class="filter-heading">Filter</h2>',
'#weight' => -10,
);
}
$form['filter_search_heading'] = array(
'#markup' => '<h2 class="filter-heading search-heading">Search</h2>',
'#weight' => 4,
);
$form['spacer'] = array(
'#markup' => '<div class="filter-spacer"></div>',
'#weight' => 1.5,
);
/*
* setting up weights for form elements
*/
$form['title']['#weight'] = 5;
$form['title']['#attributes']['placeholder'] = t('Search Keywords');
if(count($form['field_course_term_1_target_id']['#options']) == 1) {
$form['field_course_term_1_target_id']['#access'] = FALSE;
}
......@@ -190,6 +214,27 @@ function asc_bootstrap_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $
//courses mobile
if ($form['#id'] == 'views-exposed-form-courses-page-3') {
if((count($form['field_course_term_1_target_id']['#options']) > 1)
|| (count($form['field_course_term_2_target_id']['#options']) > 1)) {
$form['filter_heading'] = array(
'#markup' => '<h2 class="filter-heading">Filter</h2>',
'#weight' => -10,
);
}
$form['filter_search_heading'] = array(
'#markup' => '<h2 class="filter-heading search-heading">Search</h2>',
'#weight' => 4,
);
$form['spacer'] = array(
'#markup' => '<div class="filter-spacer"></div>',
'#weight' => 1.5,
);
/*
* setting up weights for form elements
*/
$form['title']['#weight'] = 5;
$form['title']['#attributes']['placeholder'] = t('Search Keywords');
if(count($form['field_course_term_1_target_id']['#options']) == 1) {
$form['field_course_term_1_target_id']['#access'] = FALSE;
}
......
jQuery(window).bind("pageshow", function(event) {
if (event.originalEvent.persisted) {
window.location.reload()
}
});
jQuery(document).ready(function(){
//activates lightbox effect on gallery content type
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment