Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "9.0.100",
"version": "8.0.119",
"rollForward": "latestFeature",
"allowPrerelease": false
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@ public static IEnumerable<DefaultPermission> DefaultPermissions()
StandardPermission.ManageShipments,
StandardPermission.ManageMerchandiseReturns,
StandardPermission.ManageCheckoutAttribute,
StandardPermission.ManageReports
StandardPermission.ManageReports,
StandardPermission.ManageBlog
]
},

Expand Down
38 changes: 38 additions & 0 deletions src/Web/Grand.Web.Store/Areas/Store/Views/Blog/Create.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
@model BlogPostModel
@{
//page title
ViewBag.Title = Loc["Admin.Content.Blog.BlogPosts.AddNew"];
Layout = Constants.LayoutStore;
}
<form asp-area="@Constants.AreaStore" asp-controller="Blog" asp-action="Create" method="post">

<div class="row">
<div class="col-md-12">
<div class="x_panel light form-fit">
<div class="x_title">
<div class="caption">
<i class="fa fa-comment"></i>
@Loc["Admin.Content.Blog.BlogPosts.AddNew"]
<small>
<i class="fa fa-arrow-circle-left"></i>@Html.ActionLink(Loc["Admin.Content.Blog.BlogPosts.BackToList"], "List")
</small>
</div>
<div class="actions">
<div class="btn-group btn-group-devided">
<button class="btn btn-success" type="submit" name="save">
<i class="fa fa-check"></i> @Loc["Admin.Common.Save"]
</button>
<button class="btn btn-success" type="submit" name="save-continue">
<i class="fa fa-check-circle"></i> @Loc["Admin.Common.SaveContinue"]
</button>
<vc:admin-widget widget-zone="blog_details_buttons" additional-data="null"/>
</div>
</div>
</div>
<div class="x_content form">
<partial name="Partials/CreateOrUpdate" model="Model"/>
</div>
</div>
</div>
</div>
</form>
46 changes: 46 additions & 0 deletions src/Web/Grand.Web.Store/Areas/Store/Views/Blog/Edit.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
@model BlogPostModel
@{
//page title
ViewBag.Title = Loc["Admin.Content.Blog.BlogPosts.EditBlogPostDetails"];
Layout = Constants.LayoutStore;
}
<form asp-area="@Constants.AreaStore" asp-controller="Blog" asp-action="Edit" method="post" id="blog-edit">

<div class="row">
<div class="col-md-12">
<div class="x_panel light form-fit">
<div class="x_title">
<div class="caption">
<i class="fa fa-comment"></i>
@Loc["Admin.Content.Blog.BlogPosts.EditBlogPostDetails"] - @Model.Title
<small>
<i class="fa fa-arrow-circle-left"></i>@Html.ActionLink(Loc["Admin.Content.Blog.BlogPosts.BackToList"], "List")
</small>
</div>
<div class="actions">
<div class="btn-group btn-group-devided">
<button type="button" onclick="window.open('@Url.RouteUrl("BlogPost", new { Model.SeName })','_blank');" class="btn purple">
<i class="fa fa-eye"></i>
@Loc["Admin.Common.Preview"]
</button>
<button class="btn btn-success" type="submit" name="save">
<i class="fa fa-check"></i> @Loc["Admin.Common.Save"]
</button>
<button class="btn btn-success" type="submit" name="save-continue">
<i class="fa fa-check-circle"></i> @Loc["Admin.Common.SaveContinue"]
</button>
<span id="blogpost-delete" class="btn red">
<i class="fa fa-trash-o"></i> @Loc["Admin.Common.Delete"]
</span>
</div>
</div>
</div>
<vc:admin-widget widget-zone="blog_details_buttons" additional-data="Model"/>
<div class="x_content form">
<partial name="Partials/CreateOrUpdate" model="Model"/>
</div>
</div>
</div>
</div>
</form>
<admin-delete-confirmation button-id="blogpost-delete"/>
102 changes: 102 additions & 0 deletions src/Web/Grand.Web.Store/Areas/Store/Views/Blog/List.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
@inject AdminAreaSettings adminAreaSettings
@{
//page title
ViewBag.Title = Loc["Admin.Content.Blog.BlogPosts"];
Layout = Constants.LayoutStore;
}

<div class="row">
<div class="col-md-12">
<div class="x_panel light form-fit">
<div class="x_title">
<div class="caption">
<i class="fa fa-comment"></i>
@Loc["Admin.Content.Blog.BlogPosts"]
</div>
<div class="actions btn-group btn-group-devided">
<a href="@Url.Action("Create", new { area = Constants.AreaStore })" class="btn green">
<i class="fa fa-plus"></i><span class="d-none d-sm-inline"> @Loc["Admin.Common.AddNew"] </span>
</a>
<vc:admin-widget widget-zone="blog_list_buttons" additional-data="null" />
</div>
</div>
<div class="x_content form">
<div class="form-horizontal">
<div class="form-body">
<div class="x_content">
<div id="blogpost-grid"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function () {
$("#blogpost-grid").kendoGrid({
dataSource: {
transport: {
read: {
url: "@Html.Raw(Url.Action("List", "Blog", new { area = Constants.AreaStore }))",
type: "POST",
dataType: "json",
data: addAntiForgeryToken
}
},
schema: {
data: "Data",
total: "Total",
errors: "Errors"
},
error: function(e) {
display_kendoui_grid_error(e);
// Cancel the changes
this.cancelChanges();
},
pageSize: @(adminAreaSettings.DefaultGridPageSize),
serverPaging: true,
serverFiltering: true,
serverSorting: true
},
pageable: {
refresh: true,
pageSizes: [@(adminAreaSettings.GridPageSizes)]
},
editable: {
confirmation: false,
mode: "inline"
},
scrollable: false,
columns: [{
field: "Title",
title: "@Loc["Admin.Content.Blog.BlogPosts.Fields.Title"]",
width: 400,
template: '<a class="k-link" href="Edit/#=Id#">#=kendo.htmlEncode(Title)#</a>',
}, {
field: "Comments",
title: "@Loc["Admin.Content.Blog.BlogPosts.Fields.Comments"]",
width: 200,
template: '<a class="k-link" href="Edit/#=Id#">@Loc["Admin.Content.Blog.BlogPosts.Fields.Comments"] - #=Comments# </a>'
}, {
field: "StartDate",
title: "@Loc["Admin.Content.Blog.BlogPosts.Fields.StartDate"]",
width: 150,
type: "date",
format: "{0:G}"
}, {
field: "EndDate",
title: "@Loc["Admin.Content.Blog.BlogPosts.Fields.EndDate"]",
width: 150,
type: "date",
format: "{0:G}"
}, {
field: "CreatedOn",
title: "@Loc["Admin.Content.Blog.BlogPosts.Fields.CreatedOn"]",
width: 200,
type: "date",
format: "{0:G}"
}]
});
});
</script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
@model BlogPostModel
@inject AdminAreaSettings adminAreaSettings
@if (!string.IsNullOrEmpty(Model.Id))
{
<div class="panel panel-default">
<vc:admin-widget widget-zone="blog_details_comments_top" additional-data="Model"/>
<div class="panel-body">
<div id="comments-grid"></div>
</div>
<vc:admin-widget widget-zone="blog_details_comments_bottom" additional-data="Model"/>
</div>

<script>
$(document).ready(function () {
$("#comments-grid").kendoGrid({
dataSource: {
transport: {
read: {
url: "@Url.Action("Comments", "Blog", new { filterByBlogPostId = Model.Id, area = Constants.AreaStore })",
type: "POST",
dataType: "json",
data: addAntiForgeryToken
},
destroy: {
url: "@Html.Raw(Url.Action("CommentDelete", "Blog", new { area = Constants.AreaStore }))",
type: "POST",
dataType: "json",
data: addAntiForgeryToken
}
},
schema: {
data: "Data",
total: "Total",
errors: "Errors",
model: {
id: "Id",
fields: {
//do not implicitly specify all fields
//we do it only for fields which implicitly require it
//otherwise, they'll be formatted wrong way
CreatedOn: {type: "date" }
}
}
},
error: function(e) {
display_kendoui_grid_error(e);
// Cancel the changes
this.cancelChanges();
},
pageSize: @(adminAreaSettings.DefaultGridPageSize),
serverPaging: true,
serverFiltering: true,
serverSorting: true
},
pageable: {
refresh: true,
pageSizes: [@(adminAreaSettings.GridPageSizes)]
},
editable: {
confirmation: true,
mode: "inline"
},
scrollable: false,
columns: [{
field: "CustomerId",
title: "@Loc["Admin.Content.Blog.Comments.Fields.Customer"]",
width: 200,
template: '<a class="k-link" href="@Url.Action("Edit", "Customer", new { area = Constants.AreaStore })/#=CustomerId#">#:kendo.htmlEncode(CustomerInfo)#</a>'
}, {
field: "Comment",
title: "@Loc["Admin.Content.Blog.Comments.Fields.Comment"]",
encoded: false
}, {
field: "CreatedOn",
title: "@Loc["Admin.Content.Blog.Comments.Fields.CreatedOn"]",
width: 200,
type: "date",
format: "{0:G}"
}, {
command: { name: "destroy", text: "@Loc["Admin.Common.Delete"]" },
title: "@Loc["Admin.Common.Delete"]",
width: 100
}]
});
});
</script>
}
else
{
<div class="note note-info">
@Loc["Admin.Content.Blog.BlogPosts.SaveBeforeEdit"]
</div>
}
Loading
Loading