42 lines
3 KiB
PHP
42 lines
3 KiB
PHP
<?php global $post; ?>
|
|
<?php
|
|
$positive = (int) get_post_meta( $post->ID, 'positive', true );
|
|
$negative = (int) get_post_meta( $post->ID, 'negative', true );
|
|
|
|
$positive_title = $positive ? sprintf( _n( '%d نفر مفید دانست', '%d نفر مفید دانستند', $positive, 'wedocs' ), number_format_i18n( $positive ) ) : __( 'هنوز رأیی ثبت نشده', 'wedocs' );
|
|
$negative_title = $negative ? sprintf( _n( '%d نفر مفید ندانست', '%d نفر مفید ندانستند', $negative, 'wedocs' ), number_format_i18n( $negative ) ) : __( 'هنوز رأیی ثبت نشده', 'wedocs' );
|
|
?>
|
|
|
|
<div class="wedocs-feedback-wrap wedocs-hide-print p-5 rounded-2xl bg-slate-50 border border-slate-200">
|
|
<p class="wedocs-feedback-title text-sm font-medium text-slate-700 mb-3">
|
|
<?php esc_html_e( 'این مطلب برای شما مفید بود؟', 'wedocs' ); ?>
|
|
</p>
|
|
<div class="vote-link-wrap flex flex-wrap gap-3">
|
|
<a
|
|
href="#"
|
|
class="wedocs-tip positive inline-flex items-center gap-2 px-5 py-2.5 rounded-xl bg-success-500/15 text-success-600 hover:bg-success-500/25 font-medium transition-colors"
|
|
data-id="<?php the_ID(); ?>"
|
|
data-type="positive"
|
|
title="<?php echo esc_attr( $positive_title ); ?>"
|
|
>
|
|
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14 10h4.764a2 2 0 011.789 2.894l-3.5 7A2 2 0 0115.263 21h-4.017c-.163 0-.326-.02-.485-.06L7 20m7-10V5a2 2 0 00-2-2h-.095c-.5 0-.905.405-.905.905 0 .714-.211 1.412-.608 2.006L7 11v9m7-10h-2M7 20H5a2 2 0 01-2-2v-6a2 2 0 012-2h2.5"/></svg>
|
|
<?php esc_html_e( 'بله', 'wedocs' ); ?>
|
|
<?php if ( $positive ) { ?>
|
|
<span class="count text-xs bg-success-500/30 px-2 py-0.5 rounded-lg"><?php echo number_format_i18n( $positive ); ?></span>
|
|
<?php } ?>
|
|
</a>
|
|
<a
|
|
href="#"
|
|
class="wedocs-tip negative inline-flex items-center gap-2 px-5 py-2.5 rounded-xl bg-slate-200/80 text-slate-600 hover:bg-slate-300/80 font-medium transition-colors"
|
|
data-id="<?php the_ID(); ?>"
|
|
data-type="negative"
|
|
title="<?php echo esc_attr( $negative_title ); ?>"
|
|
>
|
|
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 14H5.236a2 2 0 01-1.789-2.894l3.5-7A2 2 0 018.736 3h4.018a2 2 0 01.485.06l3.76.94m-7 10v5a2 2 0 002 2h.096c.5 0 .905-.405.905-.904 0-.715.211-1.413.608-2.008L17 13V4m-7 10h2M5 4a2 2 0 012-2h2.5a2 2 0 012 2v6a2 2 0 01-2 2H7a2 2 0 01-2-2V4z"/></svg>
|
|
<?php esc_html_e( 'خیر', 'wedocs' ); ?>
|
|
<?php if ( $negative ) { ?>
|
|
<span class="count text-xs bg-slate-400/30 px-2 py-0.5 rounded-lg"><?php echo number_format_i18n( $negative ); ?></span>
|
|
<?php } ?>
|
|
</a>
|
|
</div>
|
|
</div>
|