2018-03-21 18:19:20 +00:00
< ? php
2021-01-22 16:19:51 +00:00
/**
2018-03-21 18:19:20 +00:00
* Template Name : Experience by Companies
2021-01-23 14:41:19 +00:00
*
2021-01-21 10:24:10 +00:00
* The template for displaying all items , indexed by organisation .
2018-03-21 18:19:20 +00:00
*
2021-01-21 10:24:10 +00:00
* @ package Omphaloskepsis
* @ since Omphaloskepsis 1.0
2018-03-21 18:19:20 +00:00
*/
2021-01-22 16:19:51 +00:00
2018-03-21 18:19:20 +00:00
get_header (); ?>
2021-01-21 10:24:10 +00:00
< main id = " experience-wrapper " class = " content-area col-10 col-m-12 " >
2021-01-23 14:41:19 +00:00
<!-- Page Title & Details -->
< header class = " post-header-title " >
< h1 style = " margin-bottom: 20px; " id = " page-title " > Experience .</ h1 >
< ? php
while ( have_posts () ) :
the_post ();
?>
< div class = " entry-content tile " id = " taxonomy-description " >
< ? php the_content (); ?>
</ div >
< div class = " entry-content tile " id = " settings " >
< h3 style = " margin-bottom: 14px; " class = " subheading " > Settings </ h3 >
< form action = " /experience " id = " settings " method = " POST " >
2021-01-23 13:26:37 +00:00
< ? php echo wp_kses_post ( wp_nonce_field ( 'experience' , 'settings_nonce' ) ); ?>
2021-01-09 11:13:06 +00:00
< input class = " checkbox " type = " checkbox " id = " toplevel " value = " toplevel " checked = " checked " >
< label for = " toplevel " > Display only top - level organisations </ label >
< br >
< fieldset >
2021-01-23 14:41:19 +00:00
< legend >< p style = " margin-top: 14px; margin-bottom: 14px; " > Display only organisations with associated :</ p ></ legend >
< div class = " controlgroup " id = " typestodisplay " >
< label for = " jobs " > Roles < span class = " dashicons dashicons-hammer " ></ span ></ label >
< input type = " checkbox " name = " jobs " id = " jobs " checked = " checked " >
< label class = " currentjobs " for = " currentjobs " > Display only current roles </ label >
< input class = " currentjobs " type = " checkbox " name = " currentjobs " id = " currentjobs " checked = " checked " >
< label for = " posts " > Blog Posts < span class = " dashicons dashicons-admin-post " ></ span ></ label >
< input type = " checkbox " name = " posts " id = " posts " >
< label for = " websites " > Websites < span class = " dashicons dashicons-schedule " ></ span ></ label >
< input type = " checkbox " name = " websites " id = " websites " >
< label for = " programs " > Programs < span class = " dashicons dashicons-desktop " ></ span ></ label >
< input type = " checkbox " name = " programs " id = " programs " >
< label for = " writings " > Writings < span class = " dashicons dashicons-format-aside " ></ span ></ label >
< input type = " checkbox " name = " writings " id = " writings " >
< label for = " videos " > Videos < span class = " dashicons dashicons-video-alt " ></ span ></ label >
< input type = " checkbox " name = " videos " id = " videos " >
< label for = " other " > Other < span class = " dashicons dashicons-archive " ></ span ></ label >
< input type = " checkbox " name = " other " id = " other " >
< label for = " qualifications " > Qualifications < span class = " dashicons dashicons-id " ></ span ></ label >
< input type = " checkbox " name = " qualifications " id = " qualifications " >
< label class = " expired " for = " expired " > Show expired qualifications </ label >
< input class = " expired " type = " checkbox " name = " expired " id = " expired " >
< label for = " awards " > Awards < span class = " dashicons dashicons-awards " ></ span ></ label >
< input type = " checkbox " name = " awards " id = " awards " >
</ div >
2021-01-09 11:13:06 +00:00
</ fieldset >
< br >
< input class = " ui-button ui-widget ui-corner-all " id = " refresh " type = " submit " value = " Refresh " >
2021-01-23 14:41:19 +00:00
</ form >
</ div >
< ? php endwhile ; ?>
</ header >
2018-03-21 18:19:20 +00:00
2021-01-23 14:41:19 +00:00
<!-- Company Grid -->
< table class = " row " id = " organisations-grid " >
</ table >
2021-01-22 16:19:51 +00:00
< ? php // phpcs:disable WordPress.WP.EnqueuedResources ?>
2021-01-23 14:41:19 +00:00
< link rel = " stylesheet " href = " //code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css " >
< script src = " https://code.jquery.com/ui/1.12.1/jquery-ui.js " ></ script >
< script type = " text/javascript " >
// Populates the organisations grid.
jQuery ( document ) . ready ( function ( $ ) {
// Sets up jQueryUI elements.
$ ( 'input:checkbox' ) . checkboxradio ();
$ ( '.controlgroup' ) . controlgroup ();
$ ( '.refresh' ) . button ();
2018-03-21 18:19:20 +00:00
2021-01-23 14:41:19 +00:00
$ ( '#refresh' ) . click ( function ( event ) {
2021-01-23 13:26:25 +00:00
$ ( this ) . css ( 'border-width' , '1px' );
event . preventDefault ();
displayCompanies ();
2021-01-23 14:41:19 +00:00
});
2018-03-21 18:19:20 +00:00
2021-01-23 14:41:19 +00:00
// Displays the initial organisations grid.
$ ( '#refresh' ) . click ();
2018-03-21 18:19:20 +00:00
2021-01-23 14:41:19 +00:00
$ ( '.expired' ) . hide ();
$ ( 'input[type="checkbox"]' ) . change ( function () {
2021-01-09 11:13:06 +00:00
$ ( '#refresh' ) . css ( 'border-width' , '5px' );
2021-01-23 14:41:19 +00:00
});
$ ( '#jobs' ) . change ( function () {
2021-01-09 11:13:06 +00:00
if ( $ ( this ) . is ( " :checked " )) {
2021-01-23 14:41:19 +00:00
$ ( '.currentjobs' ) . fadeIn ( 100 );
2021-01-09 11:13:06 +00:00
} else {
2021-01-23 14:41:19 +00:00
$ ( '.currentjobs' ) . fadeOut ( 100 );
2021-01-09 11:13:06 +00:00
}
2021-01-23 14:41:19 +00:00
});
2018-03-21 18:19:20 +00:00
2021-01-23 14:41:19 +00:00
$ ( '#qualifications' ) . change ( function () {
2021-01-09 11:13:06 +00:00
if ( $ ( this ) . is ( " :checked " )) {
2021-01-23 14:41:19 +00:00
$ ( '.expired' ) . fadeIn ( 100 );
2021-01-09 11:13:06 +00:00
} else {
2021-01-23 14:41:19 +00:00
$ ( '.expired' ) . fadeOut ( 100 );
2021-01-09 11:13:06 +00:00
}
2021-01-23 14:41:19 +00:00
});
2018-03-21 18:19:20 +00:00
2021-01-23 14:41:19 +00:00
function displayCompanies () {
2021-01-09 11:13:06 +00:00
$ ( '#organisations-grid' ) . html ( '<img class="loading" src="/wp-content/uploads/2016/12/ajax-loader.gif">' );
2018-03-21 18:19:20 +00:00
2021-01-09 11:13:06 +00:00
var settings = {
2021-01-23 14:41:19 +00:00
'action' : 'display_companies' ,
'settings_nonce' : $ ( '#settings_nonce' ) . val (),
'toplevel' : $ ( '#toplevel' ) . is ( ':checked' ),
'job' : $ ( '#jobs' ) . is ( ':checked' ),
'currentjobs' : $ ( '#currentjobs' ) . is ( ':checked' ),
'post' : $ ( '#posts' ) . is ( ':checked' ),
'website' : $ ( '#websites' ) . is ( ':checked' ),
'program' : $ ( '#programs' ) . is ( ':checked' ),
'writing' : $ ( '#writings' ) . is ( ':checked' ),
'video' : $ ( '#videos' ) . is ( ':checked' ),
'other' : $ ( '#other' ) . is ( ':checked' ),
'qualification' : $ ( '#qualifications' ) . is ( ':checked' ),
'showexpired' : $ ( '#expired' ) . is ( ':checked' ),
'award' : $ ( '#awards' ) . is ( ':checked' ),
2021-01-09 11:13:06 +00:00
};
2018-03-21 18:19:20 +00:00
2021-01-09 11:13:06 +00:00
$ . post ( " /wp-admin/admin-ajax.php " , settings , function ( response ) {
2021-01-23 14:41:19 +00:00
$ ( '#organisations-grid' ) . html ( response );
2021-01-09 11:13:06 +00:00
});
2021-01-23 14:41:19 +00:00
}
});
</ script >
2021-01-22 16:19:51 +00:00
< ? php // phpcs:disable ?>
2021-01-21 10:24:10 +00:00
</ main >
2018-03-21 18:19:20 +00:00
< ? php get_footer (); ?>