Skip to content
Merged
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
24 changes: 17 additions & 7 deletions content-location-2021.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,23 @@
</div>
</div><!-- end div.libraryContent -->

<div class="hours-today">
<span>Today's hours: <strong data-location-hours="<?php the_title(); ?>"></strong></span>
<?php if ( 1 === $study24 ) : ?>
| <a class="study-24-7" href="<?php echo $gStudy24Url; ?>" alt="This location contains one or more study spaces available 24 hours a day, seven days a week. Click the link for more info." title="Study 24/7">Study 24/7</a>
<?php endif; ?>
<a href="/hours" class="link-hours-all">See all hours <i class="icon-arrow-right"></i></a>
</div><!-- end div.hours-today -->
<?php if ( is_active_sidebar( 'sidebar-location-hours' ) ) { ?>
<div id="sidebar-location-hours" class="widget-area hours-today" role="complementary">
<?php dynamic_sidebar( 'sidebar-location-hours' ); ?>
<?php if ( true === $study24 ) : ?>
<a class="study-24-7" href="<?php echo esc_url( $gStudy24Url ); ?>" alt="This location contains one or more study spaces available 24 hours a day, seven days a week. Click the link for more info." title="Study 24/7">Study 24/7</a>
<?php endif; ?>
<a href="/hours" class="link-hours-all">See all hours <i class="icon-arrow-right"></i></a>
</div>
<?php } else { ?>
<div class="hours-today">
<span>Today's hours: <strong data-location-hours="<?php the_title(); ?>"></strong></span>
<?php if ( true === $study24 ) : ?>
| <a class="study-24-7" href="<?php echo esc_url( $gStudy24Url ); ?>" alt="This location contains one or more study spaces available 24 hours a day, seven days a week. Click the link for more info." title="Study 24/7">Study 24/7</a>
<?php endif; ?>
<a href="/hours" class="link-hours-all">See all hours <i class="icon-arrow-right"></i></a>
</div><!-- end div.hours-today -->
<?php } ?>
</div><!-- end div.topLeft -->
<div class="topRight">
<div class="library-image">
Expand Down
24 changes: 17 additions & 7 deletions content-location.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,23 @@
</div>
</div><!-- end div.libraryContent -->

<div class="hours-today">
<span>Today's hours: <strong data-location-hours="<?php the_title(); ?>"></strong></span>
<?php if ( $study24 == 1 ) : ?>
| <a class="study-24-7" href="<?php echo $gStudy24Url; ?>" alt="This location contains one or more study spaces available 24 hours a day, seven days a week. Click the link for more info." title="Study 24/7">Study 24/7</a>
<?php endif; ?>
<a href="/hours" class="link-hours-all">See all hours <i class="icon-arrow-right"></i></a>
</div><!-- end div.hours-today -->
<?php if ( is_active_sidebar( 'sidebar-location-hours' ) ) { ?>
<div id="sidebar-location-hours" class="widget-area hours-today" role="complementary">
<?php dynamic_sidebar( 'sidebar-location-hours' ); ?>
<?php if ( true === $study24 ) : ?>
<a class="study-24-7" href="<?php echo esc_url( $gStudy24Url ); ?>" alt="This location contains one or more study spaces available 24 hours a day, seven days a week. Click the link for more info." title="Study 24/7">Study 24/7</a>
<?php endif; ?>
<a href="/hours" class="link-hours-all">See all hours <i class="icon-arrow-right"></i></a>
</div>
<?php } else { ?>
<div class="hours-today">
<span>Today's hours: <strong data-location-hours="<?php the_title(); ?>"></strong></span>
<?php if ( true === $study24 ) : ?>
| <a class="study-24-7" href="<?php echo esc_url( $gStudy24Url ); ?>" alt="This location contains one or more study spaces available 24 hours a day, seven days a week. Click the link for more info." title="Study 24/7">Study 24/7</a>
<?php endif; ?>
<a href="/hours" class="link-hours-all">See all hours <i class="icon-arrow-right"></i></a>
</div><!-- end div.hours-today -->
<?php } ?>
</div><!-- end div.topLeft -->
<!-- </div> end div.flex-item -->
<!-- <div class="flex-item"> -->
Expand Down
10 changes: 10 additions & 0 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,16 @@ function mitlib_widgets_init() {
'after_title' => '</h2>',
) );

register_sidebar( array(
'name' => __( 'Location Hours Area', 'twentytwelve' ),
'id' => 'sidebar-location-hours',
'description' => __( 'Appears on library location pages, displaying a widget which displays the current hours for arbitrary locations. This enables a single location to display multiple sets of hours.', 'twentytwelve' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s" role="complementary">',
'after_widget' => '</aside>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );

}
add_action( 'widgets_init', 'mitlib_widgets_init' );

Expand Down
3 changes: 3 additions & 0 deletions page-hours-json.php
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,9 @@

<div class="locations-more">
<h3>Locations without hours</h3>
<!-- Building 9 -->
<h4>Building 9 book drop</h4>
<p><a href="/locations/#!building-9">Map:&nbsp; 9-Samuel Tak Lee Building</a></p>
<!-- DIRC -->
<h4><a href="/dirc">Digital Instruction Resource Center (DIRC)</a></h4>
<p><a href="/locations/#!digital-instruction-resource-center-dirc">Map:&nbsp; 14N-132</a></p>
Expand Down
2 changes: 1 addition & 1 deletion page-main-locations.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@
$pageLink = get_permalink( $pageID );
?>
<li class="location-secondary">
<?php if ( $slug === 'stata' ) : ?>
<?php if ( 'stata' === $slug || 'building-9' === $slug ) : ?>
<h3 class="name-location--secondary"><?php echo the_title() ?></h3>
<?php else : ?>
<h3 class="name-location--secondary"><a href="<?php echo $pageLink; ?>"><?php echo the_title() ?></a></h3>
Expand Down
2 changes: 1 addition & 1 deletion page-study-spaces.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
<?php endif; ?>
Show on map: <br><a href="/locations/#!<?php echo $slug; ?>"><?php echo $building ?></a><br/>
<?php if ( get_the_title() !== 'Information Intersection at Stata Center' ) : ?>
<span class="hours">Open today<br/>
<span class="hours">Today's hours:<br/>
<span data-location-hours="<?php the_title(); ?>"></span></span>
<?php
endif;
Expand Down