229 lines
14 KiB
Smarty
229 lines
14 KiB
Smarty
<style>
|
||
.tableStatic tbody td { vertical-align: middle !important; padding: 10px 8px !important; font-size: 12px; }
|
||
.author-data-container { display: flex; flex-direction: column; gap: 2px; }
|
||
.author-info-row { display: flex; align-items: center; margin-bottom: 2px; }
|
||
.admin-avatar-box { width: 28px; height: 28px; flex-shrink: 0; margin-right: 8px; }
|
||
.admin-avatar-box img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; border: 1px solid #ddd; }
|
||
.mod_comment_avatar_letter { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; color: #fff; font-size: 12px; text-transform: uppercase; }
|
||
.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; }
|
||
.av-c11 { background-color: #a29bfe; } .av-c12 { background-color: #273c75; }
|
||
.meta-sub-text { font-size: 10px; color: #888; line-height: 1.4; }
|
||
.meta-ip { color: #aaa; font-style: normal; }
|
||
.meta-edit { color: #d35400; font-weight: bold; }
|
||
.comment-scroll-box { max-height: 90px; overflow-y: auto; font-size: 13px; line-height: 1.5; color: #333; padding-right: 10px; scrollbar-width: thin; margin-bottom: 8px; }
|
||
.comment-scroll-box::-webkit-scrollbar { width: 4px; }
|
||
.comment-scroll-box::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }
|
||
.star-yellow { color: #FFB400; font-size: 13px; }
|
||
.star-grey { color: #eee; }
|
||
.star-public-filled { color: #FFD700; }
|
||
.cell-layout { display: flex; flex-direction: column; gap: 5px; min-height: 100px; justify-content: space-between; }
|
||
.cell-top-bar { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; border-bottom: 1px dashed #eee; padding-bottom: 4px; }
|
||
.cell-bottom-bar { display: flex; align-items: center; gap: 8px; margin-top: 5px; border-top: 1px solid #f9f9f9; padding-top: 4px; }
|
||
|
||
/* ПРЕВЬЮ В ТАБЛИЦЕ */
|
||
.comment-assets-inline { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 10px; padding: 5px 0; }
|
||
.asset-item { width: 80px; flex: 0 0 80px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
|
||
.asset-thumb { width: 80px; height: 60px; border: 1px solid #ccc; border-radius: 4px; overflow: hidden; background: #fafafa; display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
|
||
.asset-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
|
||
.asset-name { font-size: 11px; color: #444; font-weight: 500; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; display: block; }
|
||
|
||
/* ФИКС ДЛЯ ОГРОМНЫХ ФОТО В FANCYBOX */
|
||
.fancybox-can-zoom_in .fancybox-content { cursor: pointer; }
|
||
.fancybox-image, .fancybox-spaceball { max-width: 90vw !important; max-height: 85vh !important; margin: auto; }
|
||
/* 1. Ограничиваем контентную область */
|
||
#fancybox-content {
|
||
max-width: 950px !important;
|
||
max-height: 750px !important;
|
||
width: auto !important;
|
||
height: auto !important;
|
||
}
|
||
|
||
/* 2. Картинка внутри должна слушаться контейнера */
|
||
#fancybox-img {
|
||
max-width: 100% !important;
|
||
max-height: 100% !important;
|
||
width: auto !important;
|
||
height: auto !important;
|
||
object-fit: contain; /* Сохраняет пропорции без искажений */
|
||
}
|
||
|
||
/* 3. Ограничиваем внешнюю рамку, чтобы она не улетала за экран */
|
||
#fancybox-wrap {
|
||
max-width: 970px !important;
|
||
width: auto !important;
|
||
}
|
||
|
||
|
||
|
||
</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="30"><input type="checkbox" id="selectAll" onclick="checkAll(this)" /></td>
|
||
<td width="40">ID</td>
|
||
<td width="175">Данные Автора</td>
|
||
<td>Текст комментария и файлы</td>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
{if $docs}
|
||
{foreach from=$docs item=row}
|
||
<tr {if $row.comment_status == "0"}style="background-color: #fff4f4;"{/if}>
|
||
<td align="center"><input class="row-checkbox" type="checkbox" value="{$row.CId}" /></td>
|
||
<td align="center"><strong>{$row.CId}</strong></td>
|
||
<td>
|
||
<div class="author-data-container">
|
||
<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; font-size:12px; color:#2c3e50;">{$row.comment_author_name|escape}</span>
|
||
</div>
|
||
<div class="meta-sub-text">
|
||
<div class="star-yellow">
|
||
{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="cell-layout">
|
||
<div class="cell-top-bar">
|
||
<a href="{$ABS_PATH}index.php?id={$row.document_id}" target="_blank" style="color:#2980b9; font-weight:bold; text-decoration:underline; font-size: 11px;">
|
||
{$row.document_title|default:"Документ"|truncate:25}
|
||
</a>
|
||
<a href="{$ABS_PATH}index.php?id={$row.document_id}#comment-{$row.CId}" target="_blank" style="color:#27ae60; font-weight:bold; font-size:11px;">[#] к отзыву</a>
|
||
<div style="display: flex; gap: 6px; align-items: center; border-left: 1px solid #ddd; padding-left: 8px; margin-left: 5px;">
|
||
<span style="font-size:10px; 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="Удалить" name="Вы уверены что хотите удалить комментарий?" dir="Подтверждение удаления" 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}" title="{$img.clean_name}">
|
||
<img src="{$ABS_PATH}uploads/comments/{$img.orig_name}" />
|
||
</a>
|
||
</div>
|
||
<span class="asset-name" title="{$img.clean_name}">{$img.clean_name}</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="text-decoration: none; color: #333; flex-direction: column; background: #fcfcfc;">
|
||
<span style="font-size: 11px; font-weight: bold; color: #2980b9; margin-bottom: 2px;">{$f.ext|upper}</span>
|
||
<i class="icon_sprite ico_download"></i>
|
||
</a>
|
||
<span class="asset-name" title="{$f.clean_name}">{$f.clean_name}</span>
|
||
</div>
|
||
{/foreach}
|
||
</div>
|
||
{/if}
|
||
|
||
<div class="cell-bottom-bar">
|
||
<div class="star-yellow">
|
||
{section name=s start=1 loop=6}{if $smarty.section.s.index <= $row.star_public}<span class="star-public-filled">★</span>{else}<span class="star-grey">☆</span>{/if}{/section}
|
||
</div>
|
||
<span style="font-size:11px; color:#999;">(Голосов: {$row.r_count|default:0})</span>
|
||
</div>
|
||
</div>
|
||
</td>
|
||
</tr>
|
||
{/foreach}
|
||
{else}
|
||
<tr><td colspan="4" align="center" style="padding:50px; color:#999;">Список пуст</td></tr>
|
||
{/if}
|
||
</tbody>
|
||
</table>
|
||
|
||
<div class="tfoot">
|
||
<div class="left" style="padding:15px;">
|
||
<select id="mass_action_select" style="padding:5px; border:1px solid #ccc; border-radius:3px;">
|
||
<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 class="pagination">{$page_nav}</div>
|
||
</div>
|
||
</div>
|
||
|
||
<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 = [];
|
||
|
||
// Собираем ID отмеченных строк
|
||
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('Вы уверены, что хотите удалить выбранные элементы (' + ids.length + ' шт.)?', 'Подтверждение удаления', function(r) {
|
||
if(r) window.location.href = url;
|
||
});
|
||
} else {
|
||
window.location.href = url;
|
||
}
|
||
}
|
||
</script> |