{block name='account-feedback'}
    {block name='account-feedback-heading'}
        <h1>{lang key='allRatings'}</h1>
    {/block}
    {if JTL\Session\Frontend::getCustomer()->getID() === 0}
        {block name='account-feedback-alert-login'}
            <div role="alert" class="alert alert-danger">{lang key='loginFirst' section='product rating'}</div>
        {/block}
    {elseif empty($bewertungen)}
        {block name='account-feedback-alert-feedback'}
            <div role="alert" class="alert alert-danger">{lang key='no feedback' section='product rating'}</div>
        {/block}
    {else}
        {block name='account-feedback-ratings'}
            {foreach $bewertungen as $Bewertung}
                <div class="card account-feedback">
                    <div class="card-header">
                        {block name='account-feedback-rating-header'}
                            <strong>{$Bewertung->cTitel}</strong> - {$Bewertung->dDatum}
                            {block name='account-feedback-include-rating'}
                                {include file='productdetails/rating.tpl' stars=$Bewertung->nSterne}
                            {/block}
                        {/block}
                    </div>

                    <div class="card-body">
                        {block name='account-feedback-rating-body'}
                            {block name='account-feedback-rating-body-rating'}
                                {$Bewertung->cText}
                                <span class="float-right">
                                    {include file="widgets/base/button.tpl" variant="primary" classes="btn-sm" href="{get_static_route id='bewertung.php'}?a={$Bewertung->kArtikel}&bfa=1" label="<i class=\"{et_getIcon key="edit"}\"></i>" iconPosition="none" title="{lang key='edit' section='product rating'}"}
                                </span>
                            {/block}
                            {if !empty($Bewertung->cAntwort)}
                                {block name='account-feedback-rating-body-reply'}
                                    <div class="card">
                                        <div class="card-body">
                                            <strong>{lang key='reply' section='product rating'} {$cShopName}:</strong>
                                            <hr>
                                            <blockquote>
                                                <p>{$Bewertung->cAntwort}</p>
                                                <small>{$Bewertung->dAntwortDatum}</small>
                                            </blockquote>
                                        </div>
                                    </div>
                                {/block}
                            {/if}
                        {/block}
                    </div>

                    <div class="card-footer">
                        {block name='account-feedback-rating-footer'}
                            {if !empty($Bewertung->fGuthabenBonus)}
                                {lang key='balance bonus' section='product rating'}: {$Bewertung->fGuthabenBonusLocalized}
                            {/if}
                            {if $Bewertung->nAktiv == 1}
                                {lang key='feedback activated' section='product rating'}
                            {else}
                                {lang key='feedback deactivated' section='product rating'}
                            {/if}
                        {/block}
                    </div>
                </div>
            {/foreach}
        {/block}
    {/if}
{/block}
