Skip to content

Commit 8cfa1c4

Browse files
authored
Merge pull request #200 from OpenSourceOrg/feature/gh169-add-ai-wide-template__DEV
Feature/gh169 add ai wide template dev
2 parents 0e23918 + a3a9d0e commit 8cfa1c4

File tree

10 files changed

+252
-56
lines changed

10 files changed

+252
-56
lines changed

plugins/osi-features/acf-fields/group_62d0160caa7af.json

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -42,41 +42,41 @@
4242
"first_day": 1
4343
},
4444
{
45-
"key": "field_6783hdda5y544gf",
46-
"label": "Submission URL",
47-
"name": "submission_url",
48-
"aria-label": "",
49-
"type": "url",
50-
"instructions": "",
51-
"required": 0,
52-
"conditional_logic": 0,
53-
"wrapper": {
54-
"width": "",
55-
"class": "",
56-
"id": ""
57-
},
58-
"default_value": "",
59-
"placeholder": ""
45+
"key": "field_6783hdda5y544gf",
46+
"label": "Submission URL",
47+
"name": "submission_url",
48+
"aria-label": "",
49+
"type": "url",
50+
"instructions": "",
51+
"required": 0,
52+
"conditional_logic": 0,
53+
"wrapper": {
54+
"width": "",
55+
"class": "",
56+
"id": ""
57+
},
58+
"default_value": "",
59+
"placeholder": ""
6060
},
6161
{
62-
"key": "field_62fcda3b00451",
63-
"label": "Submitter",
64-
"name": "submitter",
65-
"aria-label": "",
66-
"type": "text",
67-
"instructions": "",
68-
"required": 0,
69-
"conditional_logic": 0,
70-
"wrapper": {
71-
"width": "",
72-
"class": "",
73-
"id": ""
74-
},
75-
"default_value": "",
76-
"placeholder": "",
77-
"prepend": "",
78-
"append": "",
79-
"maxlength": ""
62+
"key": "field_62fcda3b00451",
63+
"label": "Submitter",
64+
"name": "submitter",
65+
"aria-label": "",
66+
"type": "text",
67+
"instructions": "",
68+
"required": 0,
69+
"conditional_logic": 0,
70+
"wrapper": {
71+
"width": "",
72+
"class": "",
73+
"id": ""
74+
},
75+
"default_value": "",
76+
"placeholder": "",
77+
"prepend": "",
78+
"append": "",
79+
"maxlength": ""
8080
},
8181
{
8282
"key": "field_62fcd90c2f885",
@@ -224,6 +224,6 @@
224224
"hide_on_screen": "",
225225
"active": true,
226226
"description": "",
227-
"show_in_rest": 0,
228-
"modified": 1686668177
227+
"show_in_rest": 1,
228+
"modified": 1749470357
229229
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{
2+
"key": "group_ai_page_toggles",
3+
"title": "AI Page Features",
4+
"fields": [{
5+
"key": "field_use_ai_header",
6+
"label": "Use AI Header",
7+
"name": "use_ai_header",
8+
"aria-label": "",
9+
"type": "true_false",
10+
"instructions": "Enable AI-generated header for this page",
11+
"required": 0,
12+
"conditional_logic": 0,
13+
"wrapper": {
14+
"width": "",
15+
"class": "",
16+
"id": ""
17+
},
18+
"message": "",
19+
"default_value": 0,
20+
"ui": 1,
21+
"ui_on_text": "Enabled",
22+
"ui_off_text": "Disabled"
23+
},
24+
{
25+
"key": "field_use_ai_footer",
26+
"label": "Use AI Footer",
27+
"name": "use_ai_footer",
28+
"aria-label": "",
29+
"type": "true_false",
30+
"instructions": "Enable AI-generated footer for this page",
31+
"required": 0,
32+
"conditional_logic": 0,
33+
"wrapper": {
34+
"width": "",
35+
"class": "",
36+
"id": ""
37+
},
38+
"message": "",
39+
"default_value": 0,
40+
"ui": 1,
41+
"ui_on_text": "Enabled",
42+
"ui_off_text": "Disabled"
43+
}
44+
],
45+
"location": [
46+
[{
47+
"param": "post_type",
48+
"operator": "==",
49+
"value": "page"
50+
}]
51+
],
52+
"menu_order": 0,
53+
"position": "normal",
54+
"style": "default",
55+
"label_placement": "top",
56+
"instruction_placement": "label",
57+
"hide_on_screen": "",
58+
"active": true,
59+
"description": "Toggle settings for AI-generated header and footer on pages",
60+
"show_in_rest": 0,
61+
"modified": 1701234567
62+
}

themes/osi/assets/css/editor-style.css

Lines changed: 46 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

themes/osi/assets/css/editor-style.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

themes/osi/assets/scss/_8_overrides.templates.scss

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,55 @@ footer.ai-footer {
494494
.ai-def-header .wp-block-coblocks-hero__inner {
495495
height: 850px;
496496
}
497+
// Secondary Nav
498+
.ai-secondary-navbar-wrapper {
499+
background-color: #fff;
500+
border-bottom: 1px solid #ddd;
501+
padding: 10px 0;
502+
position: sticky;
503+
top: 90px; // adjust as needed
504+
z-index: 999;
505+
}
506+
.ai-secondary-nav-menu {
507+
display: flex;
508+
justify-content: center;
509+
gap: 40px;
510+
list-style: none;
511+
margin: 0;
512+
padding: 0;
513+
padding-top: 10px;
514+
font-size: 10px;
515+
li {
516+
display: inline-block;
517+
}
518+
}
519+
// Hide mobile label by default (desktop)
520+
.ai-mobile-label {
521+
display: none;
522+
}
523+
// Mobile-specific styles (not using "force override" block)
524+
@media (max-width: 768px) {
525+
.ai-secondary-mobile-wrapper {
526+
margin-top: 10px;
527+
padding-top: 0;
528+
}
529+
.ai-mobile-label {
530+
display: block;
531+
color: #bbb;
532+
font-size: 13px;
533+
text-transform: uppercase;
534+
padding: 8px 20px 4px;
535+
margin: 0;
536+
letter-spacing: 0.5px;
537+
text-align: right;
538+
}
539+
.ai-secondary-mobile-menu {
540+
margin-top: 0;
541+
li {
542+
padding: 10px 20px;
543+
}
544+
}
545+
}
497546
.jetpack-social-navigation {
498547
height: 40px;
499548
margin: 0;

themes/osi/functions.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,7 @@ function osi_handle_supporter_form_flamingo_spam_status_change( string $new_stat
573573
*/
574574
function osi_register_ai_menu() {
575575
register_nav_menu( 'ai', __( 'AI Menu', 'osi' ) );
576+
register_nav_menu( 'ai_secondary_nav', __( 'AI Secondary Navigation', 'osi' ) );
576577
}
577578
add_action( 'after_setup_theme', 'osi_register_ai_menu' );
578579

@@ -620,7 +621,7 @@ function osi_ssp_register_post_type_args( array $args ): array {
620621
*
621622
* @return boolean The result.
622623
*/
623-
function osi_block_booking_if_phone_filled( $result, $em_booking ) {
624+
function osi_block_booking_if_phone_filled( bool $result, EM_Booking $em_booking ) {
624625
if ( ! empty( $em_booking->event ) ) {
625626
if ( isset( $_POST['phone_hp'] ) && trim( $_POST['phone_hp'] ) !== '' ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
626627
$em_booking->add_error( 'There was a problem with your booking. Please do not include a phone number.' );

themes/osi/header.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,16 @@
4747
endif;
4848
//Adding for AI template - secondary navigation
4949
if ( is_page_template( 'templates/ai-wide.php' ) ) :
50-
echo '<p class="ai-mobile-label">Open Source AI</p>';
51-
wp_nav_menu( array(
52-
'theme_location' => 'ai_secondary_nav',
53-
'menu' => 'AI secondary nav',
54-
'container' => false,
55-
'container_class'=> 'ai-secondary-nav',
56-
'menu_class' => 'ai-secondary-nav-menu',
57-
) );
50+
echo '<p class="ai-mobile-label">' . esc_html__( 'Open Source AI', 'osi' ) . '</p>';
51+
wp_nav_menu(
52+
array(
53+
'theme_location' => 'ai_secondary_nav',
54+
'menu' => 'AI secondary nav',
55+
'container' => false,
56+
'container_class' => 'ai-secondary-nav',
57+
'menu_class' => 'ai-secondary-nav-menu',
58+
)
59+
);
5860
endif;
5961
?>
6062
</nav><!-- #site-navigation -->

themes/osi/style.css

Lines changed: 46 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

themes/osi/style.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

themes/osi/templates/ai-wide.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,6 @@
99
get_header( 'ai' );
1010
else :
1111
get_header();
12-
// Display the AI secondary nav menu
13-
echo '<div class="ai-secondary-navbar-wrapper">';
14-
wp_nav_menu( array(
15-
'theme_location' => 'ai_secondary_nav',
16-
'menu' => 'AI secondary nav',
17-
'container' => 'nav',
18-
'container_class'=> 'ai-secondary-nav',
19-
'menu_class' => 'ai-secondary-nav-menu',
20-
) );
21-
echo '</div>';
2212
endif;
2313
?>
2414

0 commit comments

Comments
 (0)