fictioneer/partials/_story-footer.php

68 lines
2.2 KiB
PHP
Raw Normal View History

2023-01-21 01:31:34 +01:00
<?php
/**
* Partial: Story Footer
*
* Rendered in the single-fcn_story.php template below the content section with
* chapters, blog posts, and custom pages if any. The last block inside the
* <article> block.
*
* @package WordPress
* @subpackage Fictioneer
* @since 4.7
* @see single-fcn_story.php
*
* @internal $args['story_data'] Story data from fictioneer_get_story_data().
* @internal $args['story_id'] Current story and post ID.
*/
?>
<?php
// Only render to bottom padding if behind a password
if ( post_password_required() ) {
// Start HTML ---> ?>
<footer class="padding-bottom"></footer>
<?php // <--- End HTML
return;
}
// Setup
$story_id = $args['story_id'];
$story = $args['story_data'];
?>
<footer class="story__footer padding-left padding-right">
<div class="story__meta truncate _1-1">
2023-01-21 01:31:34 +01:00
<span class="story__status">
<i class="<?php echo $story['icon']; ?>"></i>
2023-06-04 02:50:47 +02:00
<?php echo $story['status']; ?>
2023-01-21 01:31:34 +01:00
</span>
<span class="story__date _published" title="<?php esc_attr_e( 'Publishing Date', 'fictioneer' ) ?>">
<i class="fa-solid fa-clock"></i>
<span class="hide-below-480"><?php the_time( get_option( 'date_format' ) ); ?></span>
2023-05-07 18:03:29 +02:00
<span class="show-below-480"><?php the_time( get_option( 'fictioneer_subitem_date_format', "M j, 'y" ) ?: "M j, 'y" ); ?></span>
2023-01-21 01:31:34 +01:00
</span>
<span class="story__words" title="<?php esc_attr_e( 'Total Words', 'fictioneer' ) ?>">
<i class="fa-solid fa-font"></i>
2023-06-04 02:50:47 +02:00
<?php echo $story['word_count_short']; ?>
2023-01-21 01:31:34 +01:00
</span>
<span class="story__rating" title="<?php esc_attr_e( 'Rating', 'fictioneer' ) ?>">
<i class="fa-solid fa-exclamation-circle"></i>
<?php echo $story['rating']; ?>
</span>
<?php if ( $story['chapter_count'] > 0 ): ?>
2023-01-24 21:07:11 +01:00
<button
class="checkmark story__meta-checkmark"
data-type="story"
data-story-id="<?php echo $story_id; ?>"
data-id="<?php echo $story_id; ?>"
data-status="<?php echo esc_attr( $story['status'] ); ?>"
role="checkbox"
aria-checked="false"
aria-label="<?php printf( esc_attr__( 'Story checkmark for %s.', 'fictioneer' ), $story['title'] ); ?>"
><i class="fa-solid fa-check"></i></button>
2023-01-21 01:31:34 +01:00
<?php endif; ?>
</div>
</footer>