first commit

This commit is contained in:
2025-08-02 16:30:27 +02:00
commit 23646bfcee
14851 changed files with 1750626 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
<div class="alert alert-success">
{t}Komentář byl úspěšně odeslán ke schválení.{/t}
</div>

View File

@@ -0,0 +1,45 @@
{$isAnonymous = !$ctrl.user and !isSuperuser()}
{$allowAnonymous = false}
{ifmodule COMMENTS__COMMENTS_ANONYMOUS}
{$allowAnonymous = true}
{/ifmodule}
{if $isAnonymous and !$allowAnonymous}
<div>{t}Pro přidání komentáře se musíte přihlásit{/t}</div>
{else}
{include 'block.messages.tpl'}
<form name="comment" action="{path('kupshop_comments_comment_addcomment')}" class="comments-form" data-comment-form="">
<input type="hidden" name="id_product" value="{$body.objectId}">
<input type="hidden" name="id_parent" value="{$body.parentId}">
<input type="hidden" name="type" value="{$body.type}">
{if $isAnonymous and $allowAnonymous}
<div class="row">
<div class="col-md-6 col-xxs-12 form-group required">
<label for="name">{t}Jméno{/t}</label>
<input class="form-control" type="text" name="name" id="name" value="{$body.name}" required>
</div>
<div class="col-md-6 col-xxs-12 form-group required">
<label for="surname">{t}Příjmení{/t}</label>
<input class="form-control" type="text" name="surname" id="surname" value="{$body.surname}" required>
</div>
</div>
<div class="form-group required">
<label for="email">{t}E-mail{/t}</label>
<input class="form-control" type="email" name="email" id="email" value="{$body.email}" required>
</div>
{/if}
<div class="form-group required">
<label for="content">{t}Komentář{/t}</label>
<textarea class="form-control" name="content" id="content" required>{$body.content}</textarea>
</div>
{if $isAnonymous and $allowAnonymous}
{include "block.recaptcha.tpl"}
<br>
{/if}
<button type="submit" name="cSubmit" class="btn btn-primary">{t}Odeslat{/t}</button>
</form>
{/if}

View File

@@ -0,0 +1,91 @@
{$currentAdmin = getAdminUser()}
{$allowAnonymous = false}
{ifmodule COMMENTS__COMMENTS_ANONYMOUS}
{$allowAnonymous = true}
{/ifmodule}
{$allowReplies = ($ctrl.user || ($currentAdmin.id > 0) || $allowAnonymous)}
{function renderComments}
{foreach $comments as $comment}
{$user = $comment->getUser()}
{$admin = $comment->getAdmin()}
{if $user}
{$name = join(' ', [$user.name, $user.surname])}
{else}
{$name = $admin.name|default:$admin.login}
{/if}
<div data-comment="{$comment.id}"
class="comment-item comment-item-level-{$level}{if $comment.id_admin} comment-item-admin-answer{/if}">
<div class="comment-info">
<h6 class="name">{$name|default:"{t}Anonymní{/t}"}</h6>
<div>
{if $allowReplies}
<p>
<a href="" data-comment-reply="{$comment.id}">{t}reagovat{/t}</a>
</p>
{/if}
<p class="comment-report">
<a href="" data-wpj-focus="{path('kupshop_content_contactform_sendform', ['type'=>'report-inappropriate-content', 'report_type'=>'Comments', 'content_id'=>{$comment.id}])}" data-wpj-focus-ajax="1">
{t}Nahlásit{/t}
</a>
</p>
<span class="date">{$comment.date|format_date_locale_pretty:'d. L. Y'}</span>
</div>
</div>
{if $comment.parent}
<p class="comment-reaction">{t}Reakce na{/t}: {$comment.parent.content nofilter}</p>
{/if}
<p class="comment-text">{$comment.content nofilter}</p>
{* Sem se nacte formulat po kliknuti na tlacitko "Odpovedet" *}
<div data-comment-form-wrapper="{$comment.id}"></div>
</div>
{* Pokud ma komentar odpovedi, tak je vyrenderovat *}
{if $comment.children}
<div class="comment-answers comment-answers-{$level}">
<a href="" class="show-answers" data-opener="[data-comment-answer='{$comment.id}']">
<span class="show">{$comment->getChildrenCount()} {t plural="odpovědi" plural5="odpovědí" count=$comment->getChildrenCount()}odpověď{/t}</span>
<span class="hide">{t}skrýt odpovědi{/t}</span>
</a>
<div data-comment-answer="{$comment.id}" style="display: none;">
{renderComments comments=$comment.children level=($level + 1)}
</div>
</div>
{/if}
{/foreach}
{/function}
<div data-comments-wrapper="{$data.config|json_encode}">
<div>
{block "comments-header"}
<div class="comments-header">
<div>
<h6>{$comments.totalCount} {t plural="příspěvky" plural5="příspěvků" count=$comments.totalCount}příspěvek{/t}</h6>
<h2>{t}Zeptejte se{/t}</h2>
<p>{t}Máte dotaz k tomuto produktu? Využijte této diskuze.{/t}</p>
{if !$ctrl.user && !$allowAnonymous}
<p>{t escape=false url={url s=login}}Pro využití diskuze se&nbsp;<a href="{url}" class="cart-signin">přihlašte</a>.{/t}</p>
{/if}
</div>
{if $ctrl.user || $allowAnonymous}
<div>
<button class="btn btn-primary" data-comment-add="">{t}Položit dotaz{/t}</button>
</div>
{/if}
</div>
{/block}
{* sem se nacte formular po kliknu na tlacitko "Pridat komentar" *}
<div data-comment-form-wrapper=""></div>
</div>
<div data-comments="" data-reload="comments-{$data.pager.number}">
{renderComments comments=$data.comments level=0}
</div>
{if $data.pager.number < $data.pager.count}
<button data-comments-load-more="{$data.pager.number}" data-comments-total-pages="{$data.pager.count}" class="btn btn-secondary">
{t}Načíst další{/t}
</button>
{/if}
</div>