Browse Source

Used IHtmlLocalizer in the view.

pull/179/head
Halil İbrahim Kalkan 9 years ago
parent
commit
fefae25f7f
  1. 2
      src/AbpDesk/AbpDesk.Web.Mvc/AbpDeskWebMvcModule.cs
  2. 16
      src/Volo.Abp.Identity.Web/Areas/Identity/Views/Users/Index.cshtml
  3. 29
      src/Volo.Abp.Identity.Web/wwwroot/modules/identity/views/users/index.js

2
src/AbpDesk/AbpDesk.Web.Mvc/AbpDeskWebMvcModule.cs

@ -56,7 +56,7 @@ namespace AbpDesk.Web.Mvc
//services.Configure<RemoteServiceOptions>(configuration); //Needed when we use Volo.Abp.Identity.HttpApi.Client //services.Configure<RemoteServiceOptions>(configuration); //Needed when we use Volo.Abp.Identity.HttpApi.Client
services.AddMvc(); services.AddMvc().AddViewLocalization(); //TODO: Move to AbpAspNetCoreMvcModule!
services.AddAssemblyOf<AbpDeskWebMvcModule>(); services.AddAssemblyOf<AbpDeskWebMvcModule>();

16
src/Volo.Abp.Identity.Web/Areas/Identity/Views/Users/Index.cshtml

@ -1,6 +1,6 @@
@using Microsoft.Extensions.Localization @using Microsoft.AspNetCore.Mvc.Localization
@using Volo.Abp.Identity.Web.Areas.Identity.Localization.Resource @using Volo.Abp.Identity.Web.Areas.Identity.Localization.Resource
@inject IStringLocalizer<IdentityResource> Localizer @inject IHtmlLocalizer<IdentityResource> L
@section styles { @section styles {
<!-- TODO: Use minified on production, normal in development --> <!-- TODO: Use minified on production, normal in development -->
<link rel="stylesheet" type="text/css" href="~/modules/identity/libs/datatables/datatables.css" /> <link rel="stylesheet" type="text/css" href="~/modules/identity/libs/datatables/datatables.css" />
@ -15,12 +15,12 @@
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
<h2>@Localizer["Users"]</h2> <h2>@L["Users"]</h2>
</div> </div>
<div class="col-md-6 text-right"> <div class="col-md-6 text-right">
<!-- Button trigger modal --> <!-- Button trigger modal -->
<button type="button" class="btn btn-primary create-user" data-toggle="modal"> <button type="button" class="btn btn-primary create-user" data-toggle="modal">
@Localizer["CreateUser"] @L["CreateUser"]
</button> </button>
</div> </div>
</div> </div>
@ -28,10 +28,10 @@
<table id="IdentityUsersTable" class="table table-striped table-bordered table-hover nowrap"> <table id="IdentityUsersTable" class="table table-striped table-bordered table-hover nowrap">
<thead> <thead>
<tr> <tr>
<th>@Localizer["Actions"]</th> <th>@L["Actions"]</th>
<th>@Localizer["UserName"]</th> <th>@L["UserName"]</th>
<th>@Localizer["EmailAddress"]</th> <th>@L["EmailAddress"]</th>
<th>@Localizer["PhoneNumber"]</th> <th>@L["PhoneNumber"]</th>
</tr> </tr>
</thead> </thead>
</table> </table>

29
src/Volo.Abp.Identity.Web/wwwroot/modules/identity/views/users/index.js

@ -164,19 +164,20 @@ $.fn.serializeFormToObject = function () {
var currentLanguage = 'English'; //TODO: Get from current culture! var currentLanguage = 'English'; //TODO: Get from current culture!
$.extend(true, $.fn.dataTable.defaults, { //TODO: This does not work!
language: { //$.extend(true, $.fn.dataTable.defaults, {
url: '/modules/identity/libs/datatables/localizations/' + currentLanguage + '.json' // language: {
}, // url: '/modules/identity/libs/datatables/localizations/' + currentLanguage + '.json'
lengthMenu: [5, 10, 25, 50, 100, 250, 500], // },
pageLength: 10, // lengthMenu: [5, 10, 25, 50, 100, 250, 500],
paging: true, // pageLength: 10,
serverSide: true, // paging: true,
processing: true, // serverSide: true,
responsive: true, // processing: true,
pagingType: "bootstrap_full_number", // responsive: true,
dom: 'rt<"bottom"ilp><"clear">', // pagingType: "bootstrap_full_number",
order: [] // dom: 'rt<"bottom"ilp><"clear">',
}); // order: []
//});
})(jQuery); })(jQuery);
Loading…
Cancel
Save