fictioneer/partials/_story-footer.php

79 lines
2.7 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.0
2023-01-21 01:31:34 +01:00
* @see single-fcn_story.php
*
2023-08-19 22:22:56 +02:00
* @internal $args['story_data'] Story data from fictioneer_get_story_data().
* @internal $args['story_id'] Current story and post ID.
2023-01-21 01:31:34 +01:00
*/
?>
<?php
// No direct access!
defined( 'ABSPATH' ) OR exit;
2023-01-21 01:31:34 +01:00
// 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'];
$show_log = $story['chapter_count'] > 0 && FICTIONEER_ENABLE_STORY_CHANGELOG && get_option( 'fictioneer_show_story_changelog' );
2023-01-21 01:31:34 +01:00
?>
<footer class="story__footer padding-left padding-right">
2023-11-08 20:03:19 +01:00
<div class="story__extra">
<?php if ( $show_log ) : ?>
2023-11-08 20:03:19 +01:00
<label class="story__changelog hide-below-400" for="modal-chapter-changelog-toggle" tabindex="-1">
<i class="fa-solid fa-clock-rotate-left"></i>
</label>
<?php endif; ?>
</div>
2023-08-30 13:31:20 +02:00
<div class="story__meta">
<span class="story__meta-item story__status">
2023-01-21 01:31:34 +01:00
<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>
2023-09-16 14:25:26 +02:00
<span class="story__meta-item story__date _published" title="<?php esc_attr_e( 'Published', 'fictioneer' ); ?>">
2023-01-21 01:31:34 +01:00
<i class="fa-solid fa-clock"></i>
<span class="hide-below-480"><?php the_time( get_option( 'date_format' ) ); ?></span>
<span class="show-below-480"><?php the_time( FICTIONEER_STORY_FOOTER_B480_DATE ); ?></span>
2023-01-21 01:31:34 +01:00
</span>
2023-09-16 14:25:26 +02:00
<span class="story__meta-item story__words" title="<?php esc_attr_e( 'Total Words', 'fictioneer' ); ?>">
2023-01-21 01:31:34 +01:00
<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>
2023-09-16 14:25:26 +02:00
<span class="story__meta-item story__rating" title="<?php esc_attr_e( 'Rating', 'fictioneer' ); ?>">
2023-01-21 01:31:34 +01:00
<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
2023-08-30 13:31:20 +02:00
class="story__meta-item checkmark story__meta-checkmark"
2023-01-24 21:07:11 +01:00
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>