Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix/target group order #4

Merged
merged 3 commits into from
May 9, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions profiles/ulf/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# v2.5.x

## 2.5.4
* SUPPORT-1040: Added Taxonomy term view for target group on courses
* SUPPORT-1044: Changed contact form email text.

## 2.5.3
Expand Down
3 changes: 3 additions & 0 deletions profiles/ulf/modules/features/ulf_course/ulf_course.info
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ dependencies[] = field_collection
dependencies[] = field_group
dependencies[] = html5_tools
dependencies[] = image
dependencies[] = link
dependencies[] = list
dependencies[] = maxlength
dependencies[] = node
dependencies[] = number
dependencies[] = options
dependencies[] = strongarm
Expand Down Expand Up @@ -90,6 +92,7 @@ features[variable][] = node_preview_course
features[variable][] = node_submitted_course
features[variable][] = save_continue_course
features[variable][] = workbench_moderation_default_state_course
features[views_view][] = ulf_course_target_groups
features[views_view][] = ulf_node_contact
features[views_view][] = ulf_useful_info
features[views_view][] = ulf_useful_info_moderation
Expand Down
141 changes: 116 additions & 25 deletions profiles/ulf/modules/features/ulf_course/ulf_course.views_default.inc

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions profiles/ulf/themes/ulf_default/template.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ function ulf_default_preprocess_node(&$variables) {
}
}

// Add view for displaying target group sub
$variables['view__target_group_sub'] = views_embed_view('ulf_course_target_groups', 'block_1');

// Display of duration remove 0's in decimal.
if (isset($variables['content']['field_duration']['0']['#markup'])) {
$variables['stripped_duration'] = preg_replace('/,?0+$/','', $variables['content']['field_duration']['0']['#markup']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
<?php foreach ($items as $delta => $item): ?>
<?php if(count($items) != $delta + 1) : ?>
<?php print render($item) . '</br>'; ?>
<?php else : ?>
<?php print render($item); ?>
<?php else : ?>
<?php print render($item); ?>
<?php endif; ?>
<?php endforeach; ?>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,10 @@
</div>
<div class="block--field-wrapper is-inline">
<?php print render($content['field_offer_type']); ?>
<?php print render($content['field_target_group_sub']); ?>
<?php if (!empty($view__target_group_sub)) : ?>
<div class="block--field-label"><?php print t('Target group');?></div>
<div class="block--field-text"><?php print $view__target_group_sub; ?></div>
<?php endif;?>
<?php print render($content['field_count']); ?>
</div>
<?php /* If any of the fields in this wrapper contain data */ ?>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

/**
* @file
* Default simple view template to display a list of rows.
*
* @ingroup views_templates
*/
?>
<?php if (!empty($title)): ?>
<h3 class="teaser--content-header"><?php print $title; ?></h3>
<?php endif; ?>
<?php foreach ($rows as $id => $row): ?><?php print $row; ?><?php endforeach; ?>