Files
comment/templates/admin_comments.tpl

227 lines
13 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.
<style>
/* Глобальный шрифт 13px */
.tableStatic, .tableStatic tbody td, .author-data-container,
.meta-sub-text, .comment-scroll-box, .cell-top-bar a,
.cell-top-bar span, .asset-name, #mass_action_select{
font-size: 13px !important;
}
.blueBtn {
font-size: 11px !important;
padding: 2px 10px !important; /* Уменьшаем вертикальный отступ */
height: 28px !important; /* Фиксируем высоту, чтобы она не прыгала */
line-height: 24px !important; /* Центрируем текст по вертикали */
cursor: pointer;
}
/* Верстка таблицы */
.tableStatic tbody td { vertical-align: top !important; padding: 8px 10px !important; }
/* КОЛОНКА АВТОРА */
.author-column { width: 240px !important; min-width: 240px; position: relative; }
.author-data-container { display: flex; flex-direction: column; gap: 8px; }
.author-info-row { display: flex; align-items: center; gap: 12px; }
/* АВАТАР */
.admin-avatar-box { width: 45px; height: 45px; flex-shrink: 0; }
.admin-avatar-box img { width: 45px; height: 45px; border-radius: 50%; object-fit: cover; border: 1px solid #ddd; }
.mod_comment_avatar_letter { width: 45px; height: 45px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; color: #fff; text-transform: uppercase; font-size: 18px !important; }
/* Цвета для букв аватара */
.av-c1 { background-color: #6c5ce7; } .av-c2 { background-color: #2ecc71; }
.av-c3 { background-color: #e67e22; } .av-c4 { background-color: #e91e63; }
.av-c5 { background-color: #00cec9; } .av-c6 { background-color: #0984e3; }
.av-c7 { background-color: #d63031; } .av-c8 { background-color: #636e72; }
.av-c9 { background-color: #fdcb6e; } .av-c10 { background-color: #fd79a8; }
/* ЗВЕЗДЫ РЕЙТИНГА АВТОРА (Screenshot_13) */
.author-stars { color: #ff9800; font-size: 16px; letter-spacing: 0px; margin: 2px 0; line-height: 1; }
.star-grey { color: #ccc !important; }
/* Мета-данные */
.meta-sub-text { color: #666; line-height: 1.6; }
.meta-ip { color: #999; }
.meta-edit { color: #d35400; font-weight: bold; background: #fff5e6; padding: 0 4px; border-radius: 3px; display: inline-block; }
/* Контент комментария */
.comment-scroll-box { max-height: 200px; overflow-y: auto; line-height: 1.6; color: #333; margin: 10px 0; padding-right: 10px; }
/* Зебра и Hover */
.row-odd { background-color: #ffffff !important; }
.row-even { background-color: #f1f6fa !important; }
.row-hidden { background-color: #fff4f4 !important; }
.tableStatic tbody tr:hover td { background-color: #edf3f7 !important; transition: background 0.1s ease; }
/* Линия вложенности (Screenshot_14) */
.reply-wrapper { border-left: 3px solid #3498db; padding-left: 15px; position: relative; }
/* Панели */
.cell-top-bar { display: flex; align-items: center; gap: 12px; border-bottom: 1px dashed #ddd; padding-bottom: 8px; }
.cell-top-bar > div:last-child { margin-left: auto !important; }
.public-rating-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; border-top: 1px solid #f0f0f0; padding-top: 8px; }
.star-public { color: #FFD700; font-size: 14px; }
/* Файлы */
.comment-assets-inline { display: flex; flex-wrap: wrap; gap: 15px; margin: 12px 0; }
.asset-item { width: 90px; text-align: center; }
.asset-thumb { width: 90px; height: 70px; border: 1px solid #ccc; border-radius: 5px; background: #fff; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.asset-thumb img { width: 100%; height: 100%; object-fit: cover; }
.asset-name { display: block; width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; font-size: 12px !important; color: #555; margin-top: 4px; }
</style>
<div class="title"><h5>{#COMMENT_MODULE_NAME#} (Всего: {$docs|count})</h5></div>
<div class="widget first">
<div class="head">
<h5 class="iFrames">{#COMMENT_MODULE_COMENTS#}</h5>
<div class="num"><a class="basicNum" href="index.php?do=modules&action=modedit&mod=comment&moduleaction=settings&cp={$sess}">{#COMMENT_MODULE_SETTINGS#}</a></div>
</div>
<table cellpadding="0" cellspacing="0" width="100%" class="tableStatic">
<thead>
<tr>
<td width="40"><input type="checkbox" id="selectAll" onclick="checkAll(this)" /></td>
<td width="50">ID</td>
<td class="author-column">Данные Автора</td>
<td>Текст комментария и файлы</td>
</tr>
</thead>
<tbody>
{if $docs}
{foreach from=$docs item=row name=zebraloop}
<tr class="{if $row.comment_status == '0'}row-hidden{elseif $smarty.foreach.zebraloop.iteration % 2 == 0}row-even{else}row-odd{/if}">
<td align="center"><input class="row-checkbox" type="checkbox" value="{$row.CId}" /></td>
<td align="center"><strong>{$row.CId}</strong></td>
<td class="author-column">
<div class="author-data-container" style="margin-left: {$row.depth_level * 25}px;">
<div class="author-info-row">
<div class="admin-avatar-box">
{if $row.avatar}<img src="{$row.avatar}">{else}
<div class="mod_comment_avatar_letter av-c{$row.avatar_color_index}">{$row.first_letter}</div>{/if}
</div>
<span style="font-weight:bold; color:#2c3e50;">{$row.comment_author_name|escape}</span>
</div>
<div class="meta-sub-text">
<div class="author-stars">
{section name=s start=1 loop=6}{if $smarty.section.s.index <= $row.user_rating}{else}<span class="star-grey">★</span>{/if}{/section}
</div>
<div>📅 {$row.date_pub}</div>
{if $row.date_edit}<div class="meta-edit">📝 ред. {$row.date_edit}</div>{/if}
<div class="meta-ip">🌐 {$row.comment_author_ip}</div>
</div>
</div>
</td>
<td>
<div class="{if $row.depth_level > 0}reply-wrapper{/if}" style="margin-left: {$row.depth_level * 25}px;">
<div class="cell-top-bar">
{if $row.parent_id > 0}
<span style="background:#e1f5fe; color:#0288d1; padding:2px 8px; border-radius:3px; font-weight:bold; font-size: 10px !important;">ОТВЕТ НА #{$row.parent_id}</span>
{/if}
<a href="{$ABS_PATH}index.php?id={$row.document_id}" target="_blank" style="color:#2980b9; font-weight:bold; text-decoration:underline;">
{$row.document_title|default:"Документ"|truncate:35}
</a>
<a href="{$ABS_PATH}index.php?id={$row.document_id}#comment-{$row.CId}" target="_blank" style="color:#27ae60; font-weight:bold;">[#] Посмотреть</a>
<div style="display: flex; gap: 8px; align-items: center; border-left: 1px solid #ddd; padding-left: 10px;">
<span style="font-weight:bold; color:{if $row.comment_status=='1'}#27ae60{else}#e74c3c{/if};">
{if $row.comment_status=='1'}Одобрен{else}Скрыт{/if}
</span>
{if $row.comment_status == '1'}
<a class="icon_sprite ico_unlock_no" title="Скрыть" href="index.php?do=modules&action=modedit&mod=comment&moduleaction=1&admin_action=set_status_0&id={$row.CId}&cp={$sess}"></a>
{else}
<a class="icon_sprite ico_unlock" title="Одобрить" href="index.php?do=modules&action=modedit&mod=comment&moduleaction=1&admin_action=set_status_1&id={$row.CId}&cp={$sess}"></a>
{/if}
<a class="icon_sprite ico_edit" title="Редактировать" href="javascript:void(0);" onClick="windowOpen('index.php?do=modules&action=modedit&mod=comment&moduleaction=admin_edit&pop=1&docid={$row.document_id}&Id={$row.CId}','700','700','1');"></a>
<a class="icon_sprite ico_delete ConfirmDelete" title="Удалить" href="index.php?do=modules&action=modedit&mod=comment&moduleaction=1&admin_action=delete&id={$row.CId}&cp={$sess}"></a>
</div>
</div>
<div class="comment-scroll-box">{$row.comment_text|nl2br}</div>
{if $row.images || $row.files}
<div class="comment-assets-inline">
{foreach from=$row.images item=img}
<div class="asset-item">
<div class="asset-thumb">
<a href="{$ABS_PATH}uploads/comments/{$img.orig_name}" class="view fancy" rel="gallery-{$row.CId}">
<img src="{$ABS_PATH}uploads/comments/{$img.orig_name}" />
</a>
</div>
<span class="asset-name" title="{$img.clean_name}">{$img.clean_name|truncate:15:"...":true}</span>
</div>
{/foreach}
{foreach from=$row.files item=f}
<div class="asset-item">
<a href="{$ABS_PATH}uploads/comments/{$f.orig_name}" target="_blank" class="asset-thumb" style="flex-direction: column; text-decoration:none; background:#f9f9f9;">
<span style="font-weight: bold; color: #2980b9;">{$f.ext|upper}</span>
</a>
<span class="asset-name" title="{$f.clean_name}">{$f.clean_name|truncate:15:"...":true}</span>
</div>
{/foreach}
</div>
{/if}
<div class="public-rating-row">
<div class="star-public">
{section name=s start=1 loop=6}{if $smarty.section.s.index <= $row.star_public}{else}<span class="star-grey">☆</span>{/if}{/section}
</div>
<span style="color:#999;">(Голосов: {$row.r_count|default:0})</span>
</div>
</div>
</td>
</tr>
{/foreach}
{else}
<tr>
<td colspan="4">
<ul class="messages">
<li class="highlight yellow"><strong>Сообщение:</strong><br />Нет комментариев.</li>
</ul>
</td>
</tr>
{/if}
</tbody>
</table>
<div class="tfoot">
<div class="left" style="padding:15px;">
<select id="mass_action_select" style="padding:5px;">
<option value="">Выберите действие...</option>
<option value="set_status_1">Опубликовать</option>
<option value="set_status_0">Скрыть</option>
<option value="delete">Удалить выбранные</option>
</select>
<input type="button" value="ПРИМЕНИТЬ" class="blueBtn" onclick="runMassAction()" style="margin-left:10px;" />
</div>
</div>
</div>
{if $page_nav}
<div class="pagination">
<ul class="pages">
{$page_nav}
</ul>
</div>
{/if}
<script type="text/javascript">
function checkAll(master) {
var checkboxes = document.getElementsByClassName('row-checkbox');
for (var i = 0; i < checkboxes.length; i++) { checkboxes[i].checked = master.checked; }
}
function runMassAction() {
var action = document.getElementById('mass_action_select').value;
if (!action) { jAlert('Выберите действие!', 'Внимание'); return; }
var checkboxes = document.getElementsByClassName('row-checkbox');
var ids = [];
for (var i = 0; i < checkboxes.length; i++) { if (checkboxes[i].checked) ids.push(checkboxes[i].value); }
if (ids.length === 0) { jAlert('Ничего не выбрано!', 'Ошибка'); return; }
var url = 'index.php?do=modules&action=modedit&mod=comment&moduleaction=1&admin_action=' + action + '&ids=' + ids.join(',') + '&cp={$sess}';
if (action === 'delete') {
jConfirm('Удалить выбранные элементы?', 'Подтверждение', function(r) { if(r) window.location.href = url; });
} else { window.location.href = url; }
}
</script>