Skip to content

Commit faead3a

Browse files
committed
Post list updates
1 parent 3c469db commit faead3a

File tree

6 files changed

+40
-5
lines changed

6 files changed

+40
-5
lines changed
Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,31 @@
1-
@model Core.Data.ThemeWidget
1+
@model Core.Data.ThemeWidget
2+
@{
3+
var selectedType = "All";
4+
var maxRecords = "10";
5+
string[] listTypes = new string[] { "All", "By author", "By category" };
6+
}
7+
<form method="post" asp-antiforgery="true">
8+
<div class="form-group">
9+
<label class="form-group-label">List Type</label>
10+
<select id="selTypes" name="selTypes" class="form-control">
11+
@foreach (var t in listTypes)
12+
{
13+
if (selectedType == t)
14+
{
15+
<option value="@t" selected>@t</option>
16+
}
17+
else
18+
{
19+
<option value="@t">@t</option>
20+
}
21+
}
22+
</select>
23+
</div>
24+
<div class="form-group">
25+
<label class="form-group-label">Max records</label>
26+
<input type="text" id="txtMaxRecords" name="txtMaxRecords" class="form-control" value="@maxRecords" />
27+
</div>
28+
<div class="form-group">
29+
<button type="submit" class="btn btn-primary btn-main">Save</button>
30+
</div>
31+
</form>

plugins/Common/Widgets/PostList.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public PostList(IDataService db)
1313
_db = db;
1414
}
1515

16-
public IViewComponentResult Invoke()
16+
public IViewComponentResult Invoke(string theme, string widget)
1717
{
1818
var model = _db.BlogPosts.All();
1919

src/App/Pages/Admin/Settings/Themes.cshtml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,9 @@
6868
foreach (var widget in Model.Widgets)
6969
{
7070
var path = $"~/Views/Widgets/{widget.Widget}/Edit.cshtml";
71-
<h6>@widget.Title</h6>
72-
await Html.RenderPartialAsync(path, new ThemeWidget {
71+
<div class="bf-title d-none d-lg-block"><span>@widget.Title</span></div>
72+
await Html.RenderPartialAsync(path, new ThemeWidget
73+
{
7374
Theme = Model.BlogItem.Theme,
7475
Widget = widget
7576
});

src/App/Views/Themes/Simple/Simple.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,9 @@
22
{
33
"Widget": "HtmlBlock",
44
"Title": "Sidebar"
5+
},
6+
{
7+
"Widget": "PostList",
8+
"Title": "Post List"
59
}
610
]

src/App/app.db

0 Bytes
Binary file not shown.

src/Core/Core.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<TargetFramework>netcoreapp2.1</TargetFramework>
5-
<Version>2.1.0.8</Version>
5+
<Version>2.1.0.9</Version>
66
</PropertyGroup>
77

88
<ItemGroup>

0 commit comments

Comments
 (0)