Move element templates to partials

This makes it easier to customize them in child themes.
This commit is contained in:
Tetrakern 2023-07-02 01:26:59 +02:00
parent 1fbed247f7
commit ebd7cd8046
6 changed files with 74 additions and 42 deletions

View File

@ -80,20 +80,7 @@ $logout_url = fictioneer_get_logout_url( get_permalink() );
// Edit template
if ( get_option( 'fictioneer_enable_user_comment_editing' ) ) {
// Start HTML ---> ?>
<template class="comment-edit-actions-template">
<div class="fictioneer-comment__edit-actions">
<button
type="button"
class="comment-inline-edit-submit button"
data-enabled="<?php echo esc_attr_x( 'Submit Changes', 'Comment inline edit submit button.', 'fictioneer' ); ?>"
data-disabled="<?php esc_attr_e( 'Updating…', 'fictioneer' ); ?>"
data-click="submit-inline-comment-edit"
><?php _ex( 'Submit Changes', 'Comment inline edit submit button.', 'fictioneer' ); ?></button>
<button type="button" class="comment-inline-edit-cancel button _secondary" data-click="cancel-inline-comment-edit"><?php _ex( 'Cancel', 'Comment inline edit cancel button.', 'fictioneer' ); ?></button>
</div>
</template>
<?php // <--- End HTML
get_template_part( 'partials/_template_comment_edit' );
}
// Pagination

View File

@ -199,15 +199,9 @@ if ( ! function_exists( 'fictioneer_mobile_bookmarks_frame' ) ) {
*/
function fictioneer_mobile_bookmarks_frame() {
get_template_part( 'partials/_template_mobile_bookmark' );
// Start HTML ---> ?>
<template id="mobile-bookmark-template" hidden>
<li class="mobile-menu__bookmark">
<button class="mobile-menu-bookmark-delete-button" data-bookmark-id><i class="fa-solid fa-trash-alt"></i></button>
<i class="fa-solid fa-bookmark"></i>
<a href="#"><span></span></a>
<div class="mobile-menu__bookmark-progress"><div><div class="mobile-menu__bookmark-bg" style></div></div></div>
</li>
</template>
<div class="mobile-menu__frame" data-frame="bookmarks">
<div class="mobile-menu__panel mobile-menu__bookmarks-panel" data-editing="false">
<div class="mobile-menu__panel-header">

View File

@ -19,27 +19,9 @@
$show_empty = isset( $args['show_empty'] ) && $args['show_empty'];
$count = isset( $args['count'] ) ? intval( $args['count'] ) : -1;
?>
get_template_part( 'partials/_template_bookmark' );
<template class="bookmark-small-card-template">
<li class="card _small bookmark-card" data-color>
<div class="card__body polygon">
<div class="bookmark-card__progress"></div>
<div class="card__main _grid _small _relative-z1">
<a href="" class="card__image cell-img bookmark-card__image" <?php echo fictioneer_get_lightbox_attribute(); ?>><img src="" class="no-auto-lightbox"></a>
<h3 class="card__title _with-delete _small cell-title bookmark-card__title"><a href="" class="truncate _1-1"></a></h3>
<div class="card__content bookmark-card__meta _small cell-meta">
<i class="fa-solid fa-bookmark"></i>
<span class="bookmark-card__percentage"></span>
<i class="fa-solid fa-calendar-days"></i>
<time></time>
</div>
<div class="card__content _small cell-desc bookmark-card__excerpt truncate _3-3"></div>
</div>
<button class="card__delete button-delete-bookmark" data-bookmark-id><i class="fa-solid fa-trash-can"></i></button>
</div>
</li>
</template>
?>
<section class="small-card-block bookmarks-block <?php echo $show_empty ? '' : 'hidden' ?>" data-count="<?php echo $count; ?>">
<?php if ( $show_empty ) : ?>

View File

@ -0,0 +1,29 @@
<?php
/**
* Partial: Bookmark Template
*
* @package WordPress
* @subpackage Fictioneer
* @since 5.4.5
*/
?>
<template class="bookmark-small-card-template">
<li class="card _small bookmark-card" data-color>
<div class="card__body polygon">
<div class="bookmark-card__progress"></div>
<div class="card__main _grid _small _relative-z1">
<a href="" class="card__image cell-img bookmark-card__image" <?php echo fictioneer_get_lightbox_attribute(); ?>><img src="" class="no-auto-lightbox"></a>
<h3 class="card__title _with-delete _small cell-title bookmark-card__title"><a href="" class="truncate _1-1"></a></h3>
<div class="card__content bookmark-card__meta _small cell-meta">
<i class="fa-solid fa-bookmark"></i>
<span class="bookmark-card__percentage"></span>
<i class="fa-solid fa-calendar-days"></i>
<time></time>
</div>
<div class="card__content _small cell-desc bookmark-card__excerpt truncate _3-3"></div>
</div>
<button class="card__delete button-delete-bookmark" data-bookmark-id><i class="fa-solid fa-trash-can"></i></button>
</div>
</li>
</template>

View File

@ -0,0 +1,22 @@
<?php
/**
* Partial: Comment Edit Template
*
* @package WordPress
* @subpackage Fictioneer
* @since 5.4.5
*/
?>
<template class="comment-edit-actions-template">
<div class="fictioneer-comment__edit-actions">
<button
type="button"
class="comment-inline-edit-submit button"
data-enabled="<?php echo esc_attr_x( 'Submit Changes', 'Comment inline edit submit button.', 'fictioneer' ); ?>"
data-disabled="<?php esc_attr_e( 'Updating…', 'fictioneer' ); ?>"
data-click="submit-inline-comment-edit"
><?php _ex( 'Submit Changes', 'Comment inline edit submit button.', 'fictioneer' ); ?></button>
<button type="button" class="comment-inline-edit-cancel button _secondary" data-click="cancel-inline-comment-edit"><?php _ex( 'Cancel', 'Comment inline edit cancel button.', 'fictioneer' ); ?></button>
</div>
</template>

View File

@ -0,0 +1,18 @@
<?php
/**
* Partial: Mobile Bookmark Template
*
* @package WordPress
* @subpackage Fictioneer
* @since 5.4.5
*/
?>
<template id="mobile-bookmark-template" hidden>
<li class="mobile-menu__bookmark">
<button class="mobile-menu-bookmark-delete-button" data-bookmark-id><i class="fa-solid fa-trash-alt"></i></button>
<i class="fa-solid fa-bookmark"></i>
<a href="#"><span></span></a>
<div class="mobile-menu__bookmark-progress"><div><div class="mobile-menu__bookmark-bg" style></div></div></div>
</li>
</template>