Display league/season in event blocks close #36
This commit is contained in:
@@ -186,6 +186,10 @@
|
|||||||
padding: 0 20px;
|
padding: 0 20px;
|
||||||
clear: none;
|
clear: none;
|
||||||
}
|
}
|
||||||
|
.sp-event-blocks .event-league,
|
||||||
|
.sp-event-blocks .event-season {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
.sp-event-blocks .team-logo {
|
.sp-event-blocks .team-logo {
|
||||||
width: 20%;
|
width: 20%;
|
||||||
height: auto;
|
height: auto;
|
||||||
|
|||||||
@@ -432,8 +432,10 @@ jQuery(document).ready(function($){
|
|||||||
$(".sp-calendar-table tr").each(function() {
|
$(".sp-calendar-table tr").each(function() {
|
||||||
if ( layout == "list" ) {
|
if ( layout == "list" ) {
|
||||||
$(this).find("th input[type=checkbox]").show();
|
$(this).find("th input[type=checkbox]").show();
|
||||||
|
$(this).find("th select").prop("disabled", false);
|
||||||
} else {
|
} else {
|
||||||
$(this).find("th input[type=checkbox]").hide();
|
$(this).find("th input[type=checkbox]").hide();
|
||||||
|
$(this).find("th select").prop('selectedIndex', 0).prop("disabled", true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -64,6 +64,18 @@ class SP_Meta_Box_Calendar_Data {
|
|||||||
<?php _e( 'Time/Results', 'sportspress' ); ?>
|
<?php _e( 'Time/Results', 'sportspress' ); ?>
|
||||||
</label>
|
</label>
|
||||||
</th>
|
</th>
|
||||||
|
<th class="column-league">
|
||||||
|
<label for="sp_columns_league">
|
||||||
|
<input type="checkbox" name="sp_columns[]" value="league" id="sp_columns_league" <?php checked( ! is_array( $usecolumns ) || in_array( 'league', $usecolumns ) ); ?>>
|
||||||
|
<?php _e( 'League', 'sportspress' ); ?>
|
||||||
|
</label>
|
||||||
|
</th>
|
||||||
|
<th class="column-season">
|
||||||
|
<label for="sp_columns_season">
|
||||||
|
<input type="checkbox" name="sp_columns[]" value="season" id="sp_columns_season" <?php checked( ! is_array( $usecolumns ) || in_array( 'season', $usecolumns ) ); ?>>
|
||||||
|
<?php _e( 'Season', 'sportspress' ); ?>
|
||||||
|
</label>
|
||||||
|
</th>
|
||||||
<th class="column-venue">
|
<th class="column-venue">
|
||||||
<label for="sp_columns_venue">
|
<label for="sp_columns_venue">
|
||||||
<input type="checkbox" name="sp_columns[]" value="venue" id="sp_columns_venue" <?php checked( ! is_array( $usecolumns ) || in_array( 'venue', $usecolumns ) ); ?>>
|
<input type="checkbox" name="sp_columns[]" value="venue" id="sp_columns_venue" <?php checked( ! is_array( $usecolumns ) || in_array( 'venue', $usecolumns ) ); ?>>
|
||||||
@@ -136,6 +148,8 @@ class SP_Meta_Box_Calendar_Data {
|
|||||||
endif;
|
endif;
|
||||||
?>
|
?>
|
||||||
</td>
|
</td>
|
||||||
|
<td><?php the_terms( $event->ID, 'sp_league' ); ?></td>
|
||||||
|
<td><?php the_terms( $event->ID, 'sp_season' ); ?></td>
|
||||||
<td><?php the_terms( $event->ID, 'sp_venue' ); ?></td>
|
<td><?php the_terms( $event->ID, 'sp_venue' ); ?></td>
|
||||||
<td>
|
<td>
|
||||||
<a href="<?php echo get_edit_post_link( $event->ID ); ?>#sp_articlediv">
|
<a href="<?php echo get_edit_post_link( $event->ID ); ?>#sp_articlediv">
|
||||||
|
|||||||
@@ -83,7 +83,6 @@ class SP_Settings_Events extends SP_Settings_Page {
|
|||||||
),
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'title' => __( 'Player Performance', 'sportspress' ),
|
|
||||||
'desc' => __( 'Display players', 'sportspress' ),
|
'desc' => __( 'Display players', 'sportspress' ),
|
||||||
'id' => 'sportspress_event_show_players',
|
'id' => 'sportspress_event_show_players',
|
||||||
'default' => 'yes',
|
'default' => 'yes',
|
||||||
@@ -157,6 +156,23 @@ class SP_Settings_Events extends SP_Settings_Page {
|
|||||||
|
|
||||||
array( 'title' => __( 'Event Blocks', 'sportspress' ), 'type' => 'title', 'id' => 'event_blocks_options' ),
|
array( 'title' => __( 'Event Blocks', 'sportspress' ), 'type' => 'title', 'id' => 'event_blocks_options' ),
|
||||||
|
|
||||||
|
array(
|
||||||
|
'title' => __( 'Details', 'sportspress' ),
|
||||||
|
'desc' => __( 'Display league', 'sportspress' ),
|
||||||
|
'id' => 'sportspress_event_blocks_show_league',
|
||||||
|
'default' => 'no',
|
||||||
|
'type' => 'checkbox',
|
||||||
|
'checkboxgroup' => 'start',
|
||||||
|
),
|
||||||
|
|
||||||
|
array(
|
||||||
|
'desc' => __( 'Display season', 'sportspress' ),
|
||||||
|
'id' => 'sportspress_event_blocks_show_season',
|
||||||
|
'default' => 'no',
|
||||||
|
'type' => 'checkbox',
|
||||||
|
'checkboxgroup' => 'end',
|
||||||
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'title' => __( 'Pagination', 'sportspress' ),
|
'title' => __( 'Pagination', 'sportspress' ),
|
||||||
'desc' => __( 'Paginate', 'sportspress' ),
|
'desc' => __( 'Paginate', 'sportspress' ),
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @author ThemeBoy
|
* @author ThemeBoy
|
||||||
* @package SportsPress/Templates
|
* @package SportsPress/Templates
|
||||||
* @version 1.1
|
* @version 1.3
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||||
@@ -20,6 +20,8 @@ $defaults = array(
|
|||||||
'rows' => get_option( 'sportspress_event_blocks_rows', 10 ),
|
'rows' => get_option( 'sportspress_event_blocks_rows', 10 ),
|
||||||
'order' => 'default',
|
'order' => 'default',
|
||||||
'show_all_events_link' => false,
|
'show_all_events_link' => false,
|
||||||
|
'show_league' => get_option( 'sportspress_event_blocks_show_league', 'no' ) == 'yes' ? true : false,
|
||||||
|
'show_season' => get_option( 'sportspress_event_blocks_show_season', 'no' ) == 'yes' ? true : false,
|
||||||
);
|
);
|
||||||
|
|
||||||
extract( $defaults, EXTR_SKIP );
|
extract( $defaults, EXTR_SKIP );
|
||||||
@@ -89,11 +91,17 @@ if ( isset( $columns ) )
|
|||||||
<td>
|
<td>
|
||||||
<?php echo implode( $logos, ' ' ); ?>
|
<?php echo implode( $logos, ' ' ); ?>
|
||||||
<time class="event-date"><?php echo get_the_time( get_option( 'date_format' ), $event ); ?></time>
|
<time class="event-date"><?php echo get_the_time( get_option( 'date_format' ), $event ); ?></time>
|
||||||
<?php if ( $event->post_status == 'future' ): ?>
|
<?php if ( ! empty( $main_results ) ): ?>
|
||||||
<h5 class="event-time"><?php echo get_the_time( get_option( 'time_format' ), $event ); ?></h5>
|
|
||||||
<?php else: ?>
|
|
||||||
<h5 class="event-results"><?php echo implode( $main_results, ' - ' ); ?></h5>
|
<h5 class="event-results"><?php echo implode( $main_results, ' - ' ); ?></h5>
|
||||||
|
<?php else: ?>
|
||||||
|
<h5 class="event-time"><?php echo get_the_time( get_option( 'time_format' ), $event ); ?></h5>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
<?php if ( $show_league ): $leagues = get_the_terms( $event, 'sp_league' ); if ( $leagues ): $league = array_shift( $leagues ); ?>
|
||||||
|
<div class="event-league"><?php echo $league->name; ?></div>
|
||||||
|
<?php endif; endif; ?>
|
||||||
|
<?php if ( $show_season ): $seasons = get_the_terms( $event, 'sp_season' ); if ( $seasons ): $season = array_shift( $seasons ); ?>
|
||||||
|
<div class="event-season"><?php echo $season->name; ?></div>
|
||||||
|
<?php endif; endif; ?>
|
||||||
<h4 class="event-title"><a href="<?php echo get_post_permalink( $event ); ?>"><?php echo $event->post_title; ?></a></h4>
|
<h4 class="event-title"><a href="<?php echo get_post_permalink( $event ); ?>"><?php echo $event->post_title; ?></a></h4>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -70,6 +70,12 @@ endif;
|
|||||||
if ( $usecolumns == null || in_array( 'time', $usecolumns ) )
|
if ( $usecolumns == null || in_array( 'time', $usecolumns ) )
|
||||||
echo '<th class="data-time">' . __( 'Time/Results', 'sportspress' ) . '</th>';
|
echo '<th class="data-time">' . __( 'Time/Results', 'sportspress' ) . '</th>';
|
||||||
|
|
||||||
|
if ( $usecolumns == null || in_array( 'league', $usecolumns ) )
|
||||||
|
echo '<th class="data-league">' . __( 'League', 'sportspress' ) . '</th>';
|
||||||
|
|
||||||
|
if ( $usecolumns == null || in_array( 'season', $usecolumns ) )
|
||||||
|
echo '<th class="data-season">' . __( 'Season', 'sportspress' ) . '</th>';
|
||||||
|
|
||||||
if ( $usecolumns == null || in_array( 'venue', $usecolumns ) )
|
if ( $usecolumns == null || in_array( 'venue', $usecolumns ) )
|
||||||
echo '<th class="data-venue">' . __( 'Venue', 'sportspress' ) . '</th>';
|
echo '<th class="data-venue">' . __( 'Venue', 'sportspress' ) . '</th>';
|
||||||
|
|
||||||
@@ -162,6 +168,24 @@ endif;
|
|||||||
echo '</a></td>';
|
echo '</a></td>';
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
|
if ( $usecolumns == null || in_array( 'league', $usecolumns ) ):
|
||||||
|
echo '<td class="data-league">';
|
||||||
|
$leagues = get_the_terms( $event->ID, 'sp_league' );
|
||||||
|
foreach ( $leagues as $league ):
|
||||||
|
echo $league->name;
|
||||||
|
endforeach;
|
||||||
|
echo '</td>';
|
||||||
|
endif;
|
||||||
|
|
||||||
|
if ( $usecolumns == null || in_array( 'season', $usecolumns ) ):
|
||||||
|
echo '<td class="data-season">';
|
||||||
|
$seasons = get_the_terms( $event->ID, 'sp_season' );
|
||||||
|
foreach ( $seasons as $season ):
|
||||||
|
echo $season->name;
|
||||||
|
endforeach;
|
||||||
|
echo '</td>';
|
||||||
|
endif;
|
||||||
|
|
||||||
if ( $usecolumns == null || in_array( 'venue', $usecolumns ) ):
|
if ( $usecolumns == null || in_array( 'venue', $usecolumns ) ):
|
||||||
echo '<td class="data-venue">';
|
echo '<td class="data-venue">';
|
||||||
if ( $link_venues ):
|
if ( $link_venues ):
|
||||||
|
|||||||
Reference in New Issue
Block a user