635 lines
29 KiB
Smarty
635 lines
29 KiB
Smarty
<style>
|
||
/* Глобальные шрифты */
|
||
.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;
|
||
}
|
||
|
||
/* Компактная строка */
|
||
.tableStatic tbody td { vertical-align: middle !important; padding: 4px 10px !important; }
|
||
|
||
/* АВАТАР */
|
||
.admin-avatar-box { width: 34px; height: 34px; flex-shrink: 0; }
|
||
.admin-avatar-box img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 1px solid #ddd; }
|
||
.mod_comment_avatar_letter { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; color: #fff; text-transform: uppercase; font-size: 14px !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; }
|
||
.av-c11 { background-color: #a29bfe; }
|
||
.av-c12 { background-color: #273c75; }
|
||
|
||
/* ЗВЕЗДЫ РЕЙТИНГА АВТОРА (справа от имени) */
|
||
.author-stars { color: #ff9800; font-size: 14px; letter-spacing: 0px; display: inline-block; margin-left: 8px; }
|
||
.star-grey { color: #ccc !important; }
|
||
|
||
.status-badge { font-size: 10px; padding: 1px 4px; border-radius: 3px; font-weight: bold; text-transform: uppercase; border: 1px solid; }
|
||
.bg-del-adm { background: #ffebee; color: #c62828; border-color: #ffcdd2; }
|
||
.bg-del-aut { background: #f5f5f5; color: #757575; border-color: #e0e0e0; font-style: italic; }
|
||
.row-hidden { background-color: #fff4f4 !important; }
|
||
|
||
/* Контейнер для веера файлов */
|
||
.files-bundle {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
height: 34px;
|
||
}
|
||
|
||
/* Базовый стиль для миниатюр в стопке */
|
||
.thumb-stack {
|
||
width: 28px;
|
||
height: 28px;
|
||
border: 2px solid #fff;
|
||
border-radius: 4px;
|
||
object-fit: cover;
|
||
box-shadow: 0 1px 3px rgba(0,0,0,0.2);
|
||
margin-left: -15px; /* Наложение картинок друг на друга */
|
||
transition: all 0.2s ease;
|
||
cursor: pointer;
|
||
position: relative;
|
||
}
|
||
|
||
/* Первая картинка в стопке без отступа */
|
||
.thumb-stack:first-child { margin-left: 0; }
|
||
|
||
/* Эффект при наведении на конкретную картинку */
|
||
.thumb-stack:hover {
|
||
transform: scale(4.5);
|
||
z-index: 999;
|
||
margin: 0 40px; /* Раздвигаем соседей, чтобы не перекрывали зум */
|
||
box-shadow: 0 5px 15px rgba(0,0,0,0.5);
|
||
}
|
||
|
||
/* Иконка файла в стиле стопки */
|
||
.file-stack {
|
||
width: 28px; height: 28px; background: #f8f9fa;
|
||
display: flex; align-items: center; justify-content: center;
|
||
font-size: 8px; font-weight: bold; border: 2px solid #fff;
|
||
border-radius: 4px; color: #555; box-shadow: 0 1px 3px rgba(0,0,0,0.2);
|
||
margin-left: -15px; transition: all 0.2s ease;
|
||
}
|
||
.file-stack:hover { transform: scale(1.5); z-index: 100; }
|
||
|
||
/* Стиль индикатора статуса */
|
||
/* Базовый стиль кружка */
|
||
.status-dot {
|
||
width: 10px;
|
||
height: 10px;
|
||
border-radius: 50%;
|
||
display: inline-block;
|
||
}
|
||
|
||
/* Зеленый - просто светится */
|
||
.dot-active {
|
||
background-color: #2ecc71;
|
||
box-shadow: 0 0 6px #2ecc71;
|
||
}
|
||
|
||
/* Красный - ПУЛЬСИРУЕТ */
|
||
.dot-hidden {
|
||
background-color: #e74c3c;
|
||
animation: pulse-red 1.5s infinite;
|
||
}
|
||
|
||
/* Эффект пульсации */
|
||
@keyframes pulse-red {
|
||
0% {
|
||
transform: scale(0.95);
|
||
box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7);
|
||
}
|
||
70% {
|
||
transform: scale(1);
|
||
box-shadow: 0 0 0 10px rgba(231, 76, 60, 0);
|
||
}
|
||
100% {
|
||
transform: scale(0.95);
|
||
box-shadow: 0 0 0 0 rgba(231, 76, 60, 0);
|
||
}
|
||
}
|
||
|
||
/* Стиль для аватара удаленного пользователя */
|
||
.avatar-deleted {
|
||
background-color: #bdc3c7 !important; /* Серый цвет */
|
||
color: #fff !important;
|
||
font-size: 18px !important;
|
||
}
|
||
|
||
/* Плашки для текста удаленных комментариев */
|
||
.comment-deleted-info {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
padding: 4px 10px;
|
||
border-radius: 4px;
|
||
font-size: 12px;
|
||
font-weight: 500;
|
||
gap: 6px;
|
||
}
|
||
.del-adm { background: #fff5f5; color: #c0392b; border: 1px solid #fadbd8; }
|
||
.del-aut { background: #f8f9fa; color: #7f8c8d; border: 1px solid #e5e8e8; font-style: italic; }
|
||
|
||
/* Рейтинг комментария в таблице */
|
||
.comm-rating-box { display: flex; align-items: center; justify-content: center; gap: 5px; min-width: 80px; }
|
||
.comm-stars { color: #f1c40f; font-size: 13px; text-align: center; }
|
||
.comm-likes { color: #e74c3c; font-size: 13px; font-weight: bold; display: flex; align-items: center; gap: 4px; justify-content: center; }
|
||
.rating-count-box { font-size: 10px; color: #999; font-weight: normal; margin-top: -2px; }
|
||
.bi-heart-fill { font-size: 12px; }
|
||
|
||
/* Направляющие для дерева ответов */
|
||
.tree-branch {
|
||
display: flex;
|
||
align-items: center;
|
||
align-self: stretch;
|
||
position: relative;
|
||
}
|
||
.branch-line {
|
||
border-left: 1px solid #c8d6e5;
|
||
border-bottom: 1px solid #c8d6e5;
|
||
width: 12px;
|
||
height: 14px;
|
||
margin-right: 8px;
|
||
margin-top: -10px; /* Поднимаем к центру текста */
|
||
flex-shrink: 0;
|
||
border-bottom-left-radius: 4px;
|
||
}
|
||
.depth-1 { margin-left: 15px; }
|
||
.depth-2 { margin-left: 30px; }
|
||
.depth-3 { margin-left: 45px; }
|
||
.depth-4 { margin-left: 60px; }
|
||
.depth-5 { margin-left: 75px; }
|
||
|
||
/* в линейном виде отступ */
|
||
.depth-0 { margin-left: 0; }
|
||
.tree-branch { min-height: 20px; }
|
||
|
||
/* элементы выравниваем по центру*/
|
||
.searchLine .grid-container {
|
||
display: flex !important;
|
||
flex-wrap: wrap;
|
||
align-items: center !important;
|
||
gap: 15px;
|
||
}
|
||
|
||
/* Label и Инпут внутри групп стояли рядом */
|
||
.searchLine .form-group {
|
||
display: flex !important;
|
||
align-items: center !important;
|
||
gap: 8px;
|
||
margin: 0 !important;
|
||
}
|
||
|
||
/* Убираем вертикальные отступы у меток, чтобы они не тянули линию вверх */
|
||
.searchLine .form-group label {
|
||
margin-bottom: 0 !important;
|
||
white-space: nowrap;
|
||
}
|
||
|
||
/* выравнивание для FormStyler и кнопок */
|
||
.searchLine .jq-selectbox,
|
||
.searchLine .jq-selectbox__select,
|
||
.searchLine input[type="text"],
|
||
.searchLine input[type="date"],
|
||
.searchLine .blueBtn,
|
||
.searchLine .redBtn {
|
||
vertical-align: middle !important;
|
||
margin: 0 !important;
|
||
}
|
||
|
||
/* Кнопки: убираем лишний внешний отступ сверху у контейнера кнопок */
|
||
.searchLine .buttons-container {
|
||
margin-top: 0 !important;
|
||
display: flex;
|
||
gap: 10px;
|
||
align-items: center;
|
||
}
|
||
.searchLine input[type="date"]::-webkit-calendar-picker-indicator {
|
||
cursor: pointer !important;
|
||
display: block; /* Иногда помогает "проявить" элемент для CSS */
|
||
}
|
||
/* Делаем дату максимально похожей на стилизованный Поиск */
|
||
.searchLine input[type="date"] {
|
||
border: 1px solid #c5cdd4 !important;
|
||
background: #fff url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAUCAYAAAB9S9CDAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACpJREFUeNpi/P//PwMTAwMDIwMDEwMDEyMTAyMTEyMTExMTIxMTYyADAgwA7ncD8e89v98AAAAASUVORK5CYII=') repeat-x !important; /* Легкий градиент как у селектов */
|
||
height: 16pt !important;
|
||
font-size: 12px !important;
|
||
border-radius: 3px !important;
|
||
width: 130px;
|
||
color: #444444 !important;
|
||
font-family: 'Cuprum', sans-serif;
|
||
}
|
||
|
||
.tfoot {
|
||
border-top: 1px solid #CBD5DD;
|
||
}
|
||
|
||
</style>
|
||
|
||
<div class="title"><h5>{#COMMENT_MODULE_NAME#}</h5></div>
|
||
|
||
<div class="widget" style="margin-top: 0px;">
|
||
<div class="body">
|
||
{#COMMENT_MODULE_COMENTS#}
|
||
</div>
|
||
</div>
|
||
|
||
<div class="breadCrumbHolder module">
|
||
<div class="breadCrumb module">
|
||
<ul>
|
||
<li class="firstB"><a href="index.php" title="{#MAIN_PAGE#}">{#MAIN_PAGE#}</a></li>
|
||
<li><a href="index.php?do=modules&cp={$sess}">{#MODULES_SUB_TITLE#}</a></li>
|
||
<li>{#COMMENT_MODULE_NAME#}</li>
|
||
<li><a href="index.php?do=modules&action=modedit&mod=comment&moduleaction=settings&cp={$sess}">{#COMMENT_MODULE_SETTINGS#}</a></li>
|
||
<li><strong class="code">{#COMMENT_MODULE_COMENTS#}</strong></li>
|
||
</ul>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="widget first">
|
||
<div class="head">
|
||
<h5 class="iFrames">{#COMMENT_MODULE_COMENTS#} (Всего: {$docs|count})</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>
|
||
|
||
<div class="searchLine" style="padding: 15px; background: #f9f9f9; border: 1px solid #dcdcdc; border-bottom: none; border-radius: 4px 4px 0 0;">
|
||
<form method="GET" action="" id="filterForm" class="mainForm">
|
||
<input type="hidden" name="do" value="modules">
|
||
<input type="hidden" name="action" value="modedit">
|
||
<input type="hidden" name="mod" value="comment">
|
||
<input type="hidden" name="moduleaction" value="1">
|
||
<input type="hidden" name="cp" value="{$sess}">
|
||
|
||
<div class="grid-container">
|
||
<div class="form-group">
|
||
<label style="font-weight:bold;">Поиск:</label>
|
||
<input type="text" name="search_query" value="{$smarty.get.search_query|default:''|escape}" placeholder="Имя, IP или текст..." style="width:160px; padding:5px; border:1px solid #ccc; border-radius:3px;">
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<label style="font-weight:bold;">Сортировка:</label>
|
||
<select name="sort_order" style="width:180px; padding:5px;">
|
||
{assign var="get_sort" value=$smarty.get.sort_order|default:'new'}
|
||
<option value="new" {if $get_sort == 'new'}selected{/if}>Сначала новые</option>
|
||
<option value="old" {if $get_sort == 'old'}selected{/if}>Сначала старые</option>
|
||
<option value="popular" {if $get_sort == 'popular'}selected{/if}>Популярные (Рейтинг)</option>
|
||
<option value="discussed" {if $get_sort == 'discussed'}selected{/if}>Обсуждаемые (Ответы)</option>
|
||
<option value="user_rating" {if $get_sort == 'user_rating'}selected{/if}>Оценка автора</option>
|
||
</select>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<label style="font-weight:bold;">Фильтр:</label>
|
||
<select name="filter_type" style="width:150px; padding:5px;">
|
||
{assign var="get_filter" value=$smarty.get.filter_type|default:''}
|
||
<option value="" {if $get_filter == ''}selected{/if}>Все сообщения</option>
|
||
<option value="with_files" {if $get_filter == 'with_files'}selected{/if}>Только с файлами</option>
|
||
<option value="hidden" {if $get_filter == 'hidden'}selected{/if}>Скрытые</option>
|
||
</select>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<label style="font-weight:bold;">Вид / Лимит:</label>
|
||
<div style="display:flex; gap:5px; align-items: center;">
|
||
{assign var="get_view" value=$smarty.get.view_mode|default:'flat'}
|
||
{assign var="get_limit" value=$smarty.get.per_page|default:'15'}
|
||
<select name="view_mode" style="width:100px; padding:5px;">
|
||
<option value="flat" {if $get_view == 'flat'}selected{/if}>Линейный</option>
|
||
<option value="tree" {if $get_view != 'flat'}selected{/if}>Древовидный</option>
|
||
</select>
|
||
<select name="per_page" style="width:60px; padding:5px;">
|
||
<option value="5" {if $get_limit == '5'}selected{/if}>5</option>
|
||
<option value="15" {if $get_limit == '15'}selected{/if}>15</option>
|
||
<option value="50" {if $get_limit == '50'}selected{/if}>50</option>
|
||
<option value="100" {if $get_limit == '100'}selected{/if}>100</option>
|
||
</select>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<label style="font-weight:bold;">Период:</label>
|
||
<div style="display:flex; align-items:center; gap:5px;">
|
||
<input type="date" name="date_from" value="{$smarty.get.date_from|default:''}" style="padding:4px; width: 135px;">
|
||
<span>—</span>
|
||
<input type="date" name="date_to" value="{$smarty.get.date_to|default:''}" style="padding:4px; width: 135px;">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="buttons-container">
|
||
<input type="submit" value="Найти" class="blueBtn" style="height: 28px; line-height: 1;">
|
||
<input type="button" value="Сброс" class="redBtn" style="height: 28px; line-height: 1;" onclick="window.location.href='index.php?do=modules&action=modedit&mod=comment&moduleaction=1&cp={$sess}'">
|
||
</div>
|
||
</div>
|
||
</form>
|
||
</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="30">{#COMMENT_TABLE_STATUS#}</td>
|
||
<td width="220">{#COMMENT_TABLE_AUTOR_RATING#}</td>
|
||
<td width="110">{#COMMENT_TABLE_IP#}</td>
|
||
<td width="130">{#COMMENT_TABLE_DATE_EDIT#}</td>
|
||
<td>{#COMMENT_TABLE_TEXT_COMM#}</td>
|
||
<td width="90" align="center">{#COMMENT_RATING_ADMIN#}</td>
|
||
<td width="100">{#COMMENT_TABLE_FILES#}</td>
|
||
<td width="140" align="right">{#COMMENT_TABLE_ACTIONS#}</td>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
{if $docs}
|
||
{foreach from=$docs item=row name=zebraloop}
|
||
{assign var="is_deleted" value=false}
|
||
{if $row.comment_author_name == '__DELETED__' || $row.comment_author_name == '{#COMMENT_STATUS_DELETED#}'}{assign var="is_deleted" value=true}{/if}
|
||
|
||
|
||
<tr class="{if $row.comment_status == '0'}row-hidden deleted-row{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 align="center">
|
||
{if $row.comment_status == '1'}
|
||
<span class="status-dot dot-active" title="{#COMMENT_STATUS_AKTIV#}"></span>
|
||
{else}
|
||
<span class="status-dot dot-hidden" title="{#COMMENT_STATUS_HIDE#}"></span>
|
||
{/if}
|
||
</td>
|
||
|
||
<td>
|
||
<div style="display: flex; align-items: center; gap: 10px;">
|
||
<div class="admin-avatar-box">
|
||
{if $is_deleted}
|
||
<div class="mod_comment_avatar_letter avatar-deleted">?</div>
|
||
{else}
|
||
{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}
|
||
{/if}
|
||
</div>
|
||
<div style="white-space: nowrap;">
|
||
<span style="font-weight:bold; color:{if $is_deleted}#95a5a6{else}#2c3e50{/if};">
|
||
{if $is_deleted}Пользователь удален{else}{$row.comment_author_name|escape}{/if}
|
||
</span>
|
||
{if !$is_deleted}
|
||
<span 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}
|
||
</span>
|
||
{/if}
|
||
</div>
|
||
</div>
|
||
</td>
|
||
<td align="center" style="color:#666; font-family:monospace;">
|
||
<div style="color:#999; font-size:11px; line-height:1.2; font-family:monospace;">{$row.comment_author_ip}</div>
|
||
</td>
|
||
<td>
|
||
<div style="font-size:11px; line-height:1.2;">
|
||
<div>{$row.date_pub}</div>
|
||
{if $row.date_edit}
|
||
<div style="color:#d35400;">ред. {$row.date_edit}</div>
|
||
{/if}
|
||
</div>
|
||
</td>
|
||
|
||
<td>
|
||
<div style="display: flex; flex-direction: column; gap: 4px; {if $row.depth_level > 0}padding-left: 5px;{/if}">
|
||
{if $row.depth_level == 0}
|
||
<div style="margin-bottom: 2px;">
|
||
{* Ссылка на документ оставляем без отступа или с минимальным, чтобы не «ломать» таблицу *}
|
||
<a href="{$row.document_link}" target="_blank" style="color:#2980b9; font-weight:bold; text-decoration:none; border-bottom: 1px solid #d1d1d1; font-size: 11px; opacity: 0.7;">
|
||
{$row.document_title|default:"Документ #`$row.document_id`"}
|
||
</a>
|
||
</div>
|
||
{/if}
|
||
<div class="tree-branch depth-{$row.depth_level}">
|
||
{if $row.depth_level > 0}
|
||
<div class="branch-line"></div>
|
||
{/if}
|
||
|
||
<div style="display: flex; align-items: center; gap: 8px;">
|
||
{if $row.parent_id > 0}
|
||
<span style="background:#e1f5fe; color:#0288d1; padding:1px 4px; border-radius:3px; font-weight:bold; font-size: 10px !important; white-space: nowrap;">#{$row.parent_id} »</span>
|
||
{/if}
|
||
|
||
<div class="comment-text-cell">
|
||
{if $row.comment_text == '__DEL_BY_ADM__'}
|
||
<div class="comment-deleted-info del-adm">
|
||
<span style="font-size:14px;">🚫</span> {#COMMENT_DEL_ADM_ADM#}
|
||
</div>
|
||
{elseif $row.comment_text == '__DEL_BY_AUT__'}
|
||
<div class="comment-deleted-info del-aut">
|
||
<span style="font-size:14px;">🗑️</span> {#COMMENT_DEL_AVT_ADM#}
|
||
</div>
|
||
{else}
|
||
<span style="{if $row.depth_level > 0}color: #555;{/if}">{$row.comment_text|strip_tags|truncate:130}</span>
|
||
{/if}
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</td>
|
||
|
||
<td align="center">
|
||
<div class="comm-rating-box">
|
||
{if $comment_rating_type == 0}
|
||
{* ТИП 0: ЗВЕЗДЫ *}
|
||
<div class="comm-stars">
|
||
{assign var="comm_avg" value=0}
|
||
{if $row.rating_count > 0}
|
||
{math equation="round(x / y)" x=$row.rating_sum y=$row.rating_count assign="comm_avg"}
|
||
{/if}
|
||
|
||
<div style="letter-spacing: -1px; line-height: 1; color: {if $row.rating_count > 0}#f1c40f{else}#ccc{/if};">
|
||
{section name=star start=1 loop=6}
|
||
{if $smarty.section.star.index <= $comm_avg}★{else}<span class="star-grey">★</span>{/if}
|
||
{/section}
|
||
</div>
|
||
<div class="rating-count-box" style="color: {if $row.rating_count > 0}#666{else}#ccc{/if};">
|
||
({$row.rating_count|default:0})
|
||
</div>
|
||
</div>
|
||
|
||
{elseif $comment_rating_type == 1}
|
||
{* ТИП 1: ЛАЙКИ *}
|
||
<div class="comm-likes">
|
||
{if $row.rating_count > 0}
|
||
<span style="color: #e74c3c; font-size: 11px;">❤</span>
|
||
<span style="color: #e74c3c; font-size: 10px;">{$row.rating_count}</span>
|
||
{else}
|
||
<span style="color: #ccc; font-size: 11px;">❤</span>
|
||
<span style="color: #ccc; font-size: 11px;">0</span>
|
||
{/if}
|
||
</div>
|
||
|
||
{else}
|
||
{* ТИП 2 ИЛИ ЛЮБОЙ ДРУГОЙ: ВЫКЛЮЧЕНО *}
|
||
<span style="color: #bbb; font-size: 10px; ">—</span>
|
||
{/if}
|
||
</div>
|
||
</td>
|
||
|
||
<td align="center">
|
||
<div class="files-bundle">
|
||
{if $row.images}
|
||
{foreach from=$row.images item=img name=img_loop}
|
||
{if $smarty.foreach.img_loop.iteration < 5} {* Показываем максимум 4 превью в стопке *}
|
||
<a href="{$ABS_PATH}uploads/comments/{$img.orig_name}" target="_blank" style="text-decoration:none;">
|
||
<img src="{$ABS_PATH}uploads/comments/{$img.orig_name}" class="thumb-stack" title="{$img.clean_name}">
|
||
</a>
|
||
{/if}
|
||
{/foreach}
|
||
{if $row.images|count >= 5}
|
||
<span style="font-size:10px; color:#999; margin-left:5px;">+{$row.images|count - 4}</span>
|
||
{/if}
|
||
{/if}
|
||
|
||
{if $row.files}
|
||
{foreach from=$row.files item=f}
|
||
<a href="{$ABS_PATH}uploads/comments/{$f.orig_name}" target="_blank" class="file-stack" title="{$f.clean_name}">
|
||
{$f.ext|upper}
|
||
</a>
|
||
{/foreach}
|
||
{/if}
|
||
</div>
|
||
</td>
|
||
|
||
<td align="right">
|
||
<div style="display: flex; justify-content: flex-end; gap: 6px;">
|
||
{* --- ИКОНКИ СТАТУСА (ЗАМОЧКИ)*}
|
||
{if $row.parent_locked}
|
||
{* Если родитель скрыт, показываем серый замок *}
|
||
<span class="icon_sprite ico_lock_no" style="opacity: 0.5; filter: grayscale(1); cursor: help;" title="Сначала опубликуйте родителя (ID: {$row.parent_id})"></span>
|
||
{else}
|
||
{* Обычные кнопки, если родитель активен *}
|
||
{if $row.comment_status == '1'}
|
||
{* ИЗМЕНЕНО: Добавлены параметры в href *}
|
||
<a class="icon_sprite ico_unlock_no" title="{#COMMENT_ICON_HIDE_ADM#}" href="index.php?do=modules&action=modedit&mod=comment&moduleaction=1&admin_action=set_status_0&id={$row.CId}&cp={$sess}&sort_order={$smarty.get.sort_order|default:'new'}&view_mode={$smarty.get.view_mode|default:'flat'}&filter_type={$smarty.get.filter_type|default:''}&per_page={$smarty.get.per_page|default:'15'}"></a>
|
||
{else}
|
||
{* ИЗМЕНЕНО: Добавлены параметры в href *}
|
||
<a class="icon_sprite ico_unlock" title="{#COMMENT_ICON_SHOW_ADM#}" href="index.php?do=modules&action=modedit&mod=comment&moduleaction=1&admin_action=set_status_1&id={$row.CId}&cp={$sess}&sort_order={$smarty.get.sort_order|default:'new'}&view_mode={$smarty.get.view_mode|default:'flat'}&filter_type={$smarty.get.filter_type|default:''}&per_page={$smarty.get.per_page|default:'15'}"></a>
|
||
{/if}
|
||
{/if}
|
||
|
||
{* --- ОСТАЛЬНЫЕ КНОПКИ ОСТАЮТСЯ ВНУТРИ ПРОВЕРКИ --- *}
|
||
{if !$is_deleted}
|
||
{* ИЗМЕНЕНО: Добавлены параметры в href *}
|
||
<a data-dialog="edit-comment-{$row.CId}"
|
||
href="index.php?do=modules&action=modedit&mod=comment&moduleaction=admin_edit&Id={$row.CId}&cp={$sess}&pop=1&onlycontent=1&sort_order={$smarty.get.sort_order|default:'new'}&view_mode={$smarty.get.view_mode|default:'flat'}&filter_type={$smarty.get.filter_type|default:''}&per_page={$smarty.get.per_page|default:'15'}"
|
||
data-width="" data-height="700" data-modal="true" data-title="{#COMMENT_ICON_EDIT_ADM#}"
|
||
class="openDialog icon_sprite ico_edit" title="{#COMMENT_ICON_EDIT_ADM#}"></a>
|
||
|
||
{if $row.has_children}
|
||
{* ИЗМЕНЕНО: Добавлены параметры в href *}
|
||
<a class="icon_sprite ico_delete ConfirmDelete" title="{#COMMENT_ICON_DEL_SOFT#}" dir="{#COMMENT_CONFIRM_ADM_DIR_SOFT#}" name="{#COMMENT_CONFIRM_ADM_NAME_SOFT#}"
|
||
href="index.php?do=modules&action=modedit&mod=comment&moduleaction=admin_del&admin_action_type=soft&Id={$row.CId}&cp={$sess}&sort_order={$smarty.get.sort_order|default:'new'}&view_mode={$smarty.get.view_mode|default:'flat'}&filter_type={$smarty.get.filter_type|default:''}&per_page={$smarty.get.per_page|default:'15'}"></a>
|
||
{/if}
|
||
{/if}
|
||
|
||
{* Полное удаление всегда снаружи *}
|
||
{* ИЗМЕНЕНО: Добавлены параметры в href *}
|
||
<a class="icon_sprite ico_delete ico_delete_all ConfirmDelete" title="{#COMMENT_ICON_DEL_HARD#}" dir="{#COMMENT_CONFIRM_ADM_DIR#}" name="{#COMMENT_CONFIRM_ADM_NAME#}"
|
||
href="index.php?do=modules&action=modedit&mod=comment&moduleaction=admin_del&admin_action_type=full&Id={$row.CId}&cp={$sess}&sort_order={$smarty.get.sort_order|default:'new'}&view_mode={$smarty.get.view_mode|default:'flat'}&filter_type={$smarty.get.filter_type|default:''}&per_page={$smarty.get.per_page|default:'15'}"></a>
|
||
</div>
|
||
</td>
|
||
</tr>
|
||
{/foreach}
|
||
{else}
|
||
<tr>
|
||
<td colspan="10">
|
||
<ul class="messages">
|
||
<li class="highlight yellow"><strong>{#COMMENT_NOT_COOMENTS_MES#}</strong><br />{#COMMENT_NOT_COOMENTS_MES_A#}</li>
|
||
</ul>
|
||
</td>
|
||
</tr>
|
||
{/if}
|
||
</tbody>
|
||
</table>
|
||
{if !empty($docs)}
|
||
<div class="tfoot">
|
||
<div class="left" style="padding:15px;">
|
||
<select id="mass_action_select">
|
||
<option value="">{#COMMENT_ACTION_SELECT#}</option>
|
||
<option value="set_status_1">{#COMMENT_ACTION_SELECT_PUB#}</option>
|
||
<option value="set_status_0">{#COMMENT_ACTION_HIDE#}</option>
|
||
<option value="delete">{#COMMENT_ACTION_DEL#}</option>
|
||
</select>
|
||
<input type="button" value="{#COMMENT_BUTTON_APPLY#}" class="blueBtn" onclick="runMassAction()" style="margin-left:10px;" />
|
||
</div>
|
||
</div>
|
||
{/if}
|
||
</div>
|
||
|
||
{if $page_nav}
|
||
<div class="pagination"><ul class="pages">{$page_nav}</ul></div>
|
||
{/if}
|
||
|
||
<script type="text/javascript">
|
||
|
||
function refreshStyles() {
|
||
// Стилизуем селект массовых действий
|
||
$('#mass_action_select').styler('destroy').styler();
|
||
|
||
// Если решили стилизовать и дату (многие версии FormStyler это умеют вручную)
|
||
$('.searchLine input[type="date"]').styler('destroy').styler();
|
||
|
||
}
|
||
|
||
// Запускаем при загрузке
|
||
$(document).ready(function() {
|
||
refreshStyles();
|
||
});
|
||
|
||
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 select = document.getElementById('mass_action_select');
|
||
var action = select.value;
|
||
|
||
if (!action) {
|
||
jAlert('{#COMMENT_ACT_DEL_SEL#}', '{#COMMENT_ACT_DEL_WAR#}');
|
||
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('{#COMMENT_ACT_DEL_SEL_A#}', '{#COMMENT_ACT_DEL_WAR_A#}');
|
||
return;
|
||
}
|
||
|
||
var cp = '{$sess}';
|
||
|
||
// Собираем все настройки фильтра
|
||
var filterParams = '&sort_order={$smarty.get.sort_order|default:"new"}' +
|
||
'&view_mode={$smarty.get.view_mode|default:"flat"}' +
|
||
'&filter_type={$smarty.get.filter_type|default:""}' +
|
||
'&per_page={$smarty.get.per_page|default:"15"}' +
|
||
'&search_query=' + encodeURIComponent('{$smarty.get.search_query|default:""}');
|
||
|
||
var url = '';
|
||
|
||
if (action === 'delete') {
|
||
var idParams = ids.map(function(id) { return 'id[]=' + id; }).join('&');
|
||
url = 'index.php?do=modules&action=modedit&mod=comment&moduleaction=admin_del&' + idParams + '&cp=' + cp + filterParams;
|
||
} else {
|
||
url = 'index.php?do=modules&action=modedit&mod=comment&moduleaction=1&admin_action=' + action + '&ids=' + ids.join(',') + '&cp=' + cp + filterParams;
|
||
}
|
||
|
||
jConfirm('{#COMMENT_ACT_DEL_SEL_B#} ' + ids.length + ' {#COMMENT_ACT_DEL_WAR_B#}', '{#COMMENT_ACT_DEL_WAR_C#}', function(r) {
|
||
if(r) window.location.href = url;
|
||
});
|
||
}
|
||
</script> |