Style updates for records and forms
authorSteve Sutton <steve@gaslightmedia.com>
Wed, 2 Dec 2015 19:50:14 +0000 (14:50 -0500)
committerSteve Sutton <steve@gaslightmedia.com>
Wed, 2 Dec 2015 19:50:14 +0000 (14:50 -0500)
Did lot's of work on the application form styling. Adding div class
panel around sections. I used the header types as the starting point for
each section.

For the list and detail views I added the properties and categories
taxonomies.

config/settings1.php
config/settings2.php
controllers/front.php
views/front/formTemplate.php
views/front/jobDetail.php
views/front/jobList.php

index 3102a3c..390ccce 100644 (file)
@@ -103,7 +103,7 @@ $employed_before = [
     'type'  => 'radio',
     'name'  => 'employed_before',
     'label' => 'Have you ever worked for Stafford\'s?',
-    'grid' => 6,
+    'grid' => 12,
     'req'   => true,
     'opts'  => [[
         'name' => 'employed_before_yes',
@@ -118,7 +118,7 @@ $employed_which_property = [
     'type'  => 'text',
     'name'  => 'employed_which_property',
     'label' => 'Which property?',
-    'grid' => 6
+    'grid' => 12
 ];
 $can_you_preform_duties = [
     'type'  => 'radio',
@@ -328,26 +328,35 @@ $form = [
     [$fname, $lname, $mname],
     [$street, $city, $state, $zip],
     [$phone, $altPhone, $email],
+    ['type' => 'header', 'label' => ''],
     [$over_18, $us_auth],
+    ['type' => 'header', 'label' => ''],
     [$employed_before, $employed_which_property],
     ['type' => 'header', 'label' => 'POSITION YOU ARE APPLYING FOR'],
     [$position_applied_for, $referred_by],
+    ['type' => 'header', 'label' => ''],
     [$location_preference],
+    ['type' => 'header', 'label' => ''],
     [$date_available_for_work, $last_date_available_for_work],
+    ['type' => 'header', 'label' => ''],
     [$can_you_preform_duties],
     [$can_you_preform_duties_explain],
+    ['type' => 'header', 'label' => ''],
     [$ever_plead_guilty],
     [$ever_plead_guilty_explain],
     ['type' => 'header', 'label' => 'EDUCATION RECORD'],
     [$high_school_name],
     [$high_school_location, $high_school_grad_date],
 
+    ['type' => 'header', 'label' => ''],
     [$tech_school_name, $tech_school_location],
     [$tech_school_dates, $tech_school_degree],
 
+    ['type' => 'header', 'label' => ''],
     [$undergraduate_college_name, $undergraduate_college_location],
     [$undergraduate_college_dates, $undergraduate_college_degree],
 
+    ['type' => 'header', 'label' => ''],
     [$graduate_college_name, $graduate_college_location],
     [$graduate_college_dates, $graduate_college_degree],
 
index 6001d6a..18b4481 100644 (file)
@@ -92,9 +92,22 @@ for ($index = 1; $index <= $numberOfEmployers; ++$index) {
         'req'   => false
     );
 }
-
+$resume_file = [
+    'type'  => 'file',
+    'label' => 'Upload your resume',
+    'grid'  => 12
+];
+$additional_comments = [
+    'type'  => 'textarea',
+    'name'  => 'additional_comments',
+    'label' => 'Additional Comments:',
+    'grid'  => 12,
+    'req'   => false
+];
 $form = [
+    ['type' => 'header', 'label' => ''],
     [$why_do_you_want_to_work_for_staffords],
+    ['type' => 'header', 'label' => ''],
     [$emp_1_name, $emp_1_dates],
     [$emp_1_address],
     [$emp_1_city, $emp_1_state, $emp_1_zip],
@@ -103,6 +116,7 @@ $form = [
     [$emp_1_super],
     [$emp_1_reason],
 
+    ['type' => 'header', 'label' => ''],
     [$emp_2_name, $emp_2_dates],
     [$emp_2_address],
     [$emp_2_city, $emp_2_state, $emp_2_zip],
@@ -111,6 +125,7 @@ $form = [
     [$emp_2_super],
     [$emp_2_reason],
 
+    ['type' => 'header', 'label' => ''],
     [$emp_3_name, $emp_3_dates],
     [$emp_3_address],
     [$emp_3_city, $emp_3_state, $emp_3_zip],
@@ -118,6 +133,8 @@ $form = [
     [$emp_3_duties],
     [$emp_3_super],
     [$emp_3_reason],
-
+    ['type' => 'header', 'label' => ''],
+    [$resume_file],
+    ['type' => 'header', 'label' => ''],
+    [$additional_comments]
 ];
-
index 5a4c33a..a830fb6 100644 (file)
@@ -105,7 +105,6 @@ class staffords_employment_front
      *
      * @return type
      */
-
     public function load_form_settings($form_part = '')
     {
         include $this->settingDir . "/settings{$form_part}.php";
@@ -125,6 +124,7 @@ class staffords_employment_front
         $formAction = '';
         switch ($formPart) {
         case 1:
+            $endOfForms = true;
         case 2:
             if ($this->formSubmitted) {
                 $this->appId = $appId = (isset($_REQUEST['appId'])) ? filter_var($_REQUEST['appId'], FILTER_VALIDATE_INT): null;
@@ -154,7 +154,6 @@ class staffords_employment_front
             }
             break;
         default:
-            echo '<p>Part default</p>';
             unset($_SESSION['glmJobsApplication'], $_SESSION['glmJobsAppForm']);
             if ($jobId = filter_var($_REQUEST['job'], FILTER_VALIDATE_INT)) {
                 $jobData  = get_post($jobId);
@@ -427,6 +426,14 @@ class staffords_employment_front
         global $wpdb, $wp;
         $job    = get_post($job_id);
         $custom = get_post_custom($job->ID);
+        $depTax = wp_get_post_terms( $job->ID, STAFFORDS_EMP_TAX_DEPARTMENTS, 'name' );
+        foreach ($depTax as $depTerm) {
+            $deps[] = $depTerm->name;
+        }
+        $catTax = wp_get_post_terms( $job->ID, STAFFORDS_EMP_TAX_CATEGORIES, 'name' );
+        foreach ($catTax as $catTerm) {
+            $cats[] = $catTerm->name;
+        }
         $job->staffords_jobs_startdate = $custom['staffords_jobs_startdate'][0];
         $job->staffords_jobs_enddate   = $custom['staffords_jobs_enddate'][0];
         $job->staffords_jobs_contact   = $custom['staffords_jobs_contact'][0];
@@ -436,6 +443,8 @@ class staffords_employment_front
         $job->staffords_jobs_email     = $custom['staffords_jobs_email'][0];
         $job->staffords_jobs_comments  = $custom['staffords_jobs_comments'][0];
         $job->staffords_jobs_code      = $custom['staffords_jobs_code'][0];
+        $job->staffords_jobs_property  = $deps;
+        $job->staffords_jobs_category  = $cats;
         $current_url             = esc_url(add_query_arg($wp->query_string, '', home_url($wp->request)));
         $applyOnlineHref         = $current_url
                 . ((strpos($current_url, '?')) ? '&' : '?')
@@ -503,7 +512,15 @@ class staffords_employment_front
         $iterator = 1;
         foreach ($jobs as $job) {
             $custom = get_post_custom($job->ID);
-            $job->end                = false;
+            $depTax = wp_get_post_terms( $job->ID, STAFFORDS_EMP_TAX_DEPARTMENTS, 'name' );
+            foreach ($depTax as $depTerm) {
+                $deps[] = $depTerm->name;
+            }
+            $catTax = wp_get_post_terms( $job->ID, STAFFORDS_EMP_TAX_CATEGORIES, 'name' );
+            foreach ($catTax as $catTerm) {
+                $cats[] = $catTerm->name;
+            }
+            $job->end                      = false;
             $job->staffords_jobs_startdate = $custom['staffords_jobs_startdate'][0];
             $job->staffords_jobs_enddate   = $custom['staffords_jobs_enddate'][0];
             $job->staffords_jobs_contact   = $custom['staffords_jobs_contact'][0];
@@ -513,6 +530,8 @@ class staffords_employment_front
             $job->staffords_jobs_email     = $custom['staffords_jobs_email'][0];
             $job->staffords_jobs_comments  = $custom['staffords_jobs_comments'][0];
             $job->staffords_jobs_code      = $custom['staffords_jobs_code'][0];
+            $job->staffords_jobs_property  = $deps;
+            $job->staffords_jobs_category  = $cats;
             $job->href               = $current_url
                 . ((strpos($current_url, '?')) ? '&' : '?')
                 . "job=" . $job->ID;
index cd7fe1d..714b90f 100644 (file)
             <?php if (isset($jobId) && $jobId):?>
             <input type="hidden" name="job" value="<?php echo $jobId;?>">
             <?php endif;?>
-            <?php foreach($form as $row):?>
+            <?php $totalFormRows = count( $form ); $fRowCounter = 0;?>
+            <?php foreach($form as $row): // $form foreach ?>
+            <?php ++$fRowCounter;?>
             <?php if (isset($row['type']) && $row['type'] == 'header') :?>
-                <h3><?php echo $row['label'];?></h3>
+                    <?php if ( $fRowCounter != 1 ) : ?>
+                    </div>
+                    <?php endif;?>
+                    <h3><?php echo $row['label'];?></h3>
+                    <div class="panel radius">
                 <?php if (isset($row['subheader']) && $row['subheader']) {?>
                     <h4 class="subheader"><?php echo $row['subheader'];?></h4>
                 <?php }?>
                     <?php endforeach;?>
                 </div>
             <?php endif;?>
-            <?php endforeach;?>
+            <?php if ( $fRowCounter == $totalFormRows ) { ?>
+                </div>
+            <?php } ?>
+            <?php endforeach; // $form endforeach ?>
             <div class="row">
-                <div>
+                <div class="small-12 small-text-center columns">
+                    <?php if ( $endOfForms == true ) : ?>
+                    <input type="submit" class="button" value="Submit">
+                    <?php else : ?>
                     <input type="submit" class="button" value="Continue">
+                    <?php endif;?>
                 </div>
             </div>
         </form>
index 571fb15..87ff3a2 100644 (file)
@@ -1,6 +1,18 @@
 <a href="<?php echo get_permalink();?>">Back To Search</a>
 <div class="small-12 columns">
     <h2><a href="<?php echo $job->href; ?>"><?php echo $job->post_title; ?></a></h2>
+    <?php if ($job->staffords_jobs_property) : ?>
+    <div>
+    <?php echo (count( $job->staffords_jobs_property ) > 1 ) ? 'Properties:' : 'Property:' ?>
+    <?php echo implode(', ', $job->staffords_jobs_property);?>
+    </div>
+    <?php endif; ?>
+    <?php if ($job->staffords_jobs_category) : ?>
+    <div>
+    <?php echo (count( $job->staffords_jobs_category ) > 1 ) ? 'Categories:' : 'Category:' ?>
+    <?php echo implode(', ', $job->staffords_jobs_category);?>
+    </div>
+    <?php endif; ?>
     <?php if ($job->staffords_jobs_status):?>
     <div><strong>Status: </strong><?php echo $job->staffords_jobs_status; ?></div>
     <?php endif;?>
index cd9f7e4..2ff3194 100644 (file)
@@ -1,13 +1,20 @@
 <div>
-    <!-- <h1>List Jobs</h1> -->
     <div class="row">
         <?php if ($jobs): foreach($jobs as $job) :?>
-        <div class="small-12 medium-6 columns<?php if ($job->end){ echo ' end';}?>">
+        <div class="small-12 columns<?php if ($job->end){ echo ' end';}?>">
             <h2><a href="<?php echo $job->href;?>"><?php echo $job->post_title;?></a></h2>
-            <?php if  ( $job->staffords_jobs_status ) :?>
-            <div><strong>Status: </strong><?php echo $job->staffords_jobs_status;?></div>
-            <?php endif;?>
-            <!-- <div><a href="<?php echo $job->href;?>">Full Job Description</a></div> -->
+            <?php if ($job->staffords_jobs_property) : ?>
+            <div>
+            <?php echo (count( $job->staffords_jobs_property ) > 1 ) ? 'Properties:' : 'Property:' ?>
+            <?php echo implode(', ', $job->staffords_jobs_property);?>
+            </div>
+            <?php endif; ?>
+            <?php if ($job->staffords_jobs_category) : ?>
+            <div>
+            <?php echo (count( $job->staffords_jobs_category ) > 1 ) ? 'Categories:' : 'Category:' ?>
+            <?php echo implode(', ', $job->staffords_jobs_category);?>
+            </div>
+            <?php endif; ?>
         </div>
         <?php endforeach; endif;?>
     </div>