|
|
@ -1,5 +1,4 @@ |
|
|
using System; |
|
|
using System.Collections.Generic; |
|
|
using System.Collections.Generic; |
|
|
|
|
|
using System.Linq; |
|
|
using System.Linq; |
|
|
using System.Threading.Tasks; |
|
|
using System.Threading.Tasks; |
|
|
using Microsoft.AspNetCore.Mvc; |
|
|
using Microsoft.AspNetCore.Mvc; |
|
|
@ -26,13 +25,8 @@ public class AddWidgetModal : AbpPageModel |
|
|
|
|
|
|
|
|
public async Task OnGetAsync() |
|
|
public async Task OnGetAsync() |
|
|
{ |
|
|
{ |
|
|
ViewModel = new ContentViewModel(); |
|
|
|
|
|
|
|
|
|
|
|
var widgets = await ContentAdminAppService.GetWidgetsAsync(); |
|
|
|
|
|
ViewModel.ContentWidgets = widgets.Items.ToArray(); |
|
|
|
|
|
|
|
|
|
|
|
Widgets = new List<SelectListItem>() { new("", "") }; |
|
|
Widgets = new List<SelectListItem>() { new("", "") }; |
|
|
Widgets.AddRange(widgets |
|
|
Widgets.AddRange((await ContentAdminAppService.GetWidgetsAsync()) |
|
|
.Items |
|
|
.Items |
|
|
.Select(w => new SelectListItem(w.Key, w.Key)) |
|
|
.Select(w => new SelectListItem(w.Key, w.Key)) |
|
|
.ToList()); |
|
|
.ToList()); |
|
|
@ -42,8 +36,5 @@ public class AddWidgetModal : AbpPageModel |
|
|
{ |
|
|
{ |
|
|
[SelectItems(nameof(Widgets))] |
|
|
[SelectItems(nameof(Widgets))] |
|
|
public string Widget { get; set; } |
|
|
public string Widget { get; set; } |
|
|
|
|
|
|
|
|
public ContentWidgetDto[] ContentWidgets { get; set; } = Array.Empty<ContentWidgetDto>(); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|