Skip to content

Commit

Permalink
Merge pull request BlogEngine#77 from jmalarcon/FixCategoryListWidget
Browse files Browse the repository at this point in the history
Add edit UI to the CategoryList widget.
  • Loading branch information
rxtur committed May 18, 2016
2 parents 7487c1a + dd4ce86 commit 7696021
Show file tree
Hide file tree
Showing 4 changed files with 128 additions and 20 deletions.
52 changes: 52 additions & 0 deletions BlogEngine/BlogEngine.NET/Custom/Widgets/CategoryList/edit.cshtml
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>

Large diffs are not rendered by default.

66 changes: 61 additions & 5 deletions BlogEngine/BlogEngine.NET/admin/themes/standard/css/styles.css.map

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,24 @@
&.administration,
&.authorlist,
&.bloglist,
&.categorylist,
&.monthlist,
&.pagelist,
&.search {
iframe {
display: none;
}

.modal-header {
border: none;
}

.modal-body {
display: none;
}
}

&.categorylist {
.modal-body {
height: 235px;
}
}

&.CommentList {
.modal-body {
height: 150px;
Expand Down Expand Up @@ -98,8 +99,6 @@
@include list-unstyled();
margin-top: 20px;
margin-bottom: 20px;
position: relative;
z-index: 11;

li {
width: 100%;
Expand All @@ -108,16 +107,19 @@
padding-left: 15px;
line-height: 40px;
border: 1px solid #ddd;
@include box-shadow(0 1px 0 #eee !important);
@include border-radius(3px);
-moz-box-shadow: 0 1px 0 #eee !important;
-webkit-box-shadow: 0 1px 0 #eee !important;
box-shadow: 0 1px 0 #eee !important;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
font-weight: 400;
font-size: 14px;
height: 40px;
padding-left: 10px;
color: #444;
position: relative;
overflow: hidden;
cursor: move;

&:last-child {
margin-bottom: 0;
Expand All @@ -127,7 +129,7 @@
position: absolute;
right: 0;
top: 0;
z-index: 0;
z-index: 2;
width: 100px;

button {
Expand Down Expand Up @@ -168,7 +170,6 @@
.widgets-list-active {
border: 1px dashed #aaa;
padding: 10px;
z-index: 10;
}

.ui-sortable-placeholder {
Expand Down Expand Up @@ -267,7 +268,7 @@


// widget-edit
// don't forget widget-edit is for body class in the iframe setting of widgets.
// don't forget widget-edit is for body class.
.widget-edit {
padding: 15px;
// blogrolll
Expand Down

0 comments on commit 7696021

Please sign in to comment.