Files
comment/templates/comments_tree_sub.tpl
2025-12-18 09:51:12 +05:00

115 lines
6.0 KiB
Smarty
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{foreach from=$subcomments item=c}
<div class="card mb-3 mod_comment_comment{if $c.parent_id} ms-4{/if}">
{if isset($smarty.request.subaction) && $smarty.request.subaction=='showonly' && isset($smarty.request.comment_id) && $smarty.request.comment_id==$c.Id}
<div class="border border-warning border-3 rounded p-0">
{/if}
<div id="{$c.Id}" class="mod_comment_box">
<div class="card-body p-3 d-flex align-items-start">
{* ----- БЛОК АВАТАРА ----- *}
{$avatar_url = "{$ABS_PATH}modules/comment/img/no_avatar.webp"}
{if isset($c.avatar) && $c.avatar != ''}
{$avatar_url = $c.avatar}
{/if}
<div class="mod_comment_avatar flex-shrink-0 me-3">
<img src="{$avatar_url}" alt="Аватар пользователя {$c.comment_author_name|stripslashes|escape}" class="rounded-circle" style="width: 48px; height: 48px;" loading="lazy" />
</div>
<div class="flex-grow-1">
{* Информация об авторе и дате *}
<div class="mod_comment_meta mb-2 text-muted small">
<i class="bi bi-person me-1"></i> {#COMMENT_USER_ADD#} <a title="{#COMMENT_INFO#}" href="javascript:void(0);" onclick="popup('{$ABS_PATH}index.php?module=comment&action=postinfo&pop=1&Id={$c.Id}&theme={$theme}','comment','500','300','1');" class="fw-bold link-dark">{$c.comment_author_name|stripslashes|escape}</a>
<span class="ms-2"><i class="bi bi-clock me-1"></i> {$c.comment_published}</span>
{* НОВОЕ: Динамические поля в мета-данных комментария *}
{if $comment_show_f1 == 1 && $c.comment_author_website}
<span class="ms-2 d-inline-block">
<i class="bi bi-link-45deg"></i> <strong>{$comment_name_f1|default:#COMMENT_YOUR_SITE#}:</strong> {$c.comment_author_website|stripslashes|escape}
</span>
{/if}
{if $comment_show_f2 == 1 && $c.comment_author_city}
<span class="ms-2 d-inline-block">
<i class="bi bi-geo-alt"></i> <strong>{$comment_name_f2|default:#COMMENT_YOUR_FROM#}:</strong> {$c.comment_author_city|stripslashes|escape}
</span>
{/if}
{if $smarty.const.UGROUP==1}
<span class="ms-2 text-secondary">• IP:{$c.comment_author_ip}</span>
{/if}
<span class="mod_comment_changed">{if isset($c.comment_changed) && $c.comment_changed > 1} (<span class="text-secondary">{#COMMENT_TEXT_CHANGED#} {$c.comment_changed}</span>){/if}</span>
</div>
{* Текст комментария *}
<div class="mod_comment_text{if $smarty.const.UGROUP==1 || $c.comment_author_id==$smarty.session.user_id|default:'*'} editable_text{/if}">{$c.comment_text|escape|nl2br}</div>
{* НОВОЕ: ВЫВОД ПРИКРЕПЛЕННОГО ИЗОБРАЖЕНИЯ *}
{if !empty($c.comment_file)}
<div class="mod_comment_attached_image mt-3">
<a href="{$ABS_PATH}uploads/comments/{$c.comment_file}" target="_blank" class="comment-img-link">
<img src="{$ABS_PATH}uploads/comments/{$c.comment_file}"
class="img-fluid rounded border shadow-sm"
style="max-width: 300px; max-height: 400px; cursor: zoom-in;"
alt="Изображение к комментарию" />
</a>
</div>
{/if}
</div>
</div>
<div class="card-footer mod_comment_actions d-flex justify-content-end align-items-center bg-white border-top p-2">
{if $c.comment_author_id!=$smarty.session.user_id|default:'*' && (($cancomment==1 && $closed!=1) || $smarty.const.UGROUP==1)}
<a class="mod_comment_answer p-2 text-primary" href="javascript:void(0);" rel="{$c.Id}" title="{#COMMENT_ANSWER_LINK#}">
<i class="bi bi-reply-fill me-1"></i> {#COMMENT_ANSWER_LINK#}
</a>
{/if}
{if $smarty.const.UGROUP==1 || $c.comment_author_id==$smarty.session.user_id|default:'*'}
<a class="mod_comment_edit p-2 text-secondary" href="javascript:void(0);" title="{#COMMENT_EDIT_LINK#}">
<i class="bi bi-pencil-square me-1"></i> Редактировать
</a>
{/if}
{if $smarty.const.UGROUP==1}
{if $c.comment_status!=1}
<a class="mod_comment_unlock p-2 text-success" href="javascript:void(0);" title="{#COMMENT_UNLOCK_LINK#}">
<i class="bi bi-unlock-fill me-1"></i>
</a>
{else}
<a class="mod_comment_lock p-2 text-dark" href="javascript:void(0);" title="{#COMMENT_LOCK_LINK#}">
<i class="bi bi-lock-fill me-1"></i>
</a>
{/if}
<a class="mod_comment_delete p-2 text-danger" href="javascript:void(0);" title="{#COMMENT_DELETE_LINK#}">
<i class="bi bi-trash me-1"></i>
</a>
{/if}
</div>
</div>
{if isset($smarty.request.subaction) && $smarty.request.subaction=='showonly' && isset($smarty.request.comment_id) && $smarty.request.comment_id==$c.Id}
</div>
{/if}
<span id="end{$c.Id}"></span>
{if isset($comments) && isset($comments[$c.Id])}
<div class="mt-3">
{include file="$subtpl" subcomments=$comments[$c.Id] sub=1}
</div>
{/if}
</div>
{/foreach}