Skip to content

Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.

3.1 KB
Raw Blame
@model CustomerModel
@{
    var area = ViewContext.RouteData.Values["area"]?.ToString();
    <div class="grand-card">
        <partial name="Partials/WidgetZone.ReviewsTop" model="Model"/>
        <div class="grand-card__body grand-card__body--flush">
            <admin-grid id="review-grid"
                        read-url="@Url.Action("ReviewList", "Customer", new { customerId = Model.Id, area = area })"
                        destroy-url="@Url.Action("ReviewDelete", "Customer", new { area = area })"
                        auto-bind="false">
                <grid-column field="ProductName" title="@Loc["Admin.Customers.Customers.Reviews.Product"]" width="90">
                    <cell-template>
                        <a class="text-decoration-none" href="@Url.Action("Edit", "Product", new { area = area })/{{ ProductId }}">{{ ProductName }}</a>
                    </cell-template>
                </grid-column>
                <grid-column field="Title" title="@Loc["Admin.Customers.Customers.Reviews.Title"]" width="120">
                    <cell-template>
                        <a class="text-decoration-none" href="@Url.Action("Edit", "ProductReview", new { area = area })/{{ Id }}">{{ Title }}</a>
                    </cell-template>
                </grid-column>
                <grid-column field="Rating" title="@Loc["Admin.Customers.Customers.Reviews.Rating"]" width="100">
                    <cell-template>
                        @*stars filled to Rating * 20 percent; ratings are whole numbers from 1 to 5*@
                        <div class="rating">
                            <div class="rating-ghost">&#x2606;&#x2606;&#x2606;&#x2606;&#x2606;</div>
                            @for (var stars = 1; stars <= 5; stars++)
                            {
                                <div class="rating-real" data-if="Rating == @stars" style="width: @(stars * 20)%">&#9733;&#9733;&#9733;&#9733;&#9733;</div>
                            }
                        </div>
                    </cell-template>
                </grid-column>
                <grid-column field="CreatedOn" title="@Loc["Admin.Catalog.ProductReviews.Fields.CreatedOn"]" width="150" format="{0:G}" min-screen-width="500"/>
                <grid-commands destroy="true" title="@Loc["Admin.Common.Delete"]" width="100"/>
            </admin-grid>
        </div>
        <partial name="Partials/WidgetZone.ReviewsBottom" model="Model"/>
    </div>
    <style>
        .rating {
            position: relative;
            display: flex;
            align-items: center;
            width: 83px;
            height: 19px;
            line-height: 1;
            font-size: 20px;
            margin: 5px 0;
        }

        .rating .rating-ghost {
            z-index: 1;
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 19px;
            white-space: nowrap;
            color: #f0ad4e;
        }

        .rating .rating-real {
            z-index: 2;
            position: absolute;
            top: 0;
            left: 0;
            color: #f0ad4e;
            overflow: hidden;
            white-space: nowrap;
        }
    </style>
}