Skip to content

Commit

Permalink
Merge pull request #2 from uriweb/release-1.0
Browse files Browse the repository at this point in the history
Release 1.0
  • Loading branch information
alexandragauss authored Mar 8, 2024
2 parents 8a47e66 + e300263 commit a1ec2bd
Show file tree
Hide file tree
Showing 15 changed files with 1,460 additions and 1,033 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.DS_Store
node_modules
work_files
.vscode
.vscode
.vendor
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# URI Careers


A plugin to display Major to Career data and information.
A tool to display URI alumni career data and information.

## Theme Details

Contributors: Brandon Fuller, Alexandra Gauss, Sarah Pucino
Tags: plugins
Requires at least: 4.0
Tested up to: 5.7
Stable tag: 0.1.0
Stable tag: 1.0.0
17 changes: 17 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "uriweb/uri-careers",
"type": "wordpress-plugin",
"description": "A tool to display URI alumni career data and information.",
"authors": [
{
"name": "URI Web Communications",
"email": "web-group@uri.edu",
"homepage": "https://github.com/uriweb"
}
],
"homepage": "https://www.uri.edu",
"license": "GPL-3.0-only",
"require": {
"php": ">=7.4"
}
}
2 changes: 1 addition & 1 deletion css/map/style.built.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion css/style.built.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 21 additions & 29 deletions inc/uri-careers-fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ function uri_careers_create_program_post_type() {
'fields' => array(
array(
'key' => 'field_64dcf64afd993',
'label' => 'Advising Link',
'label' => 'Majors Link',
'name' => 'careers_advising_link',
'aria-label' => '',
'type' => 'text',
'instructions' => 'Link to Advising page',
'instructions' => 'Link to Majors page',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
Expand All @@ -108,6 +108,25 @@ function uri_careers_create_program_post_type() {
'default_value' => '',
'placeholder' => '',
),
array(
'key' => 'field_65ce19c20fb70',
'label' => 'Career Advisor Page',
'name' => 'advisor_page',
'type' => 'text',
'instructions' => 'Link to the Career Advisor page',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
),
array(
'key' => 'field_64dd06dcfd999',
'label' => 'Industry A Name',
Expand Down Expand Up @@ -348,35 +367,8 @@ function uri_careers_create_program_post_type() {
'prepend' => '',
'append' => '',
),
array(
'key' => 'field_64e4fae53b0a2',
'label' => 'Featured Story',
'name' => 'featured_story',
'aria-label' => '',
'type' => 'wysiwyg',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'maxlength' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
),
),
'location' => array(
array(
array(
'param' => 'post_type',
'operator' => '==',
'value' => 'post',
),
),
array(
array(
'param' => 'post_type',
Expand Down
143 changes: 111 additions & 32 deletions inc/uri-careers-helpers.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?php

/**
* URI CAREERS HELPER FUNCTIONS
*
* @package uri-careers
*/

function uri_careers_render_jobs( $field ) {
$i_array = get_field( $field );
$t_array = str_getcsv( $i_array, ';' );
$arraylength = count( $t_array );
$output3 = null;
$i_array = get_field( $field );
$t_array = str_getcsv( $i_array, ';' );
$arraylength = count( $t_array );
$output3 = null;

for ( $x = 0; $x < $arraylength; $x++ ) {
$inner_array = explode( ',', $t_array[ $x ] );
Expand All @@ -22,20 +22,29 @@ function uri_careers_render_jobs( $field ) {
$sal_range = explode( '-', $value );

foreach ( $sal_range as $sal ) {
$sal1 = "$ $sal,000";
array_push( $salary_array, $sal1 );
$sal_range2 = implode( ' - ', $salary_array );
if ( substr( $sal, -1 ) == '+' ) {
$sal_trim = rtrim( $sal, '+' );
$sal1 = "$ $sal_trim,000 +";
array_push( $salary_array, $sal1 );
$sal_range2 = implode( ' - ', $salary_array );
} else {
$sal1 = "$ $sal,000";
array_push( $salary_array, $sal1 );
$sal_range2 = implode( ' - ', $salary_array );
}
}
$output2 = "<tr><td> $key </td><td> $sal_range2 </td></tr>";
}
$output3 .= $output2;
}
return $output3;
};

/**
* Build the list of skills
*/
function uri_careers_skills_list( $name_field ) {
$i_array = get_field( $name_field );
$t_array = str_getcsv( $i_array, ',' );
$t_array = str_getcsv( $i_array, ';' );
// var_dump( $t_array );
$listlength = count( $t_array );
global $output;
Expand All @@ -46,19 +55,61 @@ function uri_careers_skills_list( $name_field ) {
return $output;
}

/**
* Parse the list of skills with a pipe as delimeter
*/
function uri_careers_pipelist( $name_field ) {
$i_array = get_field( $name_field );
$t_array = str_getcsv( $i_array, ';' );
$output = implode( '&nbsp; | &nbsp;', $t_array );
echo $output;
$output = implode( '&nbsp; &nbsp; | &nbsp; &nbsp;', $t_array );
return $output;
}

/**
* Build the list of alumni data
*/
function uri_careers_render_alumni_data() {
$uri_employers = uri_careers_pipelist( 'employers' );
$uri_grad_schools = uri_careers_pipelist( 'grad_schools' );
$major = the_title( '', ' ', false );
$alumni_data = <<<head
<h2 class="bigger-header">Where Can You Find URI Graduates?</h2>
<p>Many alumni who majored in $major go on to pursue advanced degrees or careers across the globe. </p>
head;

if ( get_field( 'grad_schools' ) ) {
$alumni_data .= <<<g_school
<div class="alumni-card">
<h3>Top Graduate Schools Enrolling Our Students</h3>
<div class="pipelist">
<p>{$uri_grad_schools}</p>
</div>
</div>
g_school;
}

if ( get_field( 'employers' ) ) {
$alumni_data .= <<<employers
<div class="alumni-card">
<h3>Top Employers Hiring Our Grads</h3>
<div class="pipelist">
<p>{$uri_employers}</p>
</div>
</div>
employers;
}
return $alumni_data;
}

function uri_careers_table_template( $entry, $experienced ) {
/**
* Build the tables of data for top entry level careers
*/
function uri_careers_table_template_entry( $entry ) {
$uri_careers_render_jobs = 'uri_careers_render_jobs';
$tabledata = <<<table
<h5>Entry Level</h5>
$tabledata_entrylevel = <<<table_entry
<h3 class="job-level">Entry Level - new to the industry</h3>
<figure class="wp-block-table">
<table style="width: 60%;">
<table style="width:80%">
<thead>
<tr>
<th>Job Title</th>
Expand All @@ -68,9 +119,20 @@ function uri_careers_table_template( $entry, $experienced ) {
{$uri_careers_render_jobs($entry)}
</table>
</figure>
<h5>Experienced</h5>
table_entry;

return $tabledata_entrylevel;
}

/**
* Build the tables of data for top experiences careers
*/
function uri_careers_table_template_experienced( $experienced ) {
$uri_careers_render_jobs = 'uri_careers_render_jobs';
$tabledata_experiencedlevel = <<<table_experienced
<h3 class="job-level">Experienced - typically 10 years or more in the profession</h3>
<figure class="wp-block-table">
<table style="width:60%;">
<table style="width:80%">
<thead>
<tr>
<th>Job Title</th>
Expand All @@ -80,41 +142,58 @@ function uri_careers_table_template( $entry, $experienced ) {
{$uri_careers_render_jobs($experienced)}
</table>
</figure>
table;
table_experienced;

return $tabledata;
return $tabledata_experiencedlevel;
}


function render_skills() {
/**
* Output the list of skills
*/
function uri_careers_render_skills() {
$major = the_title( '', ' ', false );
$uri_careers_skills_list = 'uri_careers_skills_list';

$skills = <<<content
<h4>General competencies:</h4>
<div class="wp-block-columns">
<div class="skills-columns">
<p>Across all majors, employers want to hire recent graduates who have the core skills that lead to a successful career. Ask your academic advisor which courses introduce or build upon these 8 Career Readiness competencies. After that, your Career Education Specialist (CES) can help you demonstrate these acquired skills and experiences in your resume.</p>
<div class="alumni-card">
<h3>Career Readiness for all majors:</h3>
<div class="wp-block-columns">
<div class="wp-block-column">
<ul>
<li>Critical thinking</li>
<li>Communication</li>
<li>Oral and written communication</li>
<li>Teamwork</li>
<li>Leadership</li>
<li>Technology</li>
</ul>
</div>
<div class="wp-block-column">
<ul>
<li>Digital technology</li>
<li>Professionalism</li>
<li>Career & self development</li>
<li>Equity & inclusion</li>
<li>Career and self development</li>
<li>Equity and inclusion</li>
</ul>
</div>
</div>
<h4> $major specific competencies:</h4>
<ul>
{$uri_careers_skills_list('skills')}
</ul>
</div>
content;

if ( get_field( 'skills' ) ) {
$skills .= <<<spec_content
<div class="alumni-card">
<h3 id="major_specific_head"> $major skills:</h3>
<p>These skills are recommended and ranked by URI alumni with this major.</p>
<ol>
{$uri_careers_skills_list('skills')}
</ol>
</div>
</div>
spec_content;
}

return $skills;
}

46 changes: 46 additions & 0 deletions inc/uri-careers-shortcode.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php
/**
* URI CAREERS SHORTCODES
*
* @package uri-careers
*/

/**
* Create a shortcode for the toggle.
*/
function uri_careers_toggle_shortcode( $attributes ) {
// normalize attribute keys, lowercase
$attributes = array_change_key_case( (array) $attributes, CASE_LOWER );

// default attributes
$attributes = shortcode_atts(
array(
'advising_link' => null,
'careers_link' => null,
),
$attributes,
);

if ( null === $attributes['advising_link'] && null === $attributes['careers_link'] ) {
$link_careers = get_permalink();
$link_advising = get_permalink();
$button_style = array( 'disabled', 'disabled' );
}

if ( null !== $attributes['advising_link'] && null === $attributes['careers_link'] ) {
$link_careers = get_permalink();
$link_advising = $attributes['advising_link'];
$button_style = array( '', 'prominent' );
$style_class = array( 'on', 'off' );
}
if ( null !== $attributes['careers_link'] && null === $attributes['advising_link'] ) {
$link_careers = $attributes['careers_link'];
$link_advising = get_permalink();
$button_style = array( 'prominent', '' );
$style_class = array( 'off', 'on' );
}
return uri_careers_toggle( $link_careers, $link_advising, $button_style, $style_class );

}

add_shortcode( 'uri-careers-toggle', 'uri_careers_toggle_shortcode' );
Loading

0 comments on commit a1ec2bd

Please sign in to comment.