Fix indentations

This commit is contained in:
Ben Goldsworthy 2021-01-23 14:41:19 +00:00
parent f650e53d9b
commit 42ba13de1b
14 changed files with 364 additions and 368 deletions

View File

@ -12,21 +12,21 @@
<?php $loop = new WP_Query( $args ); ?> <?php $loop = new WP_Query( $args ); ?>
<header class="entry-content tile location-block"> <header class="entry-content tile location-block">
<div class="post-header-title"> <div class="post-header-title">
<h1 id="page-title">Experience</h1> <h1 id="page-title">Experience</h1>
<h2 id="page-subtitle">by location</h2> <h2 id="page-subtitle">by location</h2>
<?php <?php
while ( have_posts() ) : while ( have_posts() ) :
the_post(); the_post();
?> ?>
<div class="entry-content" id="taxonomy-description"> <div class="entry-content" id="taxonomy-description">
<?php the_content(); ?> <?php the_content(); ?>
<div> <div>
<a class="hyperlink-button" href="?view=countries">Countries</a> <a class="hyperlink-button" href="?view=countries">Countries</a>
<!--<a class="hyperlink-button" href="?view=regions">Regions</a>--> <!--<a class="hyperlink-button" href="?view=regions">Regions</a>-->
<a class="hyperlink-button" href="?view=locations">Locations</a> <a class="hyperlink-button" href="?view=locations">Locations</a>
</div> </div>
</div> </div>
<?php endwhile; ?> <?php endwhile; ?>
</div> </div>
</header> </header>
@ -43,10 +43,10 @@ $terms = get_terms(
<div id="primary" class="content-area"> <div id="primary" class="content-area">
<main id="company-main" class="site-main" role="main"> <main id="company-main" class="site-main" role="main">
<div class="row"> <div class="row">
<div id="map" style="height:100vh; width:100%;"></div> <div id="map" style="height:100vh; width:100%;"></div>
</div> </div>
<?php if ( ! empty( $locations ) ) : ?> <?php if ( ! empty( $locations ) ) : ?>
<?php if ( $_GET['view'] == 'countries' ) : ?> <?php if ( $_GET['view'] == 'countries' ) : ?>
<?php <?php
$locationsSubset = array_filter( $locationsSubset = array_filter(
@ -58,24 +58,24 @@ $terms = get_terms(
?> ?>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script> <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript"> <script type="text/javascript">
google.charts.load('current', {'packages':['geochart']}); google.charts.load('current', {'packages':['geochart']});
google.charts.setOnLoadCallback(drawMap); google.charts.setOnLoadCallback(drawMap);
function drawMap() { function drawMap() {
var data = google.visualization.arrayToDataTable([ var data = google.visualization.arrayToDataTable([
['Country'], ['Country'],
<?php foreach ( (array) $locationsSubset as $term ) : ?> <?php foreach ( (array) $locationsSubset as $term ) : ?>
['<?php echo $term->description; ?>'], ['<?php echo $term->description; ?>'],
<?php endforeach; ?> <?php endforeach; ?>
]); ]);
var options = {}; var options = {};
var chart = new google.visualization.GeoChart(document.getElementById('map')); var chart = new google.visualization.GeoChart(document.getElementById('map'));
chart.draw(data, options); chart.draw(data, options);
} }
</script> </script>
<?php elseif ( $_GET['view'] == 'locations' ) : ?> <?php elseif ( $_GET['view'] == 'locations' ) : ?>
<?php <?php
$locationsSubset = array_filter( $locationsSubset = array_filter(
$locations, $locations,
function ( $t ) { function ( $t ) {
@ -84,42 +84,42 @@ $terms = get_terms(
); );
?> ?>
<script type="text/javascript"> <script type="text/javascript">
var locations = [ var locations = [
<?php foreach ( (array) $locationsSubset as $term ) : ?> <?php foreach ( (array) $locationsSubset as $term ) : ?>
{<?php echo $term->description; ?>}, {<?php echo $term->description; ?>},
<?php endforeach; ?> <?php endforeach; ?>
] ]
function initMap() { function initMap() {
var map = new google.maps.Map(document.getElementById('map'), { var map = new google.maps.Map(document.getElementById('map'), {
zoom: 3, zoom: 3,
center: {lat: 51.483462, lng: 0.0586198} center: {lat: 51.483462, lng: 0.0586198}
}); });
// Create an array of alphabetical characters used to label the markers. // Create an array of alphabetical characters used to label the markers.
var labels = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; var labels = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
// Add some markers to the map. // Add some markers to the map.
// Note: The code uses the JavaScript Array.prototype.map() method to // Note: The code uses the JavaScript Array.prototype.map() method to
// create an array of markers based on a given "locations" array. // create an array of markers based on a given "locations" array.
// The map() method here has nothing to do with the Google Maps API. // The map() method here has nothing to do with the Google Maps API.
var markers = locations.map(function(location, i) { var markers = locations.map(function(location, i) {
return new google.maps.Marker({ return new google.maps.Marker({
position: location, position: location,
label: labels[i % labels.length] label: labels[i % labels.length]
}); });
}); });
// Add a marker clusterer to manage the markers. // Add a marker clusterer to manage the markers.
var markerCluster = new MarkerClusterer(map, markers, { var markerCluster = new MarkerClusterer(map, markers, {
imagePath: 'https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m' imagePath: 'https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m'
}); });
} }
</script> </script>
<script src="https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/markerclusterer.js"></script> <script src="https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/markerclusterer.js"></script>
<script async defer src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBsMPnuCM59sC_n11CGxbpbqNY7FRUXnD0&callback=initMap"></script> <script async defer src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBsMPnuCM59sC_n11CGxbpbqNY7FRUXnD0&callback=initMap"></script>
<?php endif; ?> <?php endif; ?>
<?php endif; ?> <?php endif; ?>
</main><!-- .site-main --> </main><!-- .site-main -->
</div><!-- .content-area --> </div><!-- .content-area -->

View File

@ -23,10 +23,10 @@ get_header(); ?>
the_post(); the_post();
/** /**
* Run the loop for the search to output the results. * Run the loop for the search to output the results.
* If you want to overload this in a child theme then include a file * If you want to overload this in a child theme then include a file
* called content-search.php and that will be used instead. * called content-search.php and that will be used instead.
*/ */
get_template_part( 'template-parts/content', 'search' ); get_template_part( 'template-parts/content', 'search' );
// End the loop. // End the loop.

View File

@ -15,8 +15,8 @@ get_header(); ?>
while ( have_posts() ) : while ( have_posts() ) :
the_post(); the_post();
?> ?>
<h1><?php echo wp_kses_post( get_the_title() ); ?></h1> <h1><?php echo wp_kses_post( get_the_title() ); ?></h1>
<h2><?php the_content(); ?></h2> <h2><?php the_content(); ?></h2>
<?php endwhile; ?> <?php endwhile; ?>
</main> </main>

View File

@ -6,21 +6,21 @@
* @since Omphaloskepsis 1.0 * @since Omphaloskepsis 1.0
*/ */
/* /**
* If the current post is protected by a password and * If the current post is protected by a password and
* the visitor has not yet entered the password we will * the visitor has not yet entered the password we will
* return early without loading the comments. * return early without loading the comments.
*/ */
if ( post_password_required() ) { if ( post_password_required() ) {
return; return;
} }
?> ?>
<div id="comments" class="comments-area"> <div id="comments" class="comments-area">
<div class="row"> <div class="row">
<div class="col-7" id="comments-list"> <div class="col-7" id="comments-list">
<h3 id="comments-list-title">Replies</h3> <h3 id="comments-list-title">Replies</h3>
<?php if ( have_comments() ) : ?> <?php if ( have_comments() ) : ?>
<?php the_comments_navigation(); ?> <?php the_comments_navigation(); ?>
<ol class="comment-list"> <ol class="comment-list">
@ -36,16 +36,16 @@ if ( post_password_required() ) {
</ol><!-- .comment-list --> </ol><!-- .comment-list -->
<?php the_comments_navigation(); ?> <?php the_comments_navigation(); ?>
<?php else : ?> <?php else : ?>
<p id="no-comments">No comments yet.</p> <p id="no-comments">No comments yet.</p>
<?php endif; ?> <?php endif; ?>
<?php if ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) : ?> <?php if ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) : ?>
<p class="no-comments"><?php wp_kses_post_e( 'Comments are closed.', 'twentysixteen' ); ?></p> <p class="no-comments"><?php wp_kses_post_e( 'Comments are closed.', 'twentysixteen' ); ?></p>
<?php endif; ?> <?php endif; ?>
</div> </div>
<div class="col-5" id="comments-reply"> <div class="col-5" id="comments-reply">
<?php <?php
comment_form( comment_form(
array( array(
'title_reply_before' => '<h3 id="comments-reply-title">', 'title_reply_before' => '<h3 id="comments-reply-title">',
@ -53,6 +53,6 @@ if ( post_password_required() ) {
) )
); );
?> ?>
</div> </div>
</div> </div>
</div><!-- .comments-area --> </div><!-- .comments-area -->

View File

@ -7,10 +7,10 @@
*/ */
?> ?>
<footer id="site-footer" class="show"> <footer id="site-footer" class="show">
<p>By <a href="/">Ben</a> | <a href="https://github.com/Rumperuu/Omphaloskepsis/issues" target="_blank" rel="noopener noreferrer">Report an Issue</a> | <a href="/privacy-policy">Privacy Policy</a></p> <p>By <a href="/">Ben</a> | <a href="https://github.com/Rumperuu/Omphaloskepsis/issues" target="_blank" rel="noopener noreferrer">Report an Issue</a> | <a href="/privacy-policy">Privacy Policy</a></p>
</footer> </footer>
<script type="text/javascript"> <script type="text/javascript">
// Displays and hides the top header bar on page scroll. // Displays and hides the top header bar on page scroll.
jQuery(document).ready(function($) { jQuery(document).ready(function($) {
@ -18,32 +18,32 @@
var fromTop = $(window).scrollTop(); var fromTop = $(window).scrollTop();
$('body > header').toggleClass("show", (fromTop > 200)); $('body > header').toggleClass("show", (fromTop > 200));
}); });
$('blockquote').each(function() { $('blockquote').each(function() {
if ($(this).children('p').children().first().is('q')) { if ($(this).children('p').children().first().is('q')) {
$(this).addClass('no-first-quote'); $(this).addClass('no-first-quote');
} }
if ($(this).children('p').children().last().is('q')) { if ($(this).children('p').children().last().is('q')) {
$(this).addClass('no-last-quote'); $(this).addClass('no-last-quote');
} }
}); });
}); });
function toggleCommentary() { function toggleCommentary() {
var linkText = ["Click here to hide all commentary and leave only reportage.", "Click here to show commentary."]; var linkText = ["Click here to hide all commentary and leave only reportage.", "Click here to show commentary."];
var commentaries = document.getElementsByClassName("article__text--commentary"); var commentaries = document.getElementsByClassName("article__text--commentary");
var link = document.getElementById("toggleCommentary"); var link = document.getElementById("toggleCommentary");
for (var i = 0; i < commentaries.length; i++) { for (var i = 0; i < commentaries.length; i++) {
commentaries[i].style.display = (commentaries[i].style.display == 'none') ? 'inline' : 'none'; commentaries[i].style.display = (commentaries[i].style.display == 'none') ? 'inline' : 'none';
} }
link.innerHTML = (link.innerHTML == linkText[0]) ? linkText[1] : linkText[0]; link.innerHTML = (link.innerHTML == linkText[0]) ? linkText[1] : linkText[0];
} }
</script> </script>
<?php wp_footer(); ?> <?php wp_footer(); ?>
</body> </body>
</html> </html>

View File

@ -27,10 +27,10 @@ if ( ! function_exists( 'omphaloskepsis_setup' ) ) :
*/ */
function omphaloskepsis_setup() { function omphaloskepsis_setup() {
/* /*
* Make theme available for translation. * Make theme available for translation.
* Translations can be filed in the /languages/ directory. * Translations can be filed in the /languages/ directory.
* If you're building a theme based on Omphaloskepsis, use a find and replace * If you're building a theme based on Omphaloskepsis, use a find and replace
* to change 'omphaloskepsis' to the name of your theme in all the template files * to change 'omphaloskepsis' to the name of your theme in all the template files
*/ */
load_theme_textdomain( 'omphaloskepsis', get_template_directory() . '/languages' ); load_theme_textdomain( 'omphaloskepsis', get_template_directory() . '/languages' );
@ -38,17 +38,17 @@ if ( ! function_exists( 'omphaloskepsis_setup' ) ) :
add_theme_support( 'automatic-feed-links' ); add_theme_support( 'automatic-feed-links' );
/* /*
* Let WordPress manage the document title. * Let WordPress manage the document title.
* By adding theme support, we declare that this theme does not use a * By adding theme support, we declare that this theme does not use a
* hard-coded <title> tag in the document head, and expect WordPress to * hard-coded <title> tag in the document head, and expect WordPress to
* provide it for us. * provide it for us.
*/ */
add_theme_support( 'title-tag' ); add_theme_support( 'title-tag' );
/* /*
* Enable support for custom logo. * Enable support for custom logo.
* *
* @since Omphaloskepsis 1.2 * @since Omphaloskepsis 1.2
*/ */
add_theme_support( add_theme_support(
'custom-logo', 'custom-logo',
@ -60,9 +60,9 @@ if ( ! function_exists( 'omphaloskepsis_setup' ) ) :
); );
/* /*
* Enable support for Post Thumbnails on posts and pages. * Enable support for Post Thumbnails on posts and pages.
* *
* @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails * @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
*/ */
add_theme_support( 'post-thumbnails' ); add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size( 1200, 9999 ); set_post_thumbnail_size( 1200, 9999 );
@ -76,8 +76,8 @@ if ( ! function_exists( 'omphaloskepsis_setup' ) ) :
); );
/* /*
* Switch default core markup for search form, comment form, and comments * Switch default core markup for search form, comment form, and comments
* to output valid HTML5. * to output valid HTML5.
*/ */
add_theme_support( add_theme_support(
'html5', 'html5',
@ -91,9 +91,9 @@ if ( ! function_exists( 'omphaloskepsis_setup' ) ) :
); );
/* /*
* Enable support for Post Formats. * Enable support for Post Formats.
* *
* See: https://codex.wordpress.org/Post_Formats * See: https://codex.wordpress.org/Post_Formats
*/ */
add_theme_support( add_theme_support(
'post-formats', 'post-formats',
@ -111,8 +111,8 @@ if ( ! function_exists( 'omphaloskepsis_setup' ) ) :
); );
/* /*
* This theme styles the visual editor to resemble the theme style, * This theme styles the visual editor to resemble the theme style,
* specifically font, colors, icons, and column width. * specifically font, colors, icons, and column width.
*/ */
add_editor_style( add_editor_style(
array( array(

View File

@ -10,26 +10,26 @@
<!DOCTYPE html> <!DOCTYPE html>
<html <?php language_attributes(); ?> class="no-js"> <html <?php language_attributes(); ?> class="no-js">
<head> <head>
<meta charset="<?php bloginfo( 'charset' ); ?>"> <meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<?php $index = get_post_meta( get_the_ID(), 'Index', true ); ?> <?php $index = get_post_meta( get_the_ID(), 'Index', true ); ?>
<?php if ( ! ( is_single() && ! is_page() && $index ) ) : ?> <?php if ( ! ( is_single() && ! is_page() && $index ) ) : ?>
<meta name="robots" content="noindex"> <meta name="robots" content="noindex">
<?php endif; ?> <?php endif; ?>
<link rel="profile" href="http://gmpg.org/xfn/11"> <link rel="profile" href="http://gmpg.org/xfn/11">
<?php if ( is_singular() && pings_open( get_queried_object() ) ) : ?> <?php if ( is_singular() && pings_open( get_queried_object() ) ) : ?>
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>"> <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
<?php endif; ?> <?php endif; ?>
<?php wp_head(); ?> <?php wp_head(); ?>
<?php // phpcs:disable WordPress.WP.EnqueuedResources ?> <?php // phpcs:disable WordPress.WP.EnqueuedResources ?>
<script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js"></script> <script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js"></script>
<?php // phpcs:enable ?> <?php // phpcs:enable ?>
</head> </head>
<body <?php body_class(); ?> id="site-wrapper"> <body <?php body_class(); ?> id="site-wrapper">
<?php if ( ! is_page_template( 'centred-page.php' ) ) : ?> <?php if ( ! is_page_template( 'centred-page.php' ) ) : ?>
<header id="site-header"> <header id="site-header">
<nav id="site-header-nav"> <nav id="site-header-nav">
<div class="site-header-nav-item"><a href="/"><h1>Ben Goldsworthy</a></div> <div class="site-header-nav-item"><a href="/"><h1>Ben Goldsworthy</a></div>
<div class="site-header-nav-item"><h2>Views my own. Do try this at home.</h2></div> <div class="site-header-nav-item"><h2>Views my own. Do try this at home.</h2></div>
@ -38,5 +38,5 @@
<div class="site-header-nav-item"><a href="/portfolios">Portfolios</a></div> <div class="site-header-nav-item"><a href="/portfolios">Portfolios</a></div>
<div class="site-header-nav-item"><a href="/social-cataloguing">Social Cataloguing</a></div> <div class="site-header-nav-item"><a href="/social-cataloguing">Social Cataloguing</a></div>
</nav> </nav>
</header> </header>
<?php endif; ?> <?php endif; ?>

View File

@ -11,10 +11,10 @@
<?php get_header(); ?> <?php get_header(); ?>
<main id="list-page" class="col-10 col-m-12" role="main"> <main id="list-page" class="col-10 col-m-12" role="main">
<header> <header>
<h1>Blog.</h1> <h1>Blog.</h1>
<h2><strong>All</strong> / <a href="/category/thoughts">Thoughts</a> / <a href="/category/reports">Reports</a> / <a href="/category/reviews">Reviews</a> / <a href="/category/projects">Projects</a></h2> <h2><strong>All</strong> / <a href="/category/thoughts">Thoughts</a> / <a href="/category/reports">Reports</a> / <a href="/category/reviews">Reviews</a> / <a href="/category/projects">Projects</a></h2>
<?php <?php
echo wp_kses_post( echo wp_kses_post(
get_the_posts_pagination( get_the_posts_pagination(
array( array(
@ -26,10 +26,10 @@
) )
); );
?> ?>
</header> </header>
<section id="grid" class="row"> <section id="grid" class="row">
<?php <?php
if ( have_posts() ) : if ( have_posts() ) :
// Start the loop. // Start the loop.
while ( have_posts() ) : while ( have_posts() ) :
@ -41,28 +41,28 @@
*/ */
get_template_part( 'template-parts/content', get_post_format() ); get_template_part( 'template-parts/content', get_post_format() );
// End the loop. // End the loop.
endwhile; endwhile;
// If no content, include the "No posts found" template. // If no content, include the "No posts found" template.
else : else :
get_template_part( 'template-parts/content', 'none' ); get_template_part( 'template-parts/content', 'none' );
endif; endif;
?> ?>
</section><!-- .site-main --> </section><!-- .site-main -->
<footer> <footer>
<?php <?php
echo wp_kses_post( echo wp_kses_post(
get_the_posts_pagination( get_the_posts_pagination(
array( array(
'screen_reader_text' => ' ', 'screen_reader_text' => ' ',
'mid_size' => 20, 'mid_size' => 20,
'prev_text' => '', 'prev_text' => '',
'next_text' => '', 'next_text' => '',
)
) )
); )
?> );
</footer> ?>
</footer>
</main><!-- .content-area --> </main><!-- .content-area -->
<?php get_footer(); ?> <?php get_footer(); ?>

View File

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

View File

@ -1,9 +1,7 @@
<?php <?php
/** /**
* Template Name: Experience Timeline * Template Name: Experience Timeline
* / *
/**
* The template for displaying all roles in a timeline. * The template for displaying all roles in a timeline.
* *
* @package Omphaloskepsis * @package Omphaloskepsis
@ -13,14 +11,14 @@
get_header(); ?> get_header(); ?>
<?php <?php
/** /**
* Calculates wether a role is within the max. and min. dates * Calculates wether a role is within the max. and min. dates
* for the timeline. * for the timeline.
* *
* @param string $role_start_date The role's start date. * @param string $role_start_date The role's start date.
* @param string $role_end_date The role's end date. * @param string $role_end_date The role's end date.
* @return bool * @return bool
*/ */
function within_dates( $role_start_date, $role_end_date ) { function within_dates( $role_start_date, $role_end_date ) {
$end_year = gmdate( 'Y' ); $end_year = gmdate( 'Y' );
$end_date = $end_year . '-12-31'; $end_date = $end_year . '-12-31';
@ -37,19 +35,19 @@ function within_dates( $role_start_date, $role_end_date ) {
); );
$loop = new WP_Query( $args ); $loop = new WP_Query( $args );
?> ?>
<main id="experience-wrapper" class="content-area col-10 col-m-12"> <main id="experience-wrapper" class="content-area col-10 col-m-12">
<header class="post-header-title"> <header class="post-header-title">
<h1 id="page-title">Experience</h1> <h1 id="page-title">Experience</h1>
<h2 id="page-subtitle">or, a brief history of Ben</h2> <h2 id="page-subtitle">or, a brief history of Ben</h2>
<?php <?php
while ( have_posts() ) : while ( have_posts() ) :
the_post(); the_post();
?> ?>
<div class="entry-content tile" id="taxonomy-description"> <div class="entry-content tile" id="taxonomy-description">
<?php the_content(); ?> <?php the_content(); ?>
</div> </div>
<div class="entry-content tile" id="settings"> <div class="entry-content tile" id="settings">
<h3 style="margin-bottom: 14px;" class="subheading">Settings</h3> <h3 style="margin-bottom: 14px;" class="subheading">Settings</h3>
<form action="/experience-timeline" id="settings" method="GET"> <form action="/experience-timeline" id="settings" method="GET">
@ -57,48 +55,48 @@ function within_dates( $role_start_date, $role_end_date ) {
<label for="separate">Separate past and current roles</label> <label for="separate">Separate past and current roles</label>
<input class="ui-button ui-widget ui-corner-all" id="refresh" type="submit" value="Refresh"> <input class="ui-button ui-widget ui-corner-all" id="refresh" type="submit" value="Refresh">
</form> </form>
</div> </div>
<?php endwhile; ?> <?php endwhile; ?>
</header> </header>
<div id="primary" class="content-area"> <div id="primary" class="content-area">
<main id="company-main" class="site-main" role="main"> <main id="company-main" class="site-main" role="main">
<?php // phpcs:disable WordPress.WP.EnqueuedResources ?> <?php // phpcs:disable WordPress.WP.EnqueuedResources ?>
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"> <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 src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script> <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript"> <script type="text/javascript">
jQuery(document).ready(function($) { jQuery(document).ready(function($) {
$('input:checkbox').checkboxradio(); $('input:checkbox').checkboxradio();
$('.refresh').button(); $('.refresh').button();
google.charts.load('current', {'packages':['timeline']}); google.charts.load('current', {'packages':['timeline']});
google.charts.setOnLoadCallback(drawChart); google.charts.setOnLoadCallback(drawChart);
$('input[type="checkbox"]').change(function() { $('input[type="checkbox"]').change(function() {
alert("Feature in progress"); alert("Feature in progress");
$('#refresh').css('border-width', '5px'); $('#refresh').css('border-width', '5px');
}); });
$('#refresh').click(function(event) { $('#refresh').click(function(event) {
$(this).css('border-width', '1px'); $(this).css('border-width', '1px');
event.preventDefault(); event.preventDefault();
drawChart(); drawChart();
}); });
}); });
function drawChart() { function drawChart() {
var container = document.getElementById('timeline'); var container = document.getElementById('timeline');
var chart = new google.visualization.Timeline(container); var chart = new google.visualization.Timeline(container);
var dataTable = new google.visualization.DataTable(); var dataTable = new google.visualization.DataTable();
dataTable.addColumn({ type: 'string', id: 'Type' }); dataTable.addColumn({ type: 'string', id: 'Type' });
dataTable.addColumn({ type: 'string', id: 'Role' }); dataTable.addColumn({ type: 'string', id: 'Role' });
dataTable.addColumn({ type: 'string', role: 'tooltip', 'p': {'html': true} }); dataTable.addColumn({ type: 'string', role: 'tooltip', 'p': {'html': true} });
dataTable.addColumn({ type: 'date', id: 'Start' }); dataTable.addColumn({ type: 'date', id: 'Start' });
dataTable.addColumn({ type: 'date', id: 'End' }); dataTable.addColumn({ type: 'date', id: 'End' });
dataTable.addRows([ dataTable.addRows([
<?php <?php
while ( $loop->have_posts() ) : while ( $loop->have_posts() ) :
$loop->the_post(); $loop->the_post();
?> ?>
@ -114,46 +112,46 @@ function within_dates( $role_start_date, $role_end_date ) {
) )
); );
$role_title = htmlspecialchars_decode( strip_tags( get_the_title() ) ); $role_title = htmlspecialchars_decode( wp_strip_all_tags( get_the_title() ) );
$start = get_the_date(); $start = get_the_date();
$end = ( ! $end_date || ( $end_date && $end_date > gmdate( 'Y-m-d' ) ) ) ? gmdate( 'Y-m-d' ) : $end_date; $end = ( ! $end_date || ( $end_date && $end_date > gmdate( 'Y-m-d' ) ) ) ? gmdate( 'Y-m-d' ) : $end_date;
?> ?>
[ [
'<?php echo ( $is_current ) ? 'Current' : 'Past'; ?>', '<?php echo ( $is_current ) ? 'Current' : 'Past'; ?>',
'<?php echo esc_html( $role_title . ', ' . html_entity_decode( $company[0] ) ); ?>', '<?php echo esc_html( $role_title . ', ' . html_entity_decode( $company[0] ) ); ?>',
'<div style="padding: 20px"><h1 class="timeline-entry-title"><?php echo wp_kses_post( $role_title ); ?></h1><h2><?php echo wp_kses_post( html_entity_decode( $company[0] ) ); ?></h2><ul><li><?php echo esc_html( $start ); ?>&mdash;<?php echo esc_html( ( $is_current ) ? 'present' : $end ); ?></li></ul></div>', '<div style="padding: 20px"><h1 class="timeline-entry-title"><?php echo wp_kses_post( $role_title ); ?></h1><h2><?php echo wp_kses_post( html_entity_decode( $company[0] ) ); ?></h2><ul><li><?php echo esc_html( $start ); ?>&mdash;<?php echo esc_html( ( $is_current ) ? 'present' : $end ); ?></li></ul></div>',
new Date('<?php echo esc_attr( $start ); ?>'), new Date('<?php echo esc_attr( $start ); ?>'),
new Date('<?php echo esc_attr( $end ); ?>') new Date('<?php echo esc_attr( $end ); ?>')
], ],
<?php endwhile; ?> <?php endwhile; ?>
]); ]);
var rowHeight = 15; var rowHeight = 15;
var chartHeight = dataTable.getNumberOfRows() * rowHeight + 50; var chartHeight = dataTable.getNumberOfRows() * rowHeight + 50;
var options = { var options = {
tooltip: {isHtml: true}, tooltip: {isHtml: true},
timeline: { timeline: {
showRowLabels: true, showRowLabels: true,
}, },
height: chartHeight, height: chartHeight,
width: window.innerWidth - 200, width: window.innerWidth - 200,
}; };
chart.draw(dataTable, options); chart.draw(dataTable, options);
} }
</script> </script>
<?php // phpcs:disable ?> <?php // phpcs:disable ?>
<div id="slider-range"></div> <div id="slider-range"></div>
<section id="timeline"> <section id="timeline">
<div class="row"> <div class="row">
<div id="timeline" class="col-12"> <div id="timeline" class="col-12">
<img class="loading" src="/wp-content/uploads/2016/12/ajax-loader.gif"> <img class="loading" src="/wp-content/uploads/2016/12/ajax-loader.gif">
</div> </div>
</div> </div>
</section> </section>
</main> </main>
</div> </div>
</main> </main>
<?php // get_sidebar(); ?> <?php // get_sidebar(); ?>
<?php get_footer(); ?> <?php get_footer(); ?>

View File

@ -1,18 +1,18 @@
<?php <?php
/** /**
* The template for displaying pages. * The template for displaying pages.
* *
* @package Omphaloskepsis * @package Omphaloskepsis
* @since Omphaloskepsis 1.0 * @since Omphaloskepsis 1.0
*/ */
?> ?>
<?php get_header(); ?> <?php get_header(); ?>
<main id="split-page" role="main"> <main id="split-page" role="main">
<?php <?php
// Start the loop. // Start the loop.
while ( have_posts() ) : while ( have_posts() ) :
the_post(); the_post();
@ -24,8 +24,8 @@
comments_template(); comments_template();
} }
// End of the loop. // End of the loop.
endwhile; endwhile;
?> ?>
</main> </main>

View File

@ -1,26 +1,26 @@
<?php <?php
/** /**
* The template for the sidebar. * The template for the sidebar.
* *
* @package Omphaloskepsis * @package Omphaloskepsis
* @since Omphaloskepsis 1.0 * @since Omphaloskepsis 1.0
*/ */
?> ?>
<nav class="col-2" id="sidebar"> <nav class="col-2" id="sidebar">
<ul id="sidebar-list"> <ul id="sidebar-list">
<li <?php echo 'blog' === $wp->request ? 'class="current"' : ''; ?>> <li <?php echo 'blog' === $wp->request ? 'class="current"' : ''; ?>>
<a href="/blog">Blog</a> <a href="/blog">Blog</a>
<a href="/feed"><i class="fa fa-rss"></i></a> <a href="/feed"><i class="fa fa-rss"></i></a>
</li> </li>
<li><p>~</p></li> <li><p>~</p></li>
<li <?php echo 'website' === $wp->request ? 'class="current"' : ''; ?>><a href="/website">Websites</a></li> <li <?php echo 'website' === $wp->request ? 'class="current"' : ''; ?>><a href="/website">Websites</a></li>
<li <?php echo 'program' === $wp->request ? 'class="current"' : ''; ?>><a href="/program">Programs</a></li> <li <?php echo 'program' === $wp->request ? 'class="current"' : ''; ?>><a href="/program">Programs</a></li>
<li <?php echo 'writing' === $wp->request ? 'class="current"' : ''; ?>><a href="/writing">Writings</a></li> <li <?php echo 'writing' === $wp->request ? 'class="current"' : ''; ?>><a href="/writing">Writings</a></li>
<li <?php echo 'video' === $wp->request ? 'class="current"' : ''; ?>><a href="/video">Videos</a></li> <li <?php echo 'video' === $wp->request ? 'class="current"' : ''; ?>><a href="/video">Videos</a></li>
<li <?php echo 'other' === $wp->request ? 'class="current"' : ''; ?>><a href="/other">Other</a></li> <li <?php echo 'other' === $wp->request ? 'class="current"' : ''; ?>><a href="/other">Other</a></li>
<li><p>~</p></li> <li><p>~</p></li>
<li <?php echo 'experience' === $wp->request ? 'class="current"' : ''; ?>><a href="/experience">Experience (by organisation)</a></li> <li <?php echo 'experience' === $wp->request ? 'class="current"' : ''; ?>><a href="/experience">Experience (by organisation)</a></li>
</ul> </ul>
</nav> </nav>

View File

@ -1,18 +1,18 @@
<?php <?php
/** /**
* The template for displaying all single Pages. * The template for displaying all single Pages.
* *
* @package Omphaloskepsis * @package Omphaloskepsis
* @since Omphaloskepsis 1.0 * @since Omphaloskepsis 1.0
*/ */
?> ?>
<?php get_header(); ?> <?php get_header(); ?>
<main id="split-page" role="main"> <main id="split-page" role="main">
<?php <?php
// Start the loop. // Start the loop.
while ( have_posts() ) : while ( have_posts() ) :
the_post(); the_post();
// Include the single post content template. // Include the single post content template.
@ -23,7 +23,7 @@
comments_template(); comments_template();
} }
// End of the loop. // End of the loop.
endwhile; endwhile;
?> ?>
</main><!-- .site-main --> </main><!-- .site-main -->

View File

@ -133,7 +133,7 @@
<section id="related" class="row"> <section id="related" class="row">
<div id="parents" class="col-6 col-m-12"> <div id="parents" class="col-6 col-m-12">
<?php <?php
if ( get_queried_object()->parent != 0 ) { if ( get_queried_object()->parent !== 0 ) {
// phpcs:disable WordPress.NamingConventions.ValidHookName.UseUnderscores // phpcs:disable WordPress.NamingConventions.ValidHookName.UseUnderscores
$parents = apply_filters( $parents = apply_filters(
'taxonomy-images-get-terms', 'taxonomy-images-get-terms',
@ -181,7 +181,7 @@
// phpcs:enable // phpcs:enable
if ( count( $children ) > 0 ) : if ( count( $children ) > 0 ) :
?> ?>
<h2 class="subheading">Child<?php echo ( count( $children ) != 1 ) ? 'ren' : ''; ?></h2> <h2 class="subheading">Child<?php echo ( count( $children ) !== 1 ) ? 'ren' : ''; ?></h2>
<ul class="index"> <ul class="index">
<?php <?php
foreach ( (array) $children as $child ) : foreach ( (array) $children as $child ) :