From 4b75ea244b0bafcc030b596af26856264885aedc Mon Sep 17 00:00:00 2001 From: Ben Goldsworthy Date: Sat, 9 Jan 2021 13:03:32 +0000 Subject: [PATCH 1/3] Update gitignore --- .gitignore | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/.gitignore b/.gitignore index 9792350..5a6064b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,18 +1,2 @@ *.log -wp-config.php -wp-content/advanced-cache.php -wp-content/backup-db/ -wp-content/backups/ -wp-content/blogs.dir/ -wp-content/cache/ -wp-content/upgrade/ -wp-content/uploads/ -wp-content/wp-cache-config.php -wp-content/plugins/hello.php - -/.htaccess -/license.txt -/readme.html -/sitemap.xml -/sitemap.xml.gz - +plugins/ -- 2.45.2 From f36252f56356e3718645a12cac41c32d741b3f61 Mon Sep 17 00:00:00 2001 From: Ben Goldsworthy Date: Sat, 9 Jan 2021 13:04:43 +0000 Subject: [PATCH 2/3] Add experience Page Template --- page-experience-timeline.php | 145 +++++++++++++++++++++++++++++++++++ style.css | 4 + taxonomy-company.php | 14 ++-- zzpage-experience.php | 105 ------------------------- 4 files changed, 156 insertions(+), 112 deletions(-) create mode 100644 page-experience-timeline.php delete mode 100644 zzpage-experience.php diff --git a/page-experience-timeline.php b/page-experience-timeline.php new file mode 100644 index 0000000..d44e5bc --- /dev/null +++ b/page-experience-timeline.php @@ -0,0 +1,145 @@ + + + $endDate ) ? $endDate : $jEDate ); + return ( ( ( strtotime( $jSDate ) < strtotime( $endDate ) ) && ( strtotime( $jSDate ) > strtotime( $startDate ) ) ) && ( strtotime( $jEDate ) > strtotime( $startDate ) ) ); + } + $args = array( + 'post_type' => array( + 'job', + ), + 'posts_per_page' => -1, + ); + $loop = new WP_Query( $args ); +?> + +
+
+

Experience

+

or, a brief history of Ben

+ +
+ +
+ +
+

Settings

+
+ + + +
+
+ +
+ +
+
+ + + + + +
+
+
+
+ +
+
+
+
+
+
+ + diff --git a/style.css b/style.css index 257ef60..46b0b2e 100644 --- a/style.css +++ b/style.css @@ -988,6 +988,10 @@ body > header h1 { } } +#timeline h1.timeline-entry-title { + font-size: 1.2em; +} + #comments-list-title, #comments-reply-title { font-size: 1.6em; margin-bottom: 0.5em; diff --git a/taxonomy-company.php b/taxonomy-company.php index 870c8f5..ab7170e 100644 --- a/taxonomy-company.php +++ b/taxonomy-company.php @@ -32,13 +32,13 @@ - - -
-
- - - - -- 2.45.2 From 213ea4a7afcfb373ff01a7303197e0d18b7e1147 Mon Sep 17 00:00:00 2001 From: Ben Goldsworthy Date: Sat, 9 Jan 2021 13:05:24 +0000 Subject: [PATCH 3/3] Lint --- page-experience-timeline.php | 218 +++++++++++++++++------------------ taxonomy-company.php | 2 +- 2 files changed, 110 insertions(+), 110 deletions(-) diff --git a/page-experience-timeline.php b/page-experience-timeline.php index d44e5bc..c0244ef 100644 --- a/page-experience-timeline.php +++ b/page-experience-timeline.php @@ -2,7 +2,7 @@ /* * Template Name: Experience Timeline * / - + /** * The template for displaying all single posts and attachments * @@ -13,13 +13,13 @@ get_header(); ?> $endDate ) ? $endDate : $jEDate ); - return ( ( ( strtotime( $jSDate ) < strtotime( $endDate ) ) && ( strtotime( $jSDate ) > strtotime( $startDate ) ) ) && ( strtotime( $jEDate ) > strtotime( $startDate ) ) ); - } +function withinDates( $jSDate, $jEDate ) { + $endYear = date( 'Y' ); + $endDate = $endYear . '-12-31'; + $startDate = ( $endYear - 2 ) . '-01-01'; + $jEDate = ( ! $jEDate ) ? date( 'Y-m-d' ) : ( ( $jEDate > $endDate ) ? $endDate : $jEDate ); + return ( ( ( strtotime( $jSDate ) < strtotime( $endDate ) ) && ( strtotime( $jSDate ) > strtotime( $startDate ) ) ) && ( strtotime( $jEDate ) > strtotime( $startDate ) ) ); +} $args = array( 'post_type' => array( 'job', @@ -27,118 +27,118 @@ get_header(); ?> 'posts_per_page' => -1, ); $loop = new WP_Query( $args ); -?> + ?>
-

Experience

-

or, a brief history of Ben

+

Experience

+

or, a brief history of Ben

-
- -
- -
-

Settings

-
- - - -
+ while ( have_posts() ) : + the_post(); + ?> +
+ +
+ +
+

Settings

+
+ + + +
-
- - - - + + - -
-
-
-
- -
-
-
-
+ + function drawChart() { + var container = document.getElementById('timeline'); + var chart = new google.visualization.Timeline(container); + var dataTable = new google.visualization.DataTable(); + + dataTable.addColumn({ type: 'string', id: 'Type' }); + dataTable.addColumn({ type: 'string', id: 'Role' }); + dataTable.addColumn({ type: 'string', role: 'tooltip', 'p': {'html': true} }); + dataTable.addColumn({ type: 'date', id: 'Start' }); + dataTable.addColumn({ type: 'date', id: 'End' }); + dataTable.addRows([ + have_posts() ) : + $loop->the_post(); + ?> + 'names', + ) + ); + $title = html_entity_decode( get_the_title() ); + $start = get_the_date(); + $end = ( ! get_post_meta( get_the_ID(), 'end-date', true ) ) ? date( 'c' ) : get_post_meta( get_the_ID(), 'end-date', true ); + ?> + [ + '', + '', + '

', + new Date(''), + new Date('') + ], + + ]); + + var rowHeight = 15; + var chartHeight = dataTable.getNumberOfRows() * rowHeight + 50; + var options = { + tooltip: {isHtml: true}, + timeline: { + showRowLabels: true, + }, + height: chartHeight, + width: window.innerWidth - 200, + }; + + chart.draw(dataTable, options); + } + + +
+
+
+
+ +
+
+
+
diff --git a/taxonomy-company.php b/taxonomy-company.php index ab7170e..fa46c19 100644 --- a/taxonomy-company.php +++ b/taxonomy-company.php @@ -35,7 +35,7 @@ google.charts.load('current', {'packages':['timeline']}); have_posts() ) : ?> - google.charts.setOnLoadCallback(drawChart); + google.charts.setOnLoadCallback(drawChart); function drawChart() { -- 2.45.2