@model Nop.Web.Models.Catalog.ProductsByTagModel
@{
    Layout = "~/Views/Shared/_ColumnsThree.cshtml";

    //title
    Html.AddTitleParts(string.Format(T("PageTitle.ProductsByTag").Text, Model.TagName));
}
@using Nop.Core;
@using Nop.Core.Infrastructure;
@using Nop.Web;
@using Nop.Web.Framework.UI;
@using Nop.Web.Models.Catalog;

<div class="producttag-page">
    <div class="page-title">
        <h1>@String.Format(T("Products.Tags.ProductsTaggedWith").Text, Model.TagName)</h1>
    </div>
    <div class="clear">
    </div>
        
    
    
    @*view mode*@
    @if (Model.AllowProductViewModeChanging && Model.Products.Count > 0)
    {
        <div class="product-viewmode">
            @Html.LabelFor(model => model.PagingFilteringContext.ViewMode)
            @Html.DropDownList("products-viewmode", Model.AvailableViewModes, new { onchange = "setLocation(this.value);" })
        </div>
    }   
    
    
    @*sorting*@
    @if (Model.AllowProductFiltering && Model.Products.Count > 0)
    {
        <div class="product-sorting">
            @Html.LabelFor(model => model.PagingFilteringContext.OrderBy)
            @Html.DropDownList("products-orderby", Model.AvailableSortOptions, new { onchange = "setLocation(this.value);" })
        </div>
    }
    <div class="clear">
    </div>
    
        
    @*product list*@
    @if (Model.Products.Count > 0)
    {
        if (Model.PagingFilteringContext.ViewMode == "list")
        {
            @*list mode*@
            <div class="product-list">
            @foreach (var product in Model.Products)
            {
                <div class="item-box">
                    @Html.Partial("_ProductBox", product)
                </div>
            }
            </div>     
        }
        else
        {
            @*grid mode*@
            <div class="product-grid">
                @(Html.DataList<ProductModel>(Model.Products, 2,
                    @<div class="item-box">
                        @Html.Partial("_ProductBox", @item)
                    </div>
                ))
            </div>
        }
    }
    
            <div class="clear">
            </div>   
    
    @*TODO allow customer to select page size*@
    
    <div class="pager">
    @Html.Pager(Model.PagingFilteringContext).QueryParam("pagenumber")
    </div>
</div>
