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

User Day Update. #21

Open
wants to merge 6 commits into
base: feat/user-day
Choose a base branch
from
Open
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,937 changes: 1,035 additions & 902 deletions pingcap-jp/acf/acf-user-day.php

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion pingcap-jp/bootstrap/shortcodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,10 @@
});

add_shortcode('user_day_btn_anc', function () {
return '<a href="#entry" class="a-button is-content-fit is-design-square is-type-grd-primary tw-font-bold js-scroll"><span class="a-button_inner "><span class="a-button_text">イベントの参加申込はこちら</span><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" class="style-svg"><rect width="20" height="20" style="fill:none;"></rect><path d="M8.74,13.34l-2.6-2.6c-.5-.5-1.3-.5-1.8,0s-.5,1.3,0,1.7h0l4.7,4.7c.3,.3,.7,.4,1,.4s.7-.1,.9-.4l4.7-4.7c.2-.2,.4-.5,.4-.9,0-.3-.1-.6-.4-.9-.2-.2-.6-.4-.9-.4s-.7,.1-.9,.4l-2.6,2.6V3.74c0-.3-.1-.6-.4-.9-.5-.5-1.3-.5-1.8,0-.1,.3-.3,.6-.3,.9V13.34h0Z" style="fill:#fff;"></path></svg></span></a>';
global $post;
$_link_name = "参加申込";
if( $post && isset($post->ID) && $post->ID ){
$_link_name = get_field("user_day_section_cta_title");
}
return '<a href="#entry" class="a-button is-content-fit is-design-square is-type-grd-primary tw-font-bold js-scroll"><span class="a-button_inner "><span class="a-button_text">'.$_link_name.'はこちら</span><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" class="style-svg"><rect width="20" height="20" style="fill:none;"></rect><path d="M8.74,13.34l-2.6-2.6c-.5-.5-1.3-.5-1.8,0s-.5,1.3,0,1.7h0l4.7,4.7c.3,.3,.7,.4,1,.4s.7-.1,.9-.4l4.7-4.7c.2-.2,.4-.5,.4-.9,0-.3-.1-.6-.4-.9-.2-.2-.6-.4-.9-.4s-.7,.1-.9,.4l-2.6,2.6V3.74c0-.3-.1-.6-.4-.9-.5-.5-1.3-.5-1.8,0-.1,.3-.3,.6-.3,.9V13.34h0Z" style="fill:#fff;"></path></svg></span></a>';
});
5 changes: 1 addition & 4 deletions pingcap-jp/header.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

use PingCAP\{Components, Constants};

?>
<!doctype html>
<html <?php language_attributes(); ?>>
Expand All @@ -13,7 +11,6 @@
if (!defined('IGNORE_USER_SCRIPTS') || !constant('IGNORE_USER_SCRIPTS')) {
the_field(Constants\ACF::THEME_OPTIONS_SCRIPTS_BASE . '_global_head_top_content', 'option', false);
}

?>
<title><?php wp_title('&bull;'); ?></title>
<meta charset="<?php bloginfo('charset'); ?>">
Expand All @@ -35,7 +32,7 @@
<script src="<?php echo esc_url(get_template_directory_uri()); ?>/tidb-user-day/assets/js/main.js" defer></script>
<?php } ?>

<?php if (is_page_template('templates/page-user-day.php')) { ?>
<?php if ( get_post_meta($post->ID, 'flg_user_day', true) ) { ?>
<link rel="stylesheet" href="<?php echo esc_url(get_template_directory_uri()); ?>/userday/css/userday.css">
<script src="<?php echo esc_url(get_template_directory_uri()); ?>/userday/js/userday.js" defer></script>
<?php } ?>
Expand Down
1 change: 1 addition & 0 deletions pingcap-jp/inc/PingCAP/Constants/Taxonomies.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ abstract class Taxonomies
const CUSTOMER = 'customer';
const LOCATION = 'location';
const REGION = 'region';
const USERDAY = 'userdaytag';
}
34 changes: 34 additions & 0 deletions pingcap-jp/taxonomies/userday.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php
use PingCAP\Constants;

$single_label = 'New Event Tag';
$plural_label = 'New Event Tag';
$slug = Constants\Taxonomies::USERDAY;

register_taxonomy(
$slug,
[Constants\CPT::EVENT, 'page'],
[
'hierarchical' => true,
'public' => true,
'show_ui' => true,
'show_in_quick_edit' => true,
'show_admin_column' => true,
'show_in_nav_menus' => true,
'show_in_rest' => true,
'query_var' => true,
"rest_controller_class" => "WP_REST_Terms_Controller",
'labels' => [
'name' => $plural_label,
'singular_name' => $single_label,
'search_items' => 'Search ' . $plural_label,
'all_items' => 'All ' . $plural_label,
'parent_item' => 'Parent ' . $single_label,
'parent_item_colon' => 'Parent ' . $single_label . ':',
'edit_item' => 'Edit ' . $single_label,
'update_item' => 'Update ' . $single_label,
'add_new_item' => 'Add New ' . $single_label,
'new_item_name' => 'New ' . $single_label . ' Name'
]
]
);
1,031 changes: 0 additions & 1,031 deletions pingcap-jp/templates/page-tidb-user-day-in-person.php

This file was deleted.

1,004 changes: 0 additions & 1,004 deletions pingcap-jp/templates/page-tidb-user-day.php

This file was deleted.

102 changes: 67 additions & 35 deletions pingcap-jp/templates/page-user-day.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,42 @@
<?php

/**
* Template Name: User Day
* Template Name: New Event Template
*/

use WPUtil\{Vendor};
use PingCAP\Constants;

get_header();

?>
<?php if ($_mv = get_field("user_day_section_mv")) : ?>
<style>
<?php
$_image = "";
if( isset($_mv["sp"]) && $_mv["sp"] ){
$_image = wp_get_attachment_image_src( $_mv["sp"] , "full");
}
if( $_image ):
?>
.p-hero {
background: url(<?php echo $_image[0] ?>) no-repeat 50%/cover;
}
<?php endif; ?>
<?php
$_image = "";
if( isset($_mv["pc"]) && $_mv["pc"] ){
$_image = wp_get_attachment_image_src( $_mv["pc"] , "full");
}
if( $_image ):
?>
@media (min-width: 750px) {
.p-hero {
background:url(<?php echo $_image[0] ?>) no-repeat 50%/auto;
}
}
<?php endif; ?>
</style>
<?php endif; ?>
<main class="tmpl-page">
<div class="tidb-user-day-html">
<section class="l-section">
Expand Down Expand Up @@ -113,7 +141,7 @@
<div class="tw-flex tw-justify-center tw-gap-3 tw-px-8 md:tw-px-0">
<a href="#entry" class="a-button is-content-fit is-design-square is-type-grd-primary tw-font-bold js-scroll">
<span class="a-button_inner ">
<span class="a-button_text">イベントの参加申込はこちら</span><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
<span class="a-button_text"><?php echo get_field("user_day_section_cta_title") ? get_field("user_day_section_cta_title") : "参加申込" ;?>はこちら</span><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
<rect width="20" height="20" style="fill:none;" />
<path d="M8.74,13.34l-2.6-2.6c-.5-.5-1.3-.5-1.8,0s-.5,1.3,0,1.7h0l4.7,4.7c.3,.3,.7,.4,1,.4s.7-.1,.9-.4l4.7-4.7c.2-.2,.4-.5,.4-.9,0-.3-.1-.6-.4-.9-.2-.2-.6-.4-.9-.4s-.7,.1-.9,.4l-2.6,2.6V3.74c0-.3-.1-.6-.4-.9-.5-.5-1.3-.5-1.8,0-.1,.3-.3,.6-.3,.9V13.34h0Z" style="fill:#fff;" />
</svg>
Expand All @@ -134,26 +162,24 @@
<span class="a-heading_text-one tw-text-white tw-text-[3rem] md:tw-text-[4.2rem] tw-font-bold tw-text-center tw-leading-snug">タイムテーブル</span>
</h2>
</div>
<?php if ($_room) : ?>
<div class="l-inner tw-mt-[4rem]">
<div class="p-timetable-anchor">
<ul class="p-timetable-anchor_list">
<?php while (have_rows("user_day_section_room")) : the_row(); ?>
<li>
<a href="#day_<?php echo get_row_index(); ?>" class="a-button is-left is-design-square is-type-solid-white tw-font-bold js-scroll">
<span class="a-button_inner ">
<span class="a-button_text"><?php echo get_sub_field("name"); ?></span><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
<rect width="20" height="20" style="fill:none;" />
<path d="M8.74,13.34l-2.6-2.6c-.5-.5-1.3-.5-1.8,0s-.5,1.3,0,1.7h0l4.7,4.7c.3,.3,.7,.4,1,.4s.7-.1,.9-.4l4.7-4.7c.2-.2,.4-.5,.4-.9,0-.3-.1-.6-.4-.9-.2-.2-.6-.4-.9-.4s-.7,.1-.9,.4l-2.6,2.6V3.74c0-.3-.1-.6-.4-.9-.5-.5-1.3-.5-1.8,0-.1,.3-.3,.6-.3,.9V13.34h0Z" />
</svg>
</span>
</a>
</li>
<?php endwhile; ?>
</ul>
</div>
<div class="l-inner tw-mt-[4rem]">
<div class="p-timetable-anchor">
<ul class="p-timetable-anchor_list">
<?php while (have_rows("user_day_section_room")) : the_row(); ?>
<li>
<a href="#day_<?php echo get_row_index(); ?>" class="a-button is-left is-design-square is-type-solid-white tw-font-bold js-scroll">
<span class="a-button_inner ">
<span class="a-button_text"><?php echo get_sub_field("name"); ?></span><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
<rect width="20" height="20" style="fill:none;" />
<path d="M8.74,13.34l-2.6-2.6c-.5-.5-1.3-.5-1.8,0s-.5,1.3,0,1.7h0l4.7,4.7c.3,.3,.7,.4,1,.4s.7-.1,.9-.4l4.7-4.7c.2-.2,.4-.5,.4-.9,0-.3-.1-.6-.4-.9-.2-.2-.6-.4-.9-.4s-.7,.1-.9,.4l-2.6,2.6V3.74c0-.3-.1-.6-.4-.9-.5-.5-1.3-.5-1.8,0-.1,.3-.3,.6-.3,.9V13.34h0Z" />
</svg>
</span>
</a>
</li>
<?php endwhile; ?>
</ul>
</div>
<?php endif; ?>
</div>
<?php
$_all_terms = array();
if (have_rows("user_day_section_room")) {
Expand All @@ -163,7 +189,7 @@
while (have_rows("program")) {
the_row();
foreach (get_sub_field("tags") as $tag_id) {
$term = get_term($tag_id, "userdaytag");
$term = get_term($tag_id, Constants\Taxonomies::USERDAY);
$_all_terms[$term->term_id] = $term;
}
}
Expand Down Expand Up @@ -216,7 +242,7 @@
<?php if (get_sub_field("tags")) : ?>
<ul class="p-timetable-item_tags tw-mt-2">
<?php foreach (get_sub_field("tags") as $tag_id) : ?>
<?php $term = get_term($tag_id, "userdaytag"); ?>
<?php $term = get_term($tag_id, Constants\Taxonomies::USERDAY); ?>
<li data-tags="<?php echo $term->term_id; ?>">
<span><?php echo $term->name; ?></span>
</li>
Expand Down Expand Up @@ -282,7 +308,13 @@
</a>
</li>
<?php elseif (isset($link["type"]) && $link["type"] == "movie") : ?>

<li>
<a href="<?php echo $link["url"] ? $link["url"] : "#" ; ?>" class="a-button is-border is-content-fit js--trigger-video-modal is-design-square is-type-grd-secondary<?php echo $link["url"] ? "" : " is-disabled" ; ?>">
<span class="a-button_inner ">
<span class="a-button_text"><?php echo $link["text"] ? $link["text"] : $link["url"] ; ?></span>
</span>
</a>
</li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
Expand All @@ -306,7 +338,7 @@
<div class="tw-flex tw-justify-center tw-gap-3 tw-px-8 md:tw-px-0">
<a href="#entry" class="a-button is-content-fit is-design-square is-type-grd-primary tw-font-bold js-scroll">
<span class="a-button_inner ">
<span class="a-button_text">イベントの参加申込はこちら</span><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
<span class="a-button_text"><?php echo get_field("user_day_section_cta_title") ? get_field("user_day_section_cta_title") : "参加申込" ;?>はこちら</span><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
<rect width="20" height="20" style="fill:none;" />
<path d="M8.74,13.34l-2.6-2.6c-.5-.5-1.3-.5-1.8,0s-.5,1.3,0,1.7h0l4.7,4.7c.3,.3,.7,.4,1,.4s.7-.1,.9-.4l4.7-4.7c.2-.2,.4-.5,.4-.9,0-.3-.1-.6-.4-.9-.2-.2-.6-.4-.9-.4s-.7,.1-.9,.4l-2.6,2.6V3.74c0-.3-.1-.6-.4-.9-.5-.5-1.3-.5-1.8,0-.1,.3-.3,.6-.3,.9V13.34h0Z" style="fill:#fff;" />
</svg>
Expand All @@ -320,13 +352,13 @@
</section>
<!-- section -->
<?php endif; ?>
<?php if ($_company = get_field("user_day_section_company")) : ?>
<?php if ($_company = get_field("user_day_section_company") && get_field("user_day_section_company_title") ) : ?>
<section class="l-section tw-py-[4.2rem] md:tw-py-[8rem] tw-bg-white" id="partner">
<div class="l-wrap">
<div class="l-content is-w-1172">
<div class="l-inner">
<h2 class="a-heading ">
<span class="a-heading_text-one tw-text-center tw-text-[3rem] md:tw-text-[4.2rem] tw-leading-normal">登壇企業</span>
<span class="a-heading_text-one tw-text-center tw-text-[3rem] md:tw-text-[4.2rem] tw-leading-normal"><?php echo get_field("user_day_section_company_title"); ?></span>
</h2>
</div>
<?php if (get_field("user_day_section_company_pc") || get_field("user_day_section_company_sp")) : ?>
Expand All @@ -337,7 +369,7 @@
<picture>
<source media="(min-width: 751px)" srcset="<?php echo $_pc[0]; ?>" width="<?php echo $_pc[1]; ?>" height="<?php echo $_pc[2]; ?>">
<source media="(max-width: 750px)" srcset="<?php echo $_sp[0]; ?>" width="<?php echo $_sp[1]; ?>" height="<?php echo $_sp[2]; ?>">
<img src="<?php echo $_pc[0]; ?>" class="" width="<?php echo $_pc[1]; ?>" height="<?php echo $_pc[2]; ?>" alt="登壇企業" loading="lazy" decoding="async">
<img src="<?php echo $_pc[0]; ?>" class="" width="<?php echo $_pc[1]; ?>" height="<?php echo $_pc[2]; ?>" alt="<?php echo get_field("user_day_section_company_title"); ?>" loading="lazy" decoding="async">
</picture>
</div>
</div>
Expand Down Expand Up @@ -391,10 +423,10 @@
</a>
</li>
<?php endif; ?>
<?php if (get_field("user_day_section_company_pc") || get_field("user_day_section_company_sp")) : ?>
<?php if (get_field("user_day_section_company_title") ) : ?>
<li>
<a href="#partner" class="p-fixed-nav-pc_link js-scroll">
登壇企業
<?php echo get_field("user_day_section_company_title"); ?>
</a>
</li>
<?php endif; ?>
Expand All @@ -419,7 +451,7 @@
<path stroke="#fff" fill="transparent" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 1v2m0 4v2m0 4v2M3 1h14a2 2 0 0 1 2 2v3a2 2 0 0 0 0 4v3a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2v-3a2 2 0 1 0 0-4V3a2 2 0 0 1 2-2Z" />
</svg>
<span class="a-button_inner ">
<span class="a-button_text">参加申込</span>
<span class="a-button_text"><?php echo get_field("user_day_section_cta_title") ? get_field("user_day_section_cta_title") : "参加申込" ;?></span>
</span>
</a>
</li>
Expand All @@ -445,7 +477,7 @@
<path stroke="#fff" fill="transparent" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 1v2m0 4v2m0 4v2M3 1h14a2 2 0 0 1 2 2v3a2 2 0 0 0 0 4v3a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2v-3a2 2 0 1 0 0-4V3a2 2 0 0 1 2-2Z" />
</svg>
<span class="a-button_inner ">
<span class="a-button_text">参加申込</span>
<span class="a-button_text"><?php echo get_field("user_day_section_cta_title") ? get_field("user_day_section_cta_title") : "参加申込" ;?></span>
</span>
</a>
</div>
Expand Down Expand Up @@ -479,10 +511,10 @@
</a>
</li>
<?php endif; ?>
<?php if (get_field("user_day_section_company_pc") || get_field("user_day_section_company_sp")) : ?>
<?php if (get_field("user_day_section_company_title")) : ?>
<li>
<a href="#partner" class="p-modal-nav_link js-modal__close">
登壇企業
<?php echo get_field("user_day_section_company_title"); ?>
</a>
</li>
<?php endif; ?>
Expand Down
2 changes: 1 addition & 1 deletion pingcap-jp/userday/css/userday.css

Large diffs are not rendered by default.