Skip to content

Commit

Permalink
Learning Journey
Browse files Browse the repository at this point in the history
Signed-off-by: James Hunt <[email protected]>
  • Loading branch information
thetwopct committed Aug 18, 2023
1 parent 47f1bb1 commit 7857bb7
Show file tree
Hide file tree
Showing 23 changed files with 1,033 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -336,12 +336,13 @@ public function add_header_cache() {
/**
* This is a temporary fix for the disappearing meta tags from TSF. See https://github.com/cncf/cncf.io/issues/642.
*
* @param bool $supported Input param
* @param bool $supported Input param.
*/
public function tsf_meta_temp_fix( $supported ) {
// If it's already supported, we didn't encounter the bug; circle back:
if ( $supported )
// If it's already supported, we didn't encounter the bug; circle back.
if ( $supported ) {
return $supported;
}

$tsf = tsf();

Expand Down Expand Up @@ -374,8 +375,9 @@ public function tsf_meta_temp_fix( $supported ) {
$supported = true;
}

if ( ! $supported && $tsf->is_query_exploited() )
if ( ! $supported && $tsf->is_query_exploited() ) {
$supported = true;
}

return $supported;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
{
"key": "group_64de953286db1",
"title": "Block - Learning Journey Section",
"fields": [
{
"key": "field_64dea2d8a18e9",
"label": "Section Number",
"name": "ljs_section_number",
"aria-label": "",
"type": "number",
"instructions": "",
"required": 1,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"default_value": 0,
"min": "",
"max": "",
"placeholder": "",
"step": "",
"prepend": "",
"append": ""
},
{
"key": "field_64de95327f2d7",
"label": "Title",
"name": "ljs_title",
"aria-label": "",
"type": "text",
"instructions": "",
"required": 1,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"default_value": "",
"maxlength": "",
"placeholder": "Title",
"prepend": "",
"append": ""
},
{
"key": "field_64de95f3da7d0",
"label": "Last Section?",
"name": "ljs_last_section",
"aria-label": "",
"type": "true_false",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"message": "",
"default_value": 0,
"ui": 0,
"ui_on_text": "",
"ui_off_text": ""
}
],
"location": [
[
{
"param": "block",
"operator": "==",
"value": "lf\/learning-journey-section"
}
]
],
"menu_order": 0,
"position": "normal",
"style": "default",
"label_placement": "top",
"instruction_placement": "label",
"hide_on_screen": "",
"active": true,
"description": "",
"show_in_rest": 0,
"modified": 1692364418
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"key": "group_64de963e397f7",
"title": "Block - Learning Journey Item",
"fields": [
{
"key": "field_64de963ec5c38",
"label": "Title",
"name": "lji_title",
"aria-label": "",
"type": "text",
"instructions": "",
"required": 1,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"default_value": "",
"maxlength": "",
"placeholder": "Title",
"prepend": "",
"append": ""
},
{
"key": "field_64de966dc5c39",
"label": "Link",
"name": "lji_link",
"aria-label": "",
"type": "url",
"instructions": "",
"required": 1,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"default_value": "",
"placeholder": ""
}
],
"location": [
[
{
"param": "block",
"operator": "==",
"value": "lf\/learning-journey-item"
}
]
],
"menu_order": 0,
"position": "normal",
"style": "default",
"label_placement": "top",
"instruction_placement": "label",
"hide_on_screen": "",
"active": true,
"description": "",
"show_in_rest": 0,
"modified": 1692364254
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "lf/learning-journey-item",
"title": "Learning Journey Item",
"description": "A item within the Learning Journey",
"editorScript": [],
"category": "lf",
"icon": "editor-insertmore",
"parent": ["lf/learning-journey-section"],
"keywords": [
"learning journey",
"",
""
],
"acf": {
"mode": "preview",
"renderTemplate": "learning-journey-item.php",
"postTypes": [ "page" ]
},
"supports": {
"mode": false,
"align": false,
"alignWide": false,
"alignContent": false,
"alignText": false,
"anchor": false,
"color": {
"background": true,
"gradients": false,
"link": false,
"text": false
},
"fullHeight": false,
"html": false,
"multiple": true,
"spacing": {
"margin": false,
"padding": false
},
"typography": {
"fontSize": false,
"lineHeight": false
},
"layout": true
},
"example": {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?php
/**
* Learning Journey Item Block
*
* This block was generated by create-acf-block-json.
*
* @package WordPress
*
* @param array $block The block settings and attributes.
* @param string $content The block inner HTML (empty).
* @param bool $is_preview True during AJAX preview.
* @param (int|string) $post_id The post ID this block is saved to.
*/

// Block Name (sluggified).
$block_name = 'learning-journey-item';

$namespace = 'lf';

// Create full block name to use in classes.
$block_name = 'wp-block-' . $namespace . '-' . $block_name;

// setup various classes sent through from $block.
$background = ( empty( $block['backgroundColor'] ) ) ? '' : 'has-' . $block['backgroundColor'] . '-background-color';

$has_background = $background ? 'has-background' : '';

$additional_classes = $block['className'] ?? '';

$all_classes = array(
$block_name,
$additional_classes,
);

$classes = implode( ' ', $all_classes );

$inner_block_classes = implode(
' ',
array(
$background,
$has_background,
'timeline__item',
)
);

$lji_title = get_field( 'lji_title' );
$lji_link = get_field( 'lji_link' );

?>

<div class="<?php echo esc_attr( $classes ); ?>">
<div class="<?php echo esc_attr( $inner_block_classes ); ?>">

<?php
// Hide the link when in admin to stop editors clicking accidentally.
if ( ! is_admin() ) :
?>
<a class="box-link" href="<?php echo esc_url( $lji_link ); ?>" title="<?php echo esc_attr( $lji_title ); ?>"></a>
<?php
endif;
?>
<span><?php echo esc_html( $lji_title ); ?></span>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "lf/learning-journey-navigation",
"title": "Learning Journey Navigation",
"description": "Navigation block for the Learning Journey block",
"style": "file:./learning-journey-navigation.css",
"editorStyle": "file:./editor.css",
"editorScript": [],
"category": "common",
"icon": "menu",
"keywords": [
"navigation",
"",
""
],
"acf": {
"mode": "preview",
"renderTemplate": "learning-journey-navigation.php"
},
"supports": {
"mode": false,
"align": false,
"alignWide": false,
"alignContent": false,
"alignText": false,
"anchor": true,
"className": true,
"color": {
"background": false,
"gradients": false,
"link": false,
"text": false,
"enableContrastChecker": false
},
"customClassName": false,
"defaultStylePicker": true,
"html": false,
"multiple": false,
"reusable": true,
"spacing": {
"margin": false,
"padding": false
},
"typography": {
"fontSize": false,
"lineHeight": false
}
},
"attributes": {
"variable": {
"type": "string",
"default": ""
}
},
"example": {}
}

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

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.wp-block.wp-block-lf-learning-journey-navigation {
border: 1px solid #757ba2;
padding: 1rem 0;
&:before {
content: 'Learning Journey Nav';
color: #757ba2;
position: absolute;
left: 1px;
top: 0;
line-height: 1;
font-size: 10px;
}
}

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

Loading

1 comment on commit 7857bb7

@LFCIBot
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Visit Site

Created multidev environment pr-777 for cncfci.

Please sign in to comment.