core/api/modules/page/comments.html

41 lines
3.0 KiB
HTML
Executable File

<div class="container">
<h3 class="mt-5 mb-5">Комментарии</h3>
<div class="row p-0">
<form action="/act/page" method="POST" class="m-0 p-2 mb-2 form-add-comment container">
{if (!$smarty.session.user_id)}
<input type="input" name="fio" value="" placeholder="Имя" class="form-control">{/if}
<textarea name="txt" class="form-control mt-2" style="height: 200px;" id="textarea_txt"></textarea>
<input type="hidden" name="page_id" value="{$page[0].id}">
<input type="hidden" name="act" value="add_comment">
<input type="submit" name="ok" value="Добавить коментарий" class="btn btn-primary mt-2" style="width: 200px;;">
</form>
<div class="alert alert-info hidden" role="alert" id="div-commen-add">
Ваш комментарий отправлен на модерацию
</div>
{section name=customer loop=$comments}{if $comments[customer].id}
<div class="card mb-3 col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12 col-xxl-12 p-0" id="div-comment-id-{$comments[customer].id}">
<div class="row g-0">
<div class="col-md-2">
{if (!$comments[customer].fio2)}
<a href="/user/{$comments[customer].user_id}">
<img src="/api/modules/page/img/anonim_200.jpg" class="thumbnail lazy card-img-top" alt="{$comments[customer].fio2}" data-original="/img/avatars/{$comments[customer].ava}.jpg" title="{$comments[customer].fio}" style="width: 100%;">
</a>
{else}
<img src="/api/modules/page/img/anonim_200.jpg" class="thumbnail card-img-top" alt="{$comments[customer].fio}" title="{$comments[customer].fio}" style="width: 100%;"> {/if}
</div>
<div class="col-md-10">
<div class="card-body">
<h5 class="card-title"><a href="/user/{$comments[customer].user_id}">{$comments[customer].fio}</a>{$comments[customer].fio2}</h5>
<p class="card-text">{$comments[customer].txt|br}</p>
</div>
</div>
<div class="card-footer text-muted">
{$comments[customer].t|t} <i class="far fa-thumbs-up ml-3 r_comment" data-id="{$comments[customer].id}" data-r="{$comments[customer].r}" data-t="up"></i>
<span id="r_comment_{$comments[customer].id}">{$comments[customer].r}</span>
<i class="far fa-thumbs-down r_comment" data-r="{$comments[customer].r}" data-t="down" data-id="{$comments[customer].id}"></i> {if ($smarty.session.dostup=='a' || $smarty.session.dostup=='m')}<a href="{$comments[customer].id}" class="a_del_comment"> Удалить</a> {/if} {if ($smarty.session.user_id)} Ответить {/if}
</div>
</div>
</div>
{/if}{/section}
</div>
</div>