-
Notifications
You must be signed in to change notification settings - Fork 535
Pages (Topics) CRUD management in Grand.Web.Store #693
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Copilot
wants to merge
11
commits into
develop
Choose a base branch
from
copilot/implement-page-management-ui
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
747506b
feat: add Pages (Topics) management to Grand.Web.Store
Copilot f5bbe6f
fix: address code review comments in PageController
Copilot 7effd7c
feat: add Copy button and action for multistore/unrestricted pages
Copilot 7f0366b
feat: add EN translations for Copy button and Pages store-area actions
Copilot c0dbedf
fix: handle null ReservedEntityUrlSlugs in SeNameService.ValidateSeName
Copilot 7972cb6
feat: two-tab page list — store-specific vs global/multistore pages
Copilot 0093d26
fix: apply server-side pagination (Skip/Take) in StorePagesList and G…
Copilot 052a00d
fix: apply server-side pagination in Grand.Web.Admin PageController L…
Copilot 98c37d9
fix: restore pagination bar in Grand.Web.Admin Page list view
Copilot 71b2789
Fix url.routeurl scheme
KrzysztofPajak ad4e17a
Potential fix for pull request finding
KrzysztofPajak File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
src/Web/Grand.Web.Store/Areas/Store/Views/Page/Create.cshtml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| @model PageModel | ||
| @{ | ||
| //page title | ||
| ViewBag.Title = Loc["Admin.Content.Pages.AddNew"]; | ||
| Layout = Constants.LayoutStore; | ||
| } | ||
| <form asp-area="@Constants.AreaStore" asp-controller="Page" 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-fw fa-file-o"></i> | ||
| @Loc["Admin.Content.Pages.AddNew"] | ||
| <small> | ||
| <i class="fa fa-arrow-circle-left"></i>@Html.ActionLink(Loc["Admin.Content.Pages.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> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| <div class="x_content form"> | ||
| <partial name="Partials/CreateOrUpdate" model="Model"/> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </form> |
60 changes: 60 additions & 0 deletions
60
src/Web/Grand.Web.Store/Areas/Store/Views/Page/Edit.cshtml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| @model PageModel | ||
| @{ | ||
| //page title | ||
| ViewBag.Title = Loc["Admin.Content.Pages.EditPageDetails"]; | ||
| Layout = Constants.LayoutStore; | ||
| } | ||
| <form asp-area="@Constants.AreaStore" asp-controller="Page" asp-action="Edit" 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-fw fa-file-o"></i> | ||
| @Loc["Admin.Content.Pages.EditPageDetails"] - @Model.SystemName | ||
| <small> | ||
| <i class="fa fa-arrow-circle-left"></i>@Html.ActionLink(Loc["Admin.Content.Pages.BackToList"], "List") | ||
| </small> | ||
| </div> | ||
| <div class="actions"> | ||
| <div class="btn-group btn-group-devided"> | ||
| @if (!string.IsNullOrEmpty(Model.SeName)) | ||
| { | ||
| <button type="button" onclick="window.open('@Url.RouteUrl("Page", 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> | ||
| @if (ViewBag.ShowCopyButton == true) | ||
| { | ||
| <button type="submit" form="page-copy-form" class="btn blue"> | ||
| <i class="fa fa-copy"></i> @Loc["Admin.Common.Copy"] | ||
| </button> | ||
| } | ||
| <span id="page-delete" class="btn red"> | ||
| <i class="fa fa-trash-o"></i> @Loc["Admin.Common.Delete"] | ||
| </span> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| <div class="x_content form"> | ||
| <partial name="Partials/CreateOrUpdate" model="Model"/> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </form> | ||
| <admin-delete-confirmation button-id="page-delete"/> | ||
| @if (ViewBag.ShowCopyButton == true) | ||
| { | ||
| <form id="page-copy-form" asp-area="@Constants.AreaStore" asp-controller="Page" asp-action="Copy" method="post"> | ||
| <input type="hidden" name="id" value="@Model.Id"/> | ||
| </form> | ||
| } | ||
167 changes: 167 additions & 0 deletions
167
src/Web/Grand.Web.Store/Areas/Store/Views/Page/List.cshtml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,167 @@ | ||
| @model PageListModel | ||
| @inject AdminAreaSettings adminAreaSettings | ||
| @{ | ||
| //page title | ||
| ViewBag.Title = Loc["Admin.Content.Pages"]; | ||
| 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-fw fa-file-o"></i> | ||
| @Loc["Admin.Content.Pages"] | ||
| </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> | ||
| </div> | ||
| </div> | ||
| <div class="x_content"> | ||
| <div class="form-horizontal"> | ||
| <div class="form-body"> | ||
| <div class="row align-items-end mb-1"> | ||
| <div class="col-md-9 col-sm-12 col-12"> | ||
| <div class="form-group mb-0"> | ||
| <admin-label asp-for="Name" class="d-flex flex-column align-items-start mw-100 px-0 text-left"/> | ||
| <admin-input asp-for="Name"/> | ||
| </div> | ||
| </div> | ||
| <div class="col-md-3 col-sm-12 col-12 mt-md-0 mt-3"> | ||
| <div class="form-actions"> | ||
| <button class="btn btn-success filter-submit" id="search-pages"> | ||
| <i class="fa fa-search"></i> @Loc["Admin.Common.Search"] | ||
| </button> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| <div class="x_content"> | ||
| <admin-tabstrip name="pages-list-tabs" BindGrid="true"> | ||
| <items> | ||
| <tabstrip-item text="@Loc["Admin.Content.Pages.List.StorePages"]" tab-index="0"> | ||
| <content> | ||
| <div id="store-pages-grid"></div> | ||
| </content> | ||
| </tabstrip-item> | ||
| <tabstrip-item text="@Loc["Admin.Content.Pages.List.GlobalPages"]" tab-index="1"> | ||
| <content> | ||
| <div id="global-pages-grid"></div> | ||
| </content> | ||
| </tabstrip-item> | ||
| </items> | ||
| </admin-tabstrip> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
|
|
||
| <script> | ||
| $(document).ready(function () { | ||
| var gridColumns = [{ | ||
| field: "SystemName", | ||
| title: "@Loc["Admin.Content.Pages.Fields.SystemName"]", | ||
| template: '<a class="k-link" href="Edit/#=Id#">#=SystemName#</a>', | ||
| }, { | ||
| field: "Title", | ||
| title: "@Loc["Admin.Content.Pages.Fields.Title"]", | ||
| width: 300, | ||
| template: '<a class="k-link" href="Edit/#=Id#">#=kendo.htmlEncode(Title == null ? "" : Title)#</a>', | ||
| }, { | ||
| field: "IncludeInMenu", | ||
| title: "@Loc["Admin.Content.Pages.Fields.IncludeInMenu"]", | ||
| width: 100, | ||
| headerAttributes: { style: "text-align:center" }, | ||
| attributes: { style: "text-align:center" }, | ||
| template: '# if(IncludeInMenu) {# <i class="fa fa-check" aria-hidden="true" style="color:green"></i> #} else {# <i class="fa fa-times" aria-hidden="true" style="color:red"></i> #} #' | ||
| }, { | ||
| field: "Published", | ||
| title: "@Loc["Admin.Content.Pages.Fields.Published"]", | ||
| width: 100, | ||
| headerAttributes: { style: "text-align:center" }, | ||
| attributes: { style: "text-align:center" }, | ||
| template: '# if(Published) {# <i class="fa fa-check" aria-hidden="true" style="color:green"></i> #} else {# <i class="fa fa-times" aria-hidden="true" style="color:red"></i> #} #' | ||
| }, { | ||
| field: "DisplayOrder", | ||
| title: "@Loc["Admin.Content.Pages.Fields.DisplayOrder"]", | ||
| width: 100 | ||
| }]; | ||
|
|
||
| function makeDataSource(url) { | ||
| return { | ||
| transport: { | ||
| read: { | ||
| url: url, | ||
| type: "POST", | ||
| dataType: "json", | ||
| data: additionalData | ||
| } | ||
| }, | ||
| schema: { | ||
| data: "Data", | ||
| total: "Total", | ||
| errors: "Errors" | ||
| }, | ||
| error: function(e) { | ||
| display_kendoui_grid_error(e); | ||
| this.cancelChanges(); | ||
| }, | ||
| pageSize: @(adminAreaSettings.DefaultGridPageSize), | ||
| serverPaging: true, | ||
| serverFiltering: true, | ||
| serverSorting: true | ||
| }; | ||
| } | ||
|
|
||
| function makeGrid(selector, url) { | ||
| $(selector).kendoGrid({ | ||
| dataSource: makeDataSource(url), | ||
| pageable: { | ||
| refresh: true, | ||
| pageSizes: [@(adminAreaSettings.GridPageSizes)] | ||
| }, | ||
| editable: { | ||
| confirmation: false, | ||
| mode: "inline" | ||
| }, | ||
| scrollable: false, | ||
| columns: gridColumns | ||
| }); | ||
| } | ||
|
|
||
| makeGrid("#store-pages-grid", "@Html.Raw(Url.Action("StorePagesList", "Page", new { area = Constants.AreaStore }))"); | ||
| makeGrid("#global-pages-grid", "@Html.Raw(Url.Action("GlobalPagesList", "Page", new { area = Constants.AreaStore }))"); | ||
| }); | ||
| </script> | ||
|
|
||
| <script> | ||
| $(document).ready(function () { | ||
| $('#search-pages').click(function () { | ||
| var sg = $('#store-pages-grid').data('kendoGrid'); | ||
| if (sg) sg.dataSource.read(); | ||
| var gg = $('#global-pages-grid').data('kendoGrid'); | ||
| if (gg) gg.dataSource.read(); | ||
| return false; | ||
| }); | ||
|
|
||
| $("#@Html.IdFor(model => model.Name)").keydown(function (event) { | ||
| if (event.keyCode == 13) { | ||
| $("#search-pages").click(); | ||
| return false; | ||
| } | ||
| }); | ||
| }); | ||
|
|
||
| function additionalData() { | ||
| var data = { | ||
| Name: $('#@Html.IdFor(model => model.Name)').val() | ||
| }; | ||
| addAntiForgeryToken(data); | ||
| return data; | ||
| } | ||
| </script> |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.