61 lines
2.5 KiB
PHP
61 lines
2.5 KiB
PHP
<?php
|
|
/**
|
|
* فرم پاسخ — طرح hesabix2
|
|
*
|
|
* @package Hesabix2
|
|
* @subpackage AnsPress
|
|
*/
|
|
|
|
if ( ! defined( 'ABSPATH' ) ) {
|
|
exit;
|
|
}
|
|
|
|
$ajax_query = wp_json_encode(
|
|
array(
|
|
'ap_ajax_action' => 'load_tinymce',
|
|
'question_id' => get_question_id(),
|
|
)
|
|
);
|
|
?>
|
|
|
|
<?php if ( ap_user_can_answer( get_question_id() ) ) : ?>
|
|
<div id="answer-form-c" class="ap-minimal-editor hesabix2-ap-answer-form ap-card-qa bg-white rounded-2xl shadow-sm border border-slate-100 p-6 mt-6">
|
|
<h4 class="text-lg font-bold text-slate-800 mb-4 flex items-center gap-2">
|
|
<span class="flex items-center justify-center w-8 h-8 rounded-lg bg-brand-500/10 text-brand-600">
|
|
<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="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"></path></svg>
|
|
</span>
|
|
<?php esc_html_e( 'پاسخ خود را بنویسید', 'anspress-question-answer' ); ?>
|
|
</h4>
|
|
<div class="flex gap-4">
|
|
<div class="ap-avatar flex-shrink-0 ring-2 ring-white shadow-sm rounded-full overflow-hidden">
|
|
<a href="<?php echo esc_url( ap_user_link( get_current_user_id() ) ); ?>">
|
|
<?php echo get_avatar( get_current_user_id(), ap_opt( 'avatar_size_qquestion' ) ); ?>
|
|
</a>
|
|
</div>
|
|
<div id="ap-drop-area" class="ap-cell ap-form-c flex-1 min-w-0">
|
|
<div class="ap-cell-inner">
|
|
<div class="ap-minimal-placeholder hesabix2-ap-minimal-placeholder">
|
|
<div class="ap-dummy-editor<?php echo esc_attr( ap_opt( 'answer_text_editor' ) ? ' ap-dummy-quick-editor' : '' ); ?>">
|
|
<?php if ( ap_opt( 'answer_text_editor' ) ) : ?>
|
|
<div class="quicktags-toolbar hide-if-no-js ap-dummy-toolbar"></div>
|
|
<?php endif; ?>
|
|
</div>
|
|
<div
|
|
class="ap-dummy-placeholder text-slate-500 py-5 px-5 border-2 border-dashed border-slate-200 rounded-xl cursor-pointer hover:border-brand-400 hover:bg-light-50 transition-all text-center"
|
|
ap="loadEditor"
|
|
data-apquery="<?php echo esc_attr( $ajax_query ); ?>"
|
|
role="button"
|
|
tabindex="0"
|
|
>
|
|
<?php esc_html_e( 'پاسخ خود را بنویسید...', 'anspress-question-answer' ); ?>
|
|
</div>
|
|
<div class="ap-editor-fade" ap="loadEditor" data-apquery="<?php echo esc_attr( $ajax_query ); ?>" aria-hidden="true"></div>
|
|
</div>
|
|
<div id="ap-form-main"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<?php ap_get_template_part( 'login-signup' ); ?>
|