Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions website/MyWebApp/Controllers/AdminBlockTemplateController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ private async Task LoadPagesAsync()
{
ViewBag.Pages = await _db.Pages.AsNoTracking().OrderBy(p => p.Slug).ToListAsync();
ViewBag.Roles = await _db.Roles.AsNoTracking().OrderBy(r => r.Name).ToListAsync();
ViewBag.Zones = await _db.PageSections.AsNoTracking()
.Select(s => s.Zone)
.Distinct()
.OrderBy(z => z)
.ToListAsync();
}

public async Task<IActionResult> Index()
Expand Down
7 changes: 6 additions & 1 deletion website/MyWebApp/Views/AdminBlockTemplate/AddToPage.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@
</div>
<div>
<label>Zone</label>
<input type="text" name="zone" />
<select id="zone-select" name="zone">
@foreach (var z in ViewBag.Zones as List<string>)
{
<option value="@z">@z</option>
}
</select>
</div>
<div>
<label>Role</label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<input type="text" id="page-display" readonly />
<select id="page-select" name="pageIds" multiple size="5">
<option value="0">All Pages</option>
@foreach (var p in ViewBag.Pages as List<Page>)

Check warning on line 9 in website/MyWebApp/Views/AdminBlockTemplate/_PageAssignment.cshtml

View workflow job for this annotation

GitHub Actions / build

Dereference of a possibly null reference.

Check warning on line 9 in website/MyWebApp/Views/AdminBlockTemplate/_PageAssignment.cshtml

View workflow job for this annotation

GitHub Actions / build

Dereference of a possibly null reference.
{
<option value="@p.Id">@p.Slug</option>
}
Expand All @@ -14,7 +14,12 @@
</div>
<div>
<label>Zone</label>
<input type="text" name="zone" />
<select id="zone-select" name="zone">
@foreach (var z in ViewBag.Zones as List<string>)
{
<option value="@z">@z</option>
}
</select>
</div>
<div>
<label>Role</label>
Expand Down
Loading