140 lines
6.8 KiB
Plaintext
140 lines
6.8 KiB
Plaintext
@model PollSearchModel
|
|
|
|
@{
|
|
//page title
|
|
ViewBag.PageTitle = T("Admin.ContentManagement.Polls").Text;
|
|
//active menu item (system name)
|
|
NopHtml.SetActiveMenuItemSystemName("Polls");
|
|
}
|
|
|
|
@{
|
|
const string hideSearchBlockAttributeName = "PollsPage.HideSearchBlock";
|
|
var hideSearchBlock = await genericAttributeService.GetAttributeAsync<bool>(await workContext.GetCurrentCustomerAsync(), hideSearchBlockAttributeName);
|
|
}
|
|
|
|
|
|
<div class="content-header clearfix">
|
|
<h1 class="float-left">
|
|
@T("Admin.ContentManagement.Polls")
|
|
</h1>
|
|
<div class="float-right">
|
|
<a asp-action="Create" class="btn btn-primary">
|
|
<i class="fas fa-square-plus"></i>
|
|
@T("Admin.Common.AddNew")
|
|
</a>
|
|
@await Component.InvokeAsync(typeof(AdminWidgetViewComponent), new { widgetZone = AdminWidgetZones.PollListButtons, additionalData = Model })
|
|
</div>
|
|
</div>
|
|
|
|
<section class="content">
|
|
<div class="container-fluid">
|
|
<div class="form-horizontal">
|
|
<div class="cards-group">
|
|
|
|
@*hide the entire search block if no elements are displayed*@
|
|
<div class="card card-default card-search" @(Model.HideStoresList ? Html.Raw("style=\"display:none\"") : null)>
|
|
<div class="card-body">
|
|
<div class="row search-row @(!hideSearchBlock ? "opened" : "")" data-hideAttribute="@hideSearchBlockAttributeName">
|
|
<div class="search-text">@T("Admin.Common.Search")</div>
|
|
<div class="icon-search"><i class="fas fa-magnifying-glass" aria-hidden="true"></i></div>
|
|
<div class="icon-collapse"><i class="far fa-angle-@(!hideSearchBlock ? "up" : "down")" aria-hidden="true"></i></div>
|
|
</div>
|
|
|
|
<div class="search-body @(hideSearchBlock ? "closed" : "")">
|
|
<div class="row">
|
|
<div class="col-md-6">
|
|
<div class="form-group row">
|
|
<div class="col-md-4">
|
|
<nop-label asp-for="SearchStoreId" />
|
|
</div>
|
|
<div class="col-md-8">
|
|
<nop-select asp-for="SearchStoreId" asp-items="Model.AvailableStores" />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-md-8 offset-md-4">
|
|
<button type="button" id="search-poll" class="btn btn-primary btn-search">
|
|
<i class="fas fa-magnifying-glass"></i>
|
|
@T("Admin.Common.Search")
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card card-default">
|
|
<div class="card-body">
|
|
<nop-doc-reference asp-string-resource="@T("Admin.Documentation.Reference.Polls", Docs.Polls + Utm.OnAdmin)" />
|
|
|
|
@await Html.PartialAsync("Table", new DataTablesModel
|
|
{
|
|
Name = "polls-grid",
|
|
UrlRead = new DataUrl("List", "Poll", null),
|
|
SearchButtonId = "search-poll",
|
|
Length = Model.PageSize,
|
|
LengthMenu = Model.AvailablePageSizes,
|
|
Filters = new List<FilterParameter>
|
|
{
|
|
new FilterParameter(nameof(Model.SearchStoreId))
|
|
},
|
|
ColumnCollection = new List<ColumnProperty>
|
|
{
|
|
new ColumnProperty(nameof(PollModel.Name))
|
|
{
|
|
Title = T("Admin.ContentManagement.Polls.Fields.Name").Text
|
|
},
|
|
new ColumnProperty(nameof(PollModel.LanguageName))
|
|
{
|
|
Title = T("Admin.ContentManagement.Polls.Fields.Language").Text,
|
|
Width = "100"
|
|
},
|
|
new ColumnProperty(nameof(PollModel.DisplayOrder))
|
|
{
|
|
Title = T("Admin.ContentManagement.Polls.Fields.DisplayOrder").Text,
|
|
Width = "100",
|
|
ClassName = NopColumnClassDefaults.CenterAll
|
|
},
|
|
new ColumnProperty(nameof(PollModel.Published))
|
|
{
|
|
Title = T("Admin.ContentManagement.Polls.Fields.Published").Text,
|
|
Width = "100",
|
|
ClassName = NopColumnClassDefaults.CenterAll,
|
|
Render = new RenderBoolean()
|
|
},
|
|
new ColumnProperty(nameof(PollModel.ShowOnHomepage))
|
|
{
|
|
Title = T("Admin.ContentManagement.Polls.Fields.ShowOnHomepage").Text,
|
|
Width = "100",
|
|
ClassName = NopColumnClassDefaults.CenterAll,
|
|
Render = new RenderBoolean()
|
|
},
|
|
new ColumnProperty(nameof(PollModel.StartDateUtc))
|
|
{
|
|
Title = T("Admin.ContentManagement.Polls.Fields.StartDate").Text,
|
|
Width = "150",
|
|
Render = new RenderDate()
|
|
},
|
|
new ColumnProperty(nameof(PollModel.EndDateUtc))
|
|
{
|
|
Title = T("Admin.ContentManagement.Polls.Fields.EndDate").Text,
|
|
Width = "150",
|
|
Render = new RenderDate()
|
|
},
|
|
new ColumnProperty(nameof(PollModel.Id))
|
|
{
|
|
Title = T("Admin.Common.Edit").Text,
|
|
Width = "100",
|
|
ClassName = NopColumnClassDefaults.Button,
|
|
Render = new RenderButtonEdit(new DataUrl("~/Admin/Poll/Edit"))
|
|
}
|
|
}
|
|
})
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section> |