67 lines
3.2 KiB
PHP
67 lines
3.2 KiB
PHP
<?php
|
|
/**
|
|
* آیتم هر پاسخ — طرح hesabix2
|
|
*
|
|
* @package Hesabix2
|
|
* @subpackage AnsPress
|
|
*/
|
|
|
|
if ( ! defined( 'ABSPATH' ) ) {
|
|
exit;
|
|
}
|
|
|
|
if ( ! ap_user_can_read_answer() ) {
|
|
return;
|
|
}
|
|
?>
|
|
|
|
<div id="post-<?php the_ID(); ?>" class="ap-answer hesabix2-ap-answer answer<?php echo ap_is_selected() ? ' best-answer' : ''; ?>" apid="<?php the_ID(); ?>" ap="answer">
|
|
<div class="ap-content ap-answer-card bg-white rounded-2xl shadow-sm border border-slate-100 overflow-hidden p-6 mb-6 <?php echo ap_is_selected() ? 'ap-best-answer ring-2 ring-success-500/50 border-success-400' : ''; ?>" itemprop="suggestedAnswer<?php echo ap_is_selected() ? ' acceptedAnswer' : ''; ?>" itemscope itemtype="https://schema.org/Answer">
|
|
<?php if ( ap_is_selected() ) : ?>
|
|
<div class="flex items-center gap-2 mb-4 px-3 py-1.5 rounded-lg bg-success-500/15 text-success-700 text-sm font-medium w-fit">
|
|
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"></path></svg>
|
|
<span><?php esc_html_e( 'بهترین پاسخ', 'anspress-question-answer' ); ?></span>
|
|
</div>
|
|
<?php endif; ?>
|
|
<div class="flex gap-6">
|
|
<?php if ( ! ap_opt( 'disable_voting_on_answer' ) ) : ?>
|
|
<div class="flex-shrink-0">
|
|
<div class="ap-single-vote"><?php ap_vote_btn(); ?></div>
|
|
</div>
|
|
<?php endif; ?>
|
|
<div class="flex-1 min-w-0">
|
|
<meta itemprop="@id" content="<?php the_ID(); ?>" />
|
|
<meta itemprop="url" content="<?php the_permalink(); ?>" />
|
|
<div class="flex items-center gap-4 mb-4 pb-4 border-b border-slate-100">
|
|
<div class="ap-avatar flex-shrink-0 ring-2 ring-white shadow-sm rounded-full overflow-hidden">
|
|
<a href="<?php ap_profile_link(); ?>"><?php ap_author_avatar( ap_opt( 'avatar_size_qanswer' ) ); ?></a>
|
|
</div>
|
|
<div class="flex flex-wrap items-center gap-4 text-sm text-slate-600">
|
|
<span class="font-medium text-slate-700"><?php echo wp_kses_post( ap_user_display_name( array( 'html' => true ) ) ); ?></span>
|
|
<a href="<?php the_permalink(); ?>" class="ap-posted text-slate-500 hover:text-brand-600 transition-colors">
|
|
<time itemprop="datePublished" datetime="<?php echo esc_attr( ap_get_time( get_the_ID(), 'c' ) ); ?>">
|
|
<?php echo esc_html( ap_human_time( ap_get_time( get_the_ID(), 'U' ) ) ); ?>
|
|
</time>
|
|
</a>
|
|
<?php $comment_count = get_comments_number(); ?>
|
|
<span class="ap-comments-count"><span itemprop="commentCount"><?php echo (int) $comment_count; ?></span> <?php echo esc_html( _n( 'نظر', 'نظر', $comment_count, 'anspress-question-answer' ) ); ?></span>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="ap-q-inner">
|
|
<?php do_action( 'ap_before_answer_content' ); ?>
|
|
<div class="ap-answer-content ap-q-content text-slate-700 leading-relaxed" itemprop="text" ap-content><?php the_content(); ?></div>
|
|
<?php do_action( 'ap_after_answer_content' ); ?>
|
|
</div>
|
|
|
|
<div class="ap-post-footer flex flex-wrap items-center gap-3 mt-4 pt-4 border-t border-slate-100">
|
|
<?php echo ap_select_answer_btn_html(); ?>
|
|
<?php ap_post_actions_buttons(); ?>
|
|
<?php do_action( 'ap_answer_footer' ); ?>
|
|
</div>
|
|
|
|
<?php ap_post_comments(); ?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|