-
Notifications
You must be signed in to change notification settings - Fork 443
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improvement - Category picture - use localizable alternate text and t…
…itle attributes for a picture
- Loading branch information
1 parent
7574ca4
commit 50334c7
Showing
10 changed files
with
280 additions
and
37 deletions.
There are no files selected for viewing
87 changes: 87 additions & 0 deletions
87
src/Web/Grand.Web.Admin/Areas/Admin/Views/Category/PicturePopup.cshtml
This file contains 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,87 @@ | ||
@using Microsoft.AspNetCore.Mvc.Razor; | ||
|
||
@model CategoryModel.PictureModel | ||
@{ | ||
Layout = Grand.Web.Admin.Extensions.Constants.Layout_AdminPopup; | ||
//page title | ||
ViewBag.Title = Loc["Admin.Catalog.Categories.Picture"]; | ||
} | ||
<form asp-area="@Constants.AreaAdmin" asp-controller="Category" asp-action="PicturePopup" enctype="multipart/form-data" method="post" | ||
asp-route-CategoryId="@Context.Request.Query["CategoryId"]"> | ||
|
||
|
||
<!-- #region languages template --> | ||
@{ Func<int, HelperResult> template = @<div class="form-body"> | ||
<div class="form-group"> | ||
<admin-label asp-for="@Model.Locales[item].AltAttribute" class="col-sm-3 control-label" /> | ||
<div class="col-md-9 col-sm-9"> | ||
<admin-input asp-for="@Model.Locales[item].AltAttribute" /> | ||
<span asp-validation-for="@Model.Locales[item].AltAttribute"></span> | ||
</div> | ||
</div> | ||
<div class="form-group"> | ||
<admin-label asp-for="@Model.Locales[item].TitleAttribute" class="col-sm-3 control-label" /> | ||
<div class="col-md-9 col-sm-9"> | ||
<admin-input asp-for="@Model.Locales[item].TitleAttribute" /> | ||
<span asp-validation-for="@Model.Locales[item].TitleAttribute"></span> | ||
</div> | ||
</div> | ||
<input asp-for="@Model.Locales[item].LanguageId" type="hidden" /> | ||
</div>; | ||
} | ||
|
||
<div asp-validation-summary="All"></div> | ||
<input asp-for="CategoryId" type="hidden" /> | ||
<input asp-for="Id" type="hidden" /> | ||
<input asp-for="PictureUrl" type="hidden" /> | ||
<div class="row"> | ||
<div class="col-md-12"> | ||
<div class="x_panel light form-fit"> | ||
<div class="x_content form"> | ||
<div class="form-horizontal"> | ||
<div class="form-body"> | ||
<div class="form-group"> | ||
<admin-label asp-for="PictureUrl" /> | ||
<div class="col-md-9 col-sm-9"> | ||
<a href="@Model.PictureUrl" target="_blank"><img src="@Model.PictureUrl" width="150" /></a> | ||
</div> | ||
</div> | ||
<localized-editor localized-template=template name="picturevalue-localized" language-ids=@Model.Locales.Select(c=>c.LanguageId).ToList()> | ||
<div class="form-body"> | ||
<div class="form-group"> | ||
<admin-label asp-for="AltAttribute" class="col-sm-3 control-label" /> | ||
<div class="col-md-9 col-sm-9"> | ||
<admin-input asp-for="AltAttribute" /> | ||
<span asp-validation-for="AltAttribute"></span> | ||
</div> | ||
</div> | ||
<div class="form-group"> | ||
<admin-label asp-for="TitleAttribute" class="col-sm-3 control-label" /> | ||
<div class="col-md-9 col-sm-9"> | ||
<admin-input asp-for="TitleAttribute" /> | ||
<span asp-validation-for="TitleAttribute"></span> | ||
</div> | ||
</div> | ||
</div> | ||
</localized-editor> | ||
<div class="form-actions"> | ||
<div class="row"> | ||
<div class="offset-md-3 offset-sm-3 col-md-9 col-sm-9"> | ||
<button class="k-button" type="submit" name="save"><i class="fa fa-check"></i>@Loc["Admin.Common.Save"] </button> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
@if (ViewBag.RefreshPage == true) | ||
{ | ||
<script> | ||
window.close(); | ||
</script> | ||
} | ||
</form> |
This file contains 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 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 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 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 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 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
Oops, something went wrong.