Skip to content

Commit 2226096

Browse files
committed
Edit pages added to common widgets
1 parent 7c93d34 commit 2226096

File tree

6 files changed

+31
-22
lines changed

6 files changed

+31
-22
lines changed

plugins/Common/Common.csproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@
1313
<EmbeddedResource Include="Views\**\*" />
1414
</ItemGroup>
1515

16-
<ItemGroup>
17-
<None Remove="Views\Widgets\HtmlBlock\Index.cshtml" />
18-
</ItemGroup>
19-
2016
<ItemGroup>
2117
<ProjectReference Include="..\..\src\Core\Core.csproj" />
2218
</ItemGroup>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
@model Core.Data.Widget
2+
@{
3+
var prop = Model.Props.Where(p => p.Id == "Title").FirstOrDefault();
4+
string title = prop == null ? "HTML Widget" : prop.Value;
5+
}
6+
<h4>@title</h4>
7+
<form id="usrform">
8+
<div class="form-group">
9+
<textarea rows="4" name="txtHtml" class="form-control"></textarea>
10+
</div>
11+
<div class="form-group">
12+
<button type="submit" class="btn btn-primary btn-main">Save</button>
13+
</div>
14+
</form>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@model Core.Data.Widget
2+
<h4>Post List</h4>

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

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -63,23 +63,18 @@
6363
</div>
6464
<div class="modal-body">
6565
<div class="settings-body">
66-
@*<nav>
67-
<div class="nav nav-tabs" id="nav-tab" role="tablist">
68-
<a class="nav-item nav-link active" id="nav-home-tab" data-toggle="tab" href="#nav-home" role="tab" aria-controls="nav-home" aria-selected="true">Home</a>
69-
<a class="nav-item nav-link" id="nav-profile-tab" data-toggle="tab" href="#nav-profile" role="tab" aria-controls="nav-profile" aria-selected="false">Profile</a>
70-
<a class="nav-item nav-link" id="nav-contact-tab" data-toggle="tab" href="#nav-contact" role="tab" aria-controls="nav-contact" aria-selected="false">Contact</a>
71-
</div>
72-
</nav>
73-
<div class="tab-content" id="nav-tabContent">
74-
<div class="tab-pane fade show active" id="nav-home" role="tabpanel" aria-labelledby="nav-home-tab">aaaaa</div>
75-
<div class="tab-pane fade" id="nav-profile" role="tabpanel" aria-labelledby="nav-profile-tab">bbbbb</div>
76-
<div class="tab-pane fade" id="nav-contact" role="tabpanel" aria-labelledby="nav-contact-tab">cccccc</div>
77-
</div>*@
66+
@if (Model.Widgets != null)
67+
{
68+
foreach (var widget in Model.Widgets.Widgets)
69+
{
70+
var path = $"~/Views/Widgets/{widget.Name}/Edit.cshtml";
71+
await Html.RenderPartialAsync(path, widget);
72+
}
73+
}
7874
</div>
7975
</div>
8076
<div class="modal-footer d-flex">
8177
<button class="btn btn-link btn-sm btn-rounded ml-auto" type="button" data-dismiss="modal">cancel</button>
82-
<button id="btnSelect" class="btn btn-primary btn-sm btn-rounded" type="button" onclick="return saveSettings()">Save</button>
8378
</div>
8479
</div>
8580
</div>
@@ -98,8 +93,5 @@
9893
$('#themeSettings').modal();
9994
return false;
10095
}
101-
var saveSettings = function () {
102-
toastr.success('Updated');
103-
}
10496
</script>
10597
}

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@
1616
},
1717
{
1818
"Name": "HtmlBlock",
19-
"Props": []
19+
"Props": [
20+
{
21+
"Id": "Title",
22+
"Value": "Social Buttons"
23+
}
24+
]
2025
}
2126
]
2227
}

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.6</Version>
5+
<Version>2.1.0.7</Version>
66
</PropertyGroup>
77

88
<ItemGroup>

0 commit comments

Comments
 (0)