Skip to content

Commit

Permalink
Merge pull request #44 from CuBoulder/issue/tiamat-theme-628
Browse files Browse the repository at this point in the history
Adds label fields for "Department" and "Job Type" on People List Pages
  • Loading branch information
patrickbrown-io authored and web-flow committed Jan 26, 2024
2 parents 2435e9a + 9833cbd commit bc8729e
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

- ### Adds label fields for "Department" and "Job Type" on People List Pages
CuBoulder/tiamat-theme#626

Sister PR in: [tiamat-theme](https://github.com/CuBoulder/tiamat-theme/pull/636)
---

- ### CU Boulder Site Configuration v2.6.2
This update changes "Display links in the secondary menu as buttons" to "Secondary menu button display" with options for none, blue, gold, and gray. The setting only appears if "Position of the secondary menu" is set to "Above the main navigation". CuBoulder/tiamat-theme#551

Expand Down
8 changes: 5 additions & 3 deletions config/install/ucb_site_configuration.settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ article_date_format: '0'
related_articles_enabled_by_default: FALSE
related_articles_exclude_categories: []
related_articles_exclude_tags: []
people_list_filter_1_label: ''
people_list_filter_2_label: ''
people_list_filter_3_label: ''
people_list_department_label: Department
people_list_job_type_label: Job Type
people_list_filter_1_label: Filter 1
people_list_filter_2_label: Filter 2
people_list_filter_3_label: Filter 3
14 changes: 14 additions & 0 deletions src/Form/ContentTypesForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,18 @@ public function buildForm(array $form, FormStateInterface $form_state) {
'#type' => 'details',
'#title' => $this->t('People List Page'),
'#open' => TRUE,
'people_list_department_label' => [
'#type' => 'textfield',
'#title' => $this->t('Department label'),
'#default_value' => $settings->get('people_list_department_label') ?? 'Department',
'#description' => $this->t('Choose the label that will be used for "Department" on People List Pages.'),
],
'people_list_job_type_label' => [
'#type' => 'textfield',
'#title' => $this->t('Job Type label'),
'#default_value' => $settings->get('people_list_job_type_label') ?? 'Job Type',
'#description' => $this->t('Choose the label that will be used for "Job Type" on People List Pages.'),
],
'people_list_filter_1_label' => [
'#type' => 'textfield',
'#title' => $this->t('Filter 1 label'),
Expand Down Expand Up @@ -173,6 +185,8 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
->set('related_articles_enabled_by_default', $form_state->getValue('related_articles_enabled_by_default'))
->set('related_articles_exclude_categories', array_keys(array_filter($form_state->getValue('related_articles_exclude_categories'))))
->set('related_articles_exclude_tags', array_keys(array_filter($form_state->getValue('related_articles_exclude_tags'))))
->set('people_list_department_label', $form_state->getValue('people_list_department_label'))
->set('people_list_job_type_label', $form_state->getValue('people_list_job_type_label'))
->set('people_list_filter_1_label', $form_state->getValue('people_list_filter_1_label'))
->set('people_list_filter_2_label', $form_state->getValue('people_list_filter_2_label'))
->set('people_list_filter_3_label', $form_state->getValue('people_list_filter_3_label'))
Expand Down
2 changes: 2 additions & 0 deletions src/SiteConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,8 @@ public function attachArticlesConfiguration(array &$variables) {
*/
public function attachPeopleListConfiguration(array &$variables) {
$settings = $this->getSettings();
$variables['people_list_department_label'] = $settings->get('people_list_department_label') ?? 'Department';
$variables['people_list_job_type_label'] = $settings->get('people_list_job_type_label') ?? 'Job Type';
$variables['people_list_filter_1_label'] = $settings->get('people_list_filter_1_label') ?? 'Filter 1';
$variables['people_list_filter_2_label'] = $settings->get('people_list_filter_1_label') ?? 'Filter 2';
$variables['people_list_filter_3_label'] = $settings->get('people_list_filter_1_label') ?? 'Filter 3';
Expand Down
2 changes: 1 addition & 1 deletion ucb_site_configuration.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CU Boulder Site Configuration
description: 'Allows CU Boulder site administrators to configure site-specific settings.'
core_version_requirement: ^9 || ^10
type: module
version: '2.6.2'
version: '2.6.3'
package: CU Boulder
dependencies:
- block
Expand Down

0 comments on commit bc8729e

Please sign in to comment.