Skip to content

Commit da220ff

Browse files
committed
Styles
1 parent 7e3f6ca commit da220ff

File tree

12 files changed

+127
-106
lines changed

12 files changed

+127
-106
lines changed

src/DragonFly.App.Server/Components/App.razor

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<link href="@Assets["_content/DragonFly.Client/css/bootstrap.min.css"]" rel="stylesheet" />
99
<link href="@Assets["_content/DragonFly.Client/css/all.min.css"]" rel="stylesheet" />
1010
<link href="@Assets["_content/DragonFly.Client/lib/font-awesome/css/all.min.css"]" rel="stylesheet" />
11-
<link href="@Assets["DragonFly.App.WebAssembly.Client.styles.css"]" rel="stylesheet" />
11+
<link href="@Assets["DragonFly.App.Server.styles.css"]" rel="stylesheet" />
1212
<script src="/_content/BlazorStrap/blazorstrap.js"></script>
1313
<script src="/_content/DragonFly.Client/lib/tinymce/tinymce.min.js"></script>
1414
<script src="/_content/TinyMCE.Blazor/tinymce-blazor.js"></script>

src/DragonFly.App.Server/Program.cs

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
using DragonFly.API;
1010
using DragonFly.App.Server.Components;
1111
using DragonFly.AspNetCore;
12+
using DragonFly.AspNetCore.Permissions;
1213
using DragonFly.Client;
1314
using DragonFly.MongoDB;
1415
using DragonFlyABC;
@@ -82,6 +83,8 @@
8283
x.Field().Add<HtmlField>().WithTinyMceView();
8384
}));
8485

86+
builder.Services.AddSingleton<IPrincipalContext, PrincipalHttpContext>();
87+
8588
var app = builder.Build();
8689

8790
//init DragonFly

src/DragonFly.App.WebAssembly.Client/wwwroot/index.html

-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<!DOCTYPE html>
22
<html>
3-
43
<head>
54
<meta charset="utf-8" />
65
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
@@ -14,7 +13,6 @@
1413
<script src="_content/DragonFly.Client/lib/tinymce/tinymce.min.js"></script>
1514
<script src="_content/TinyMCE.Blazor/tinymce-blazor.js"></script>
1615
</head>
17-
1816
<body>
1917
<app>
2018
<div style="margin:auto; width:100%; text-align:center">
@@ -30,5 +28,4 @@ <h1>DragonFly CMS</h1>
3028
</div>
3129
<script src="_framework/blazor.webassembly.js"></script>
3230
</body>
33-
3431
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Copyright (c) usercode
2+
// https://github.com/usercode/DragonFly
3+
// MIT License
4+
5+
using System.Security.Claims;
6+
7+
namespace DragonFly.AspNetCore.Permissions;
8+
9+
public class PrincipalHttpContext : IPrincipalContext
10+
{
11+
public PrincipalHttpContext(IHttpContextAccessor httpContextAccessor)
12+
{
13+
HttpContextAccessor = httpContextAccessor;
14+
}
15+
16+
private readonly IHttpContextAccessor HttpContextAccessor;
17+
18+
public ClaimsPrincipal? Current
19+
{
20+
get => HttpContextAccessor.HttpContext?.User;
21+
set { }
22+
}
23+
}

src/DragonFly.Client/Pages/Assets/AssetDetail.razor

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@
139139
</div>
140140
@if (Entity.Hash != null)
141141
{
142-
<div style="margin: 2rem 0;">
142+
<div style="margin: 1rem 0;">
143143
@AssetPreviewManager.CreateComponent(Entity)
144144
</div>
145145
}

src/DragonFly.Client/Shared/PermissionItemView.razor

+5-7
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,13 @@
99
{
1010
var p1 = permission;
1111

12-
Permission[] impliedBy = p1.Element.GetImpliedPermissions().Where(i => Permissions.Where(x => x.IsSelected).Any(p => p.Element == i)).ToArray();
12+
Permission[] impliedBy = p1.Element.GetImpliedPermissions()
13+
.Where(i => Permissions.Where(x => x.IsSelected)
14+
.Any(p => p.Element == i))
15+
.ToArray();
1316

1417
<li class="list-group-item">
15-
<input id="[email protected]" type="checkbox" class="form-check-input me-2" @bind="permission.IsSelected" @bind:after="() => PermissionSelected(p1)" />
18+
<input id="[email protected]" type="checkbox" class="form-check-input me-2" @bind="permission.IsSelected" />
1619

1720
@if (impliedBy.Length > 0)
1821
{
@@ -42,9 +45,4 @@
4245

4346
[Parameter]
4447
public IEnumerable<SelectableElement<Permission>> Permissions { get; set; }
45-
46-
private void PermissionSelected(SelectableElement<Permission> permission)
47-
{
48-
49-
}
5048
}

src/DragonFly.Client/wwwroot/css/all.css

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ button:disabled {
3030
pointer-events: all !important;
3131
}
3232

33-
input:read-only {
33+
input[type=text]:read-only {
3434
cursor: not-allowed;
35-
background: #f5f5f5 !important;
35+
background-color: #f5f5f5 !important;
3636
}
3737

3838
.pagination {

src/DragonFly.Client/wwwroot/css/all.min.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/DragonFly.Client/wwwroot/css/app.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ button:disabled {
3030
pointer-events: all !important;
3131
}
3232

33-
input:read-only {
33+
input[type=text]:read-only {
3434
cursor: not-allowed;
35-
background: #f5f5f5 !important;
35+
background-color: #f5f5f5 !important;
3636
}
3737

3838
.pagination {

0 commit comments

Comments
 (0)