Browse Source

Added role index page.

pull/184/head
Alper Ebicoglu 8 years ago
parent
commit
bf7572acb7
  1. 6
      Volo.Abp.sln
  2. 6
      src/Volo.Abp.Identity.Web/Localization/Resources/AbpIdentity/en.json
  3. 6
      src/Volo.Abp.Identity.Web/Localization/Resources/AbpIdentity/tr.json
  4. 2
      src/Volo.Abp.Identity.Web/Navigation/AbpIdentityWebMainMenuContributor.cs
  5. 42
      src/Volo.Abp.Identity.Web/Pages/Identity/Roles/Index.cshtml
  6. 11
      src/Volo.Abp.Identity.Web/Pages/Identity/Roles/Index.cshtml.cs
  7. 2
      src/Volo.Abp.Identity.Web/Pages/Identity/Users/Index.cshtml
  8. 13
      src/Volo.Abp.Identity.Web/Volo.Abp.Identity.Web.csproj
  9. 21
      src/Volo.Abp.Identity.Web/wwwroot/modules/identity/views/roles/index.css
  10. 6
      src/Volo.Abp.Identity.Web/wwwroot/modules/identity/views/roles/index.es5.js
  11. 1
      src/Volo.Abp.Identity.Web/wwwroot/modules/identity/views/roles/index.es5.min.js
  12. 79
      src/Volo.Abp.Identity.Web/wwwroot/modules/identity/views/roles/index.js
  13. 38
      src/Volo.Abp.Identity.Web/wwwroot/modules/identity/views/roles/index.less
  14. 1
      src/Volo.Abp.Identity.Web/wwwroot/modules/identity/views/roles/index.min.css

6
Volo.Abp.sln

@ -1,7 +1,7 @@
 
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15 # Visual Studio 15
VisualStudioVersion = 15.0.27130.0 VisualStudioVersion = 15.0.27130.2010
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6}"
EndProject EndProject
@ -198,9 +198,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Timing", "src\Volo
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.UI", "src\Volo.Abp.UI\Volo.Abp.UI.csproj", "{4AFAFAF8-06FB-48D4-AFA6-B32215584E96}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.UI", "src\Volo.Abp.UI\Volo.Abp.UI.csproj", "{4AFAFAF8-06FB-48D4-AFA6-B32215584E96}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.UI.Navigation", "src\Volo.Abp.UI.Navigation\Volo.Abp.UI.Navigation.csproj", "{6F80DD0F-D91C-4A69-A20E-BB687036EFA8}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.UI.Navigation", "src\Volo.Abp.UI.Navigation\Volo.Abp.UI.Navigation.csproj", "{6F80DD0F-D91C-4A69-A20E-BB687036EFA8}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.UI.Navigation.Tests", "test\Volo.Abp.UI.Navigation.Tests\Volo.Abp.UI.Navigation.Tests.csproj", "{975056D6-0B2D-43BA-9BF8-0E937581F873}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.UI.Navigation.Tests", "test\Volo.Abp.UI.Navigation.Tests\Volo.Abp.UI.Navigation.Tests.csproj", "{975056D6-0B2D-43BA-9BF8-0E937581F873}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution

6
src/Volo.Abp.Identity.Web/Localization/Resources/AbpIdentity/en.json

@ -16,6 +16,10 @@
"Password": "Password", "Password": "Password",
"UserDeletionConfirmationMessage": "User '{0}' will be deleted. Do you confirm that?", "UserDeletionConfirmationMessage": "User '{0}' will be deleted. Do you confirm that?",
"TwoFactorVerification": "Two factor verification", "TwoFactorVerification": "Two factor verification",
"AccountLockoutOnFailedLoginAttempts": "Locking account after failed login attempts" "AccountLockoutOnFailedLoginAttempts": "Locking account after failed login attempts",
"NewRole": "New role",
"RoleName": "Role name",
"CreationTime": "Creation time"
} }
} }

6
src/Volo.Abp.Identity.Web/Localization/Resources/AbpIdentity/tr.json

@ -16,6 +16,10 @@
"Password": "Şifre", "Password": "Şifre",
"UserDeletionConfirmationMessage": "{0} kullanıcısı silinecektir. Onaylıyor musunuz?", "UserDeletionConfirmationMessage": "{0} kullanıcısı silinecektir. Onaylıyor musunuz?",
"TwoFactorVerification": "İki aşamalı doğrumala", "TwoFactorVerification": "İki aşamalı doğrumala",
"AccountLockoutOnFailedLoginAttempts": "Başarısız giriş denemeleri sonrası hesabı kilitleme" "AccountLockoutOnFailedLoginAttempts": "Başarısız giriş denemeleri sonrası hesabı kilitleme",
"NewRole": "Yeni rol",
"RoleName": "Rol adı",
"CreationTime": "Oluşturma zamanı"
} }
} }

2
src/Volo.Abp.Identity.Web/Navigation/AbpIdentityWebMainMenuContributor.cs

@ -16,6 +16,8 @@ namespace Volo.Abp.Identity.Web.Navigation
.AddItem( .AddItem(
new ApplicationMenuItem("Identity", "Identity") new ApplicationMenuItem("Identity", "Identity")
.AddItem(new ApplicationMenuItem("Users", "Users", url: "/Identity/Users")) .AddItem(new ApplicationMenuItem("Users", "Users", url: "/Identity/Users"))
.AddItem(new ApplicationMenuItem("Roles", "Roles", url: "/Identity/Roles"))
); );
return Task.CompletedTask; return Task.CompletedTask;

42
src/Volo.Abp.Identity.Web/Pages/Identity/Roles/Index.cshtml

@ -0,0 +1,42 @@
@page
@model Volo.Abp.Identity.Web.Pages.Identity.Roles.IndexModel
@using Microsoft.AspNetCore.Mvc.Localization
@using Volo.Abp.Identity.Web.Localization.Resources.AbpIdentity
@inject IHtmlLocalizer<IdentityResource> L
@section styles {
<link rel="stylesheet" type="text/css" href="~/modules/identity/views/roles/index.css" />
}
@section scripts {
<script type="text/javascript" src="~/modules/identity/helpers/jquery.js"></script>
<script type="text/javascript" src="~/modules/identity/helpers/datatables.extensions.js"></script>
<script type="text/javascript" src="~/modules/identity/helpers/ResourceLoader.js"></script>
<script type="text/javascript" src="~/modules/identity/helpers/ModalManager.js"></script>
<script type="text/javascript" src="~/modules/identity/views/roles/index.js"></script>
}
<abp-card id="IdentityRolesWrapper">
<abp-card-header>
<div class="row">
<div class="col-md-6">
<h2>@L["Roles"]</h2>
</div>
<div class="col-md-6 text-right">
<button type="button" class="btn btn-primary" v-on:click="openCreateModal">
<i class="fa fa-plus" aria-hidden="true"></i>
@L["NewRole"]
</button>
</div>
</div>
</abp-card-header>
<abp-card-body>
<table class="table table-striped nowrap">
<thead>
<tr>
<th>@L["Actions"]</th>
<th>@L["RoleName"]</th>
</tr>
</thead>
</table>
</abp-card-body>
</abp-card>

11
src/Volo.Abp.Identity.Web/Pages/Identity/Roles/Index.cshtml.cs

@ -0,0 +1,11 @@
using Volo.Abp.AspNetCore.Mvc.RazorPages;
namespace Volo.Abp.Identity.Web.Pages.Identity.Roles
{
public class IndexModel : AbpPageModel
{
public void OnGet()
{
}
}
}

2
src/Volo.Abp.Identity.Web/Pages/Identity/Users/Index.cshtml

@ -34,7 +34,7 @@
<thead> <thead>
<tr> <tr>
<th>@L["Actions"]</th> <th>@L["Actions"]</th>
<th>@L["UserName"]</th> <th>@L["RoleName"]</th>
<th>@L["EmailAddress"]</th> <th>@L["EmailAddress"]</th>
<th>@L["PhoneNumber"]</th> <th>@L["PhoneNumber"]</th>
</tr> </tr>

13
src/Volo.Abp.Identity.Web/Volo.Abp.Identity.Web.csproj

@ -16,6 +16,19 @@
<EmbeddedResource Include="Localization\Resources\**\*.json" /> <EmbeddedResource Include="Localization\Resources\**\*.json" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Content Remove="Pages\Identity\Roles\Index.cshtml" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Remove="wwwroot\modules\identity\views\roles\index.css" />
<EmbeddedResource Remove="wwwroot\modules\identity\views\roles\index.es5.js" />
<EmbeddedResource Remove="wwwroot\modules\identity\views\roles\index.es5.min.js" />
<EmbeddedResource Remove="wwwroot\modules\identity\views\roles\index.js" />
<EmbeddedResource Remove="wwwroot\modules\identity\views\roles\index.less" />
<EmbeddedResource Remove="wwwroot\modules\identity\views\roles\index.min.css" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Volo.Abp.AspNetCore.Mvc.UI.Bootstrap\Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.csproj" /> <ProjectReference Include="..\Volo.Abp.AspNetCore.Mvc.UI.Bootstrap\Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.csproj" />
<ProjectReference Include="..\Volo.Abp.Identity.Application.Contracts\Volo.Abp.Identity.Application.Contracts.csproj" /> <ProjectReference Include="..\Volo.Abp.Identity.Application.Contracts\Volo.Abp.Identity.Application.Contracts.csproj" />

21
src/Volo.Abp.Identity.Web/wwwroot/modules/identity/views/roles/index.css

@ -0,0 +1,21 @@
.dataTable {
width: 100% !important;
border-spacing: 0 !important;
}
.table td,
.table th {
padding: 8px 10px;
}
.dataTable tbody tr td button {
cursor: pointer;
}
.dataTable tbody tr td div.dropdown ul.dropdown-menu li {
cursor: pointer;
padding: 5px;
}
.dataTable tbody tr td div.dropdown ul.dropdown-menu li a {
display: block;
}
.dataTable tbody tr td div.dropdown ul.dropdown-menu li:hover {
background: #f4f5f8;
}

6
src/Volo.Abp.Identity.Web/wwwroot/modules/identity/views/roles/index.es5.js

@ -0,0 +1,6 @@
'use strict';
$(function () {
$('#IdentityUsersTable').DataTable();
});

1
src/Volo.Abp.Identity.Web/wwwroot/modules/identity/views/roles/index.es5.min.js

@ -0,0 +1 @@
"use strict";$(function(){$("#IdentityUsersTable").DataTable()});

79
src/Volo.Abp.Identity.Web/wwwroot/modules/identity/views/roles/index.js

@ -0,0 +1,79 @@
(function () {
var l = abp.localization.getResource('AbpIdentity');
var _identityRoleAppService = volo.abp.identity.identityRole;
var _editModal = new abp.ModalManager({
viewUrl: abp.appPath + 'Identity/Roles/EditModal'
});
var _createModal = new abp.ModalManager({
viewUrl: abp.appPath + 'Identity/Roles/CreateModal'
});
$(function () {
var _$wrapper = $('#IdentityRolesWrapper');
var _$table = _$wrapper.find('table');
var _dataTable = _$table.DataTable({
order: [[1, "asc"]],
ajax: abp.libs.datatables.createAjax(_identityRoleAppService.getList),
columnDefs: [
{
targets: 0,
data: null,
orderable: false,
autoWidth: false,
defaultContent: '',
rowAction: {
text: '<i class="fa fa-cog"></i> ' + l('Actions') + ' <span class="caret"></span>',
items:
[
{
text: l('Edit'),
visible: function () {
return true;
},
action: function (data) {
_editModal.open({
id: data.record.id
});
}
},
{
text: l('Delete'),
visible: function () {
return true;
},
action: function (data) {
if (confirm(l('UserDeletionConfirmationMessage', data.record.userName))) {
_identityRoleAppService
.delete(data.record.id)
.then(function () {
_dataTable.ajax.reload();
});
}
}
}
]
}
},
{
targets: 1,
data: "name"
}
]
});
_createModal.onResult(function () {
_dataTable.ajax.reload();
});
_editModal.onResult(function () {
_dataTable.ajax.reload();
});
});
})();

38
src/Volo.Abp.Identity.Web/wwwroot/modules/identity/views/roles/index.less

@ -0,0 +1,38 @@
.dataTable {
width: 100% !important;
border-spacing: 0 !important;
}
.table td, .table th {
padding: 8px 10px;
}
.dataTable {
tbody {
tr {
td {
button {
cursor: pointer;
}
div.dropdown {
ul.dropdown-menu {
li {
cursor: pointer;
padding: 5px;
a {
display: block;
}
}
li:hover {
background: #f4f5f8;
}
}
}
}
}
}
}

1
src/Volo.Abp.Identity.Web/wwwroot/modules/identity/views/roles/index.min.css

@ -0,0 +1 @@
.dataTable{width:100% !important;border-spacing:0 !important;}.table td,.table th{padding:8px 10px;}.dataTable tbody tr td button{cursor:pointer;}.dataTable tbody tr td div.dropdown ul.dropdown-menu li{cursor:pointer;padding:5px;}.dataTable tbody tr td div.dropdown ul.dropdown-menu li a{display:block;}.dataTable tbody tr td div.dropdown ul.dropdown-menu li:hover{background:#f4f5f8;}
Loading…
Cancel
Save