forked from BlogEngine/BlogEngine.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request BlogEngine#77 from jmalarcon/FixCategoryListWidget
Add edit UI to the CategoryList widget.
- Loading branch information
Showing
4 changed files
with
128 additions
and
20 deletions.
There are no files selected for viewing
52 changes: 52 additions & 0 deletions
52
BlogEngine/BlogEngine.NET/Custom/Widgets/CategoryList/edit.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
@using BlogEngine.NET.Custom.Widgets | ||
@using BlogEngine.Core | ||
@{ | ||
var showrssicon = true; | ||
var showpostcount = true; | ||
|
||
var widgetId = Request.QueryString["id"]; | ||
var settings = Common.GetSettings(widgetId); | ||
|
||
if (IsPost) | ||
{ | ||
if (Validation.IsValid()) | ||
{ | ||
settings["showrssicon"] = Request.Form["cbShowRssIcon"] == "on" ? "true" : "false"; | ||
settings["showpostcount"] = Request.Form["cbShowPostCount"] == "on" ? "true" : "false"; | ||
Common.SaveSettings(settings, widgetId); | ||
@: | ||
<script type="text/javascript">window.parent.toastr.success("Completed");</script> | ||
} | ||
} | ||
if (settings != null && settings.Count > 0) | ||
{ | ||
showrssicon = settings["showrssicon"] == "true" ? true : false; | ||
showpostcount = settings["showpostcount"] == "true" ? true : false; | ||
} | ||
} | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<link rel="stylesheet" href="~/Content/bootstrap.min.css"> | ||
<link rel="stylesheet" href="~/admin/themes/standard/css/styles.css"> | ||
</head> | ||
<body class="widget-edit"> | ||
<form method="post"> | ||
<div class="form-group"> | ||
<label> | ||
@Html.CheckBox("cbShowRssIcon", showrssicon) Show the RSS icon | ||
</label> | ||
</div> | ||
<div class="form-group"> | ||
<label> | ||
@Html.CheckBox("cbShowPostCount", showpostcount) Show number of posts in category | ||
</label> | ||
</div> | ||
<div> | ||
<button type="submit" class="btn btn-success"> | ||
@Resources.labels.save | ||
</button> | ||
</div> | ||
</form> | ||
</body> | ||
</html> |
3 changes: 1 addition & 2 deletions
3
BlogEngine/BlogEngine.NET/admin/themes/standard/css/styles.css
Large diffs are not rendered by default.
Oops, something went wrong.
66 changes: 61 additions & 5 deletions
66
BlogEngine/BlogEngine.NET/admin/themes/standard/css/styles.css.map
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters