Skip to content
This repository has been archived by the owner on Dec 27, 2021. It is now read-only.

Commit

Permalink
Merge branch 'release/v2016.0709'
Browse files Browse the repository at this point in the history
  • Loading branch information
Sugiyama Masato committed Jul 9, 2016
2 parents fe0ed11 + 44c430b commit 46b281f
Show file tree
Hide file tree
Showing 5 changed files with 177 additions and 73 deletions.
6 changes: 6 additions & 0 deletions less/main.less
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,12 @@ a:hover {
margin-bottom: 0;
}

.list-card-date {
margin-top: 0;
margin-bottom: 0;
display: block;
}

.gmap {
position: relative;
padding-bottom: 75%;
Expand Down
139 changes: 68 additions & 71 deletions page-list-2016.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<div class="card">
<div class="card-block">
<h1 class="card-title"><?php the_title(); ?></h1>
<a class="btn btn-primary btn-sm hidden-md-up" href="<?php echo home_url( $path = '/' ); ?>sp-list-2016">小さい画面用のページはこちら</a>
</div>
<div class="table-responsive">
<table class="table table-hover table-striped">
Expand All @@ -17,79 +18,75 @@
</thead>
<tbody>
<?php
$args = array(
'meta_query' => array(
'start_date' => array(
'key' => 'startDate',
'value' => array( '2016/01/01', '2016/12/31' ),
'compare' => 'BETWEEN',
'type' => 'DATE'
),
'address' => array(
'key' => 'address',
'type' => 'CHAR',
)
),
'post_type' => 'post',
'order' => 'ASC',
'orderby' => 'address',
'nopaging' => true,
);
$posts = query_posts( $args );
$tmp = array();
foreach ( $posts as $post ) {
if ( in_array( get_field( 'schoolName' ), $tmp ) ) {
continue;
}
?>
<tr>
<td><a href="<?php echo get_permalink( $post->ID ); ?>"><?php the_field( 'schoolName' ) ?></a></td>
<td><?php the_field( 'name' ); ?></td>
<td><?php
if ( !get_field( 'startDate' ) ):
echo '';
elseif ( get_field( 'startDate' ) and !get_field( 'endDate' ) ):
the_field( 'startDate' );
elseif ( get_field( 'startDate' ) and get_field( 'endDate' ) ):
echo get_field( 'startDate' ) . '&nbsp;~&nbsp;' . get_field( 'endDate' );
else:
echo '';
endif;
?>
</td>
<td>
<?php

if ( have_rows( 'public_open' ) ):

while ( have_rows( 'public_open' ) ) : the_row();
if ( get_sub_field( 'public_open_day' ) and get_sub_field( 'public_open_start_time' ) and get_sub_field( 'public_open_end_time' ) ):
echo '<p>' . get_sub_field( 'public_open_day' ) . '&nbsp;' . get_sub_field( 'public_open_start_time' ) . '&nbsp;~&nbsp;' . get_sub_field( 'public_open_end_time' ) . '</p>';
elseif ( get_sub_field( 'public_open_day' ) ):
echo '<p>' . get_sub_field( 'public_open_day' ) . '</p>';
$args = [
'meta_query' => [
'start_date' => [
'key' => 'startDate',
'value' => [ '2016/01/01', '2016/12/31' ],
'compare' => 'BETWEEN',
'type' => 'DATE'
],
'address' => [
'key' => 'address',
'type' => 'CHAR',
]
],
'post_type' => 'post',
'order' => 'ASC',
'orderby' => 'address',
'nopaging' => true,
];
$posts = query_posts( $args );
$tmp = [ ];
foreach ( $posts as $post ) {
if ( in_array( get_field( 'schoolName' ), $tmp ) ) {
continue;
}
?>
<tr>
<td><a href="<?php echo get_permalink( $post->ID ); ?>"><?php the_field( 'schoolName' ) ?></a></td>
<td><?php the_field( 'name' ); ?></td>
<td><?php
if ( !get_field( 'startDate' ) ):
echo '';
elseif ( get_field( 'startDate' ) and !get_field( 'endDate' ) ):
the_field( 'startDate' );
elseif ( get_field( 'startDate' ) and get_field( 'endDate' ) ):
echo get_field( 'startDate' ) . '&nbsp;~&nbsp;' . get_field( 'endDate' );
else:
echo '';
endif;
?>
</td>
<td>
<?php
if ( have_rows( 'public_open' ) ):
while ( have_rows( 'public_open' ) ) : the_row();
if ( get_sub_field( 'public_open_day' ) and get_sub_field( 'public_open_start_time' ) and get_sub_field( 'public_open_end_time' ) ):
echo '<p>' . get_sub_field( 'public_open_day' ) . '&nbsp;' . get_sub_field( 'public_open_start_time' ) . '&nbsp;~&nbsp;' . get_sub_field( 'public_open_end_time' ) . '</p>';
elseif ( get_sub_field( 'public_open_day' ) ):
echo '<p>' . get_sub_field( 'public_open_day' ) . '</p>';
else:
endif;
endwhile;
elseif ( get_field( 'public_unknown' ) ):
echo '<p>不明</p>';
elseif ( get_field( 'publicStartDate' ) and get_field( 'publicEndDate' ) ):
echo '<p>' . get_field( 'publicStartDate' ) . '&nbsp;~&nbsp;' . get_field( 'publicEndDate' ) . '</p>';
elseif ( get_field( 'publicStartDate' ) and !get_field( 'publicEndDate' ) ):
echo '<p>' . get_field( 'publicStartDate' ) . '</p>';
elseif ( !get_field( 'publicStartDate' ) and !get_field( 'publicEndDate' ) ):
echo '<p>なし</p>';
else:

echo '<p>不明</p>';
endif;
endwhile;

elseif ( get_field( 'public_unknown' ) ):
echo '<p>不明</p>';
elseif ( get_field( 'publicStartDate' ) and get_field( 'publicEndDate' ) ):
echo '<p>' . get_field( 'publicStartDate' ) . '&nbsp;~&nbsp;' . get_field( 'publicEndDate' ) . '</p>';
elseif ( get_field( 'publicStartDate' ) and !get_field( 'publicEndDate' ) ):
echo '<p>' . get_field( 'publicStartDate' ) . '</p>';
elseif ( !get_field( 'publicStartDate' ) and !get_field( 'publicEndDate' ) ):
echo '<p>なし</p>';
else:
echo '<p>不明</p>';
endif;
?>
</td>
</tr>
<?php
$tmp[] = get_field( 'schoolName' );
}
wp_reset_query();
?>
</td>
</tr>
<?php
$tmp[] = get_field( 'schoolName' );
}
wp_reset_query();
?>
</tbody>
</table>
Expand Down
96 changes: 96 additions & 0 deletions page-sp-list-2016.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<?php get_header(); ?>
<div class="col-md-12">
<div>
<div class="card">
<div class="card-block">
<h1 class="card-title"><?php the_title(); ?></h1>
<?php
$args = [
'meta_query' => [
'start_date' => [
'key' => 'startDate',
'value' => [ '2016/01/01', '2016/12/31' ],
'compare' => 'BETWEEN',
'type' => 'DATE'
],
'address' => [
'key' => 'address',
'type' => 'CHAR',
]
],
'post_type' => 'post',
'order' => 'ASC',
'orderby' => 'address',
'nopaging' => true,
];
$posts = query_posts( $args );
$school_name_tmp = [ ];
?>
<?php foreach ( $posts as $post ):
if ( in_array( get_field( 'schoolName' ), $school_name_tmp ) ) {
continue;
} ?>
<div class="card-block">
<h2 class="card-text">
<a href="<?php echo get_permalink( $post->ID ); ?>"><?php the_field( 'name' ) ?></a>
</h2>
<h4 class="card-subtitle text-muted"><?php the_field( 'schoolName' ) ?></h4>
<div class="card-block">
<p class="card-text">
<span><i class="fa fa-fw fa-calendar"></i> 開催期間</span>
<?php
if ( get_field( 'startDate' ) and get_field( 'endDate' ) ): ?>
<span><?php the_field( 'startDate' ); ?>&nbsp;~&nbsp;<?php the_field( 'endDate' ); ?></span>
<?php
elseif ( get_field( 'startDate' ) and !get_field( 'endDate' ) ): ?>
<span><?php the_field( 'startDate' ); ?></span>
<?php else: ?>
<span>不明</span>
<?php
endif;
?>
</p>
<p class="card-text">
<span><i class="fa fa-fw fa-info" aria-hidden="true"></i> 一般公開</span>
<?php
if ( get_field( 'public_unknown' ) ): ?>
<span>不明</span>
<?php
else:
if ( have_rows( 'public_open' ) ):
while ( have_rows( 'public_open' ) ) :
the_row();
if ( get_sub_field( 'public_open_day' ) and get_sub_field( 'public_open_start_time' ) and get_sub_field( 'public_open_end_time' ) ):
echo '<span class="list-card-date">';
echo get_sub_field( 'public_open_day' ) . '&nbsp;' . get_sub_field( 'public_open_start_time' ) . '&nbsp;~&nbsp;' . get_sub_field( 'public_open_end_time' );
echo '</span>';
elseif ( get_sub_field( 'public_open_day' ) ): ?>
<span><?php the_sub_field( 'public_open_day' ); ?></span>
<?php
endif;
endwhile;
elseif ( get_field( 'publicStartDate' ) and get_field( 'publicEndDate' ) ):
echo '<span>';
echo get_field( 'publicStartDate' ) . '&nbsp;~&nbsp;' . get_field( 'publicEndDate' );
echo '</span>';
elseif ( get_field( 'publicStartDate' ) and !get_field( 'publicEndDate' ) ):
echo '<span>';
echo get_field( 'publicStartDate' );
echo '</span>';
elseif ( !have_rows( 'public_open' ) and !get_field( 'publicStartDate' ) and !get_field( 'publicEndDate' ) ): ?>
<span>なし</span>
<?php
endif;
echo '</p>';
endif;
$tmp[] = get_field( 'schoolName' );
?>
</div>
</div>
<?php endforeach;
wp_reset_query(); ?>
</div>
</div>
</div>
</div>
<?php get_footer(); ?>
7 changes: 6 additions & 1 deletion style.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Author: Sugiyama Masato
Author URI: http://bunkasai.nagano.jp
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Version: 2016.0708
Version: 2016.0709
---------------------------------------------------------*/
html {
position: relative;
Expand Down Expand Up @@ -99,6 +99,11 @@ a:hover {
margin-top: 0;
margin-bottom: 0;
}
.list-card-date {
margin-top: 0;
margin-bottom: 0;
display: block;
}
.gmap {
position: relative;
padding-bottom: 75%;
Expand Down
2 changes: 1 addition & 1 deletion style.less
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Author: Sugiyama Masato
Author URI: http://bunkasai.nagano.jp
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Version: 2016.0708
Version: 2016.0709
---------------------------------------------------------*/

@import "less/main.less";

0 comments on commit 46b281f

Please sign in to comment.