Skip to content

Commit 7696021

Browse files
committed
Merge pull request BlogEngine#77 from jmalarcon/FixCategoryListWidget
Add edit UI to the CategoryList widget.
2 parents 7487c1a + dd4ce86 commit 7696021

File tree

4 files changed

+128
-20
lines changed

4 files changed

+128
-20
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
@using BlogEngine.NET.Custom.Widgets
2+
@using BlogEngine.Core
3+
@{
4+
var showrssicon = true;
5+
var showpostcount = true;
6+
7+
var widgetId = Request.QueryString["id"];
8+
var settings = Common.GetSettings(widgetId);
9+
10+
if (IsPost)
11+
{
12+
if (Validation.IsValid())
13+
{
14+
settings["showrssicon"] = Request.Form["cbShowRssIcon"] == "on" ? "true" : "false";
15+
settings["showpostcount"] = Request.Form["cbShowPostCount"] == "on" ? "true" : "false";
16+
Common.SaveSettings(settings, widgetId);
17+
@:
18+
<script type="text/javascript">window.parent.toastr.success("Completed");</script>
19+
}
20+
}
21+
if (settings != null && settings.Count > 0)
22+
{
23+
showrssicon = settings["showrssicon"] == "true" ? true : false;
24+
showpostcount = settings["showpostcount"] == "true" ? true : false;
25+
}
26+
}
27+
<!DOCTYPE html>
28+
<html>
29+
<head>
30+
<link rel="stylesheet" href="~/Content/bootstrap.min.css">
31+
<link rel="stylesheet" href="~/admin/themes/standard/css/styles.css">
32+
</head>
33+
<body class="widget-edit">
34+
<form method="post">
35+
<div class="form-group">
36+
<label>
37+
@Html.CheckBox("cbShowRssIcon", showrssicon) Show the RSS icon
38+
</label>
39+
</div>
40+
<div class="form-group">
41+
<label>
42+
@Html.CheckBox("cbShowPostCount", showpostcount) Show number of posts in category
43+
</label>
44+
</div>
45+
<div>
46+
<button type="submit" class="btn btn-success">
47+
@Resources.labels.save
48+
</button>
49+
</div>
50+
</form>
51+
</body>
52+
</html>

BlogEngine/BlogEngine.NET/admin/themes/standard/css/styles.css

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

BlogEngine/BlogEngine.NET/admin/themes/standard/css/styles.css.map

Lines changed: 61 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

BlogEngine/BlogEngine.NET/admin/themes/standard/scss/pages/custom/_widgets.scss

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,24 @@
44
&.administration,
55
&.authorlist,
66
&.bloglist,
7-
&.categorylist,
87
&.monthlist,
98
&.pagelist,
109
&.search {
1110
iframe {
1211
display: none;
1312
}
1413

15-
.modal-header {
16-
border: none;
17-
}
18-
1914
.modal-body {
2015
display: none;
2116
}
2217
}
2318

19+
&.categorylist {
20+
.modal-body {
21+
height: 235px;
22+
}
23+
}
24+
2425
&.CommentList {
2526
.modal-body {
2627
height: 150px;
@@ -98,8 +99,6 @@
9899
@include list-unstyled();
99100
margin-top: 20px;
100101
margin-bottom: 20px;
101-
position: relative;
102-
z-index: 11;
103102

104103
li {
105104
width: 100%;
@@ -108,16 +107,19 @@
108107
padding-left: 15px;
109108
line-height: 40px;
110109
border: 1px solid #ddd;
111-
@include box-shadow(0 1px 0 #eee !important);
112-
@include border-radius(3px);
110+
-moz-box-shadow: 0 1px 0 #eee !important;
111+
-webkit-box-shadow: 0 1px 0 #eee !important;
112+
box-shadow: 0 1px 0 #eee !important;
113+
-moz-border-radius: 3px;
114+
-webkit-border-radius: 3px;
115+
border-radius: 3px;
113116
font-weight: 400;
114117
font-size: 14px;
115118
height: 40px;
116119
padding-left: 10px;
117120
color: #444;
118121
position: relative;
119122
overflow: hidden;
120-
cursor: move;
121123

122124
&:last-child {
123125
margin-bottom: 0;
@@ -127,7 +129,7 @@
127129
position: absolute;
128130
right: 0;
129131
top: 0;
130-
z-index: 0;
132+
z-index: 2;
131133
width: 100px;
132134

133135
button {
@@ -168,7 +170,6 @@
168170
.widgets-list-active {
169171
border: 1px dashed #aaa;
170172
padding: 10px;
171-
z-index: 10;
172173
}
173174

174175
.ui-sortable-placeholder {
@@ -267,7 +268,7 @@
267268

268269

269270
// widget-edit
270-
// don't forget widget-edit is for body class in the iframe setting of widgets.
271+
// don't forget widget-edit is for body class.
271272
.widget-edit {
272273
padding: 15px;
273274
// blogrolll

0 commit comments

Comments
 (0)