From 276531230463577349db902926f0c0345f14ec61 Mon Sep 17 00:00:00 2001 From: rxtur Date: Fri, 19 Feb 2016 19:01:38 -0600 Subject: [PATCH 001/146] Added Month list widget --- .../datastore/widgets/be_WIDGET_ZONE.xml | 1 + .../BlogEngine.NET/BlogEngine.NET.csproj | 2 + .../Custom/Widgets/MonthList/MonthList.cs | 59 +++++++++++++++++++ .../Custom/Widgets/MonthList/widget.cshtml | 30 ++++++++++ .../Custom/Widgets/TagCloud/edit.cshtml | 2 +- .../Custom/Widgets/TextBox/edit.cshtml | 2 +- .../admin/app/custom/widgets/widgetView.html | 7 ++- 7 files changed, 98 insertions(+), 5 deletions(-) create mode 100644 BlogEngine/BlogEngine.NET/Custom/Widgets/MonthList/MonthList.cs create mode 100644 BlogEngine/BlogEngine.NET/Custom/Widgets/MonthList/widget.cshtml diff --git a/BlogEngine/BlogEngine.NET/App_Data/datastore/widgets/be_WIDGET_ZONE.xml b/BlogEngine/BlogEngine.NET/App_Data/datastore/widgets/be_WIDGET_ZONE.xml index 587b490f2..72981ebb8 100644 --- a/BlogEngine/BlogEngine.NET/App_Data/datastore/widgets/be_WIDGET_ZONE.xml +++ b/BlogEngine/BlogEngine.NET/App_Data/datastore/widgets/be_WIDGET_ZONE.xml @@ -8,4 +8,5 @@ Newsletter CommentList LinkList + MonthList \ No newline at end of file diff --git a/BlogEngine/BlogEngine.NET/BlogEngine.NET.csproj b/BlogEngine/BlogEngine.NET/BlogEngine.NET.csproj index cecbb8490..63a4cbd2f 100644 --- a/BlogEngine/BlogEngine.NET/BlogEngine.NET.csproj +++ b/BlogEngine/BlogEngine.NET/BlogEngine.NET.csproj @@ -724,6 +724,7 @@ + @@ -2120,6 +2121,7 @@ + default.aspx diff --git a/BlogEngine/BlogEngine.NET/Custom/Widgets/MonthList/MonthList.cs b/BlogEngine/BlogEngine.NET/Custom/Widgets/MonthList/MonthList.cs new file mode 100644 index 000000000..846c474e3 --- /dev/null +++ b/BlogEngine/BlogEngine.NET/Custom/Widgets/MonthList/MonthList.cs @@ -0,0 +1,59 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using BlogEngine.Core; + +namespace BlogEngine.NET.Custom.Widgets +{ + public class MonthList + { + class DateComparer_Desc : IComparer + { + int IComparer.Compare(DateTime x, DateTime y) { return -x.CompareTo(y); } + } + class IntComparer_Desc : IComparer + { + int IComparer.Compare(int x, int y) { return -x.CompareTo(y); } + } + + private static readonly IComparer date_Desc = new DateComparer_Desc(); + private static readonly IComparer int_Desc = new IntComparer_Desc(); + + public MonthList() { } + + public SortedDictionary> GetList() + { + var months = new SortedDictionary(date_Desc); + var years = new SortedDictionary>(int_Desc); + + foreach (var month in Post.ApplicablePosts.Where(post => post.IsVisibleToPublic). + Select(post => new DateTime(post.DateCreated.Year, post.DateCreated.Month, 1))) + { + int count; + months.TryGetValue(month, out count); + ++count; + months[month] = count; + } + foreach (KeyValuePair aIt in months) + { + if (!years.Keys.Contains(aIt.Key.Year)) + { + years.Add(aIt.Key.Year, new List()); + } + var item = new MonthItem(); + item.Title = aIt.Key.ToString("MMMM"); + item.Url = string.Format("{0}{1}/{2}", Utils.RelativeOrAbsoluteWebRoot, aIt.Key.Year, aIt.Key.Month.ToString("00")); + item.Count = aIt.Value; + years[aIt.Key.Year].Add(item); + } + return years; + } + } + + public class MonthItem + { + public string Title { get; set; } + public string Url { get; set; } + public int Count { get; set; } + } +} \ No newline at end of file diff --git a/BlogEngine/BlogEngine.NET/Custom/Widgets/MonthList/widget.cshtml b/BlogEngine/BlogEngine.NET/Custom/Widgets/MonthList/widget.cshtml new file mode 100644 index 000000000..fa36c7666 --- /dev/null +++ b/BlogEngine/BlogEngine.NET/Custom/Widgets/MonthList/widget.cshtml @@ -0,0 +1,30 @@ +@using BlogEngine.NET.Custom.Widgets +@{ + var title = Model.Title; + var mList = new MonthList(); + var years = mList.GetList(); + var cnt = 0; + var cls = "open"; +} +
+

@title

+
+
    + @foreach (KeyValuePair> y in years) + { + var yId = "year" + @y.Key; + var tgl = "BlogEngine.toggleMonth('" + yId + "')"; + cnt = cnt + 1; + cls = cnt > 1 ? "close" : "open"; +
  • @y.Key +
      + @foreach (var item in y.Value) + { +
    • @item.Title (@item.Count)
    • + } +
    +
  • + } +
+
+
\ No newline at end of file diff --git a/BlogEngine/BlogEngine.NET/Custom/Widgets/TagCloud/edit.cshtml b/BlogEngine/BlogEngine.NET/Custom/Widgets/TagCloud/edit.cshtml index 1418311eb..c9f5008cf 100644 --- a/BlogEngine/BlogEngine.NET/Custom/Widgets/TagCloud/edit.cshtml +++ b/BlogEngine/BlogEngine.NET/Custom/Widgets/TagCloud/edit.cshtml @@ -60,7 +60,7 @@ @Html.DropDownList("ddCloudSize", cloudSizeOptions, new { @class = "form-control" })
-
diff --git a/BlogEngine/BlogEngine.NET/Custom/Widgets/TextBox/edit.cshtml b/BlogEngine/BlogEngine.NET/Custom/Widgets/TextBox/edit.cshtml index f594a4cfb..4a77eb3f0 100644 --- a/BlogEngine/BlogEngine.NET/Custom/Widgets/TextBox/edit.cshtml +++ b/BlogEngine/BlogEngine.NET/Custom/Widgets/TextBox/edit.cshtml @@ -44,7 +44,7 @@
-
diff --git a/BlogEngine/BlogEngine.NET/admin/app/custom/widgets/widgetView.html b/BlogEngine/BlogEngine.NET/admin/app/custom/widgets/widgetView.html index a7e82d442..c76dac93e 100644 --- a/BlogEngine/BlogEngine.NET/admin/app/custom/widgets/widgetView.html +++ b/BlogEngine/BlogEngine.NET/admin/app/custom/widgets/widgetView.html @@ -1,6 +1,8 @@ 
+ + + + +
+ +
+ + + + + + + + + + + @foreach (var roll in rolls) + { + + + + + + } + @if (rolls == null || rolls.Count == 0) + { + + } + +
@Resources.labels.title@Resources.labels.descriptionXFN
+ @roll.Title + + @roll.Description@roll.Xfn
@Resources.labels.empty
+ + + + + \ No newline at end of file diff --git a/BlogEngine/BlogEngine.NET/Custom/Widgets/BlogRoll/widget.cshtml b/BlogEngine/BlogEngine.NET/Custom/Widgets/BlogRoll/widget.cshtml new file mode 100644 index 000000000..6a239af5b --- /dev/null +++ b/BlogEngine/BlogEngine.NET/Custom/Widgets/BlogRoll/widget.cshtml @@ -0,0 +1,43 @@ +@using BlogEngine.NET.Custom.Widgets +@using BlogEngine.Core +@{ + var title = Model.Title; + var rolls = BlogRollItem.BlogRolls; + var br = new BlogRoll(); + var imgPath = Utils.ApplicationRelativeWebRoot + "Content/images/blog"; + var opmlPath = Utils.ApplicationRelativeWebRoot + "opml.axd"; +} +
+

@title

+
+ @if (rolls != null) + { +
    + @foreach (var roll in rolls) + { +
  • + + @roll.Description + + @roll.Title + @if (br.GetFeeds(roll.FeedUrl.ToString()).Count > 0) + { + + } +
  • + } +
+ } + + @Resources.labels.downloadOPML + OPML + +
+
\ No newline at end of file diff --git a/BlogEngine/BlogEngine.NET/admin/app/content/blogs/blogView.html b/BlogEngine/BlogEngine.NET/admin/app/content/blogs/blogView.html index b587db510..eee9f54e0 100644 --- a/BlogEngine/BlogEngine.NET/admin/app/content/blogs/blogView.html +++ b/BlogEngine/BlogEngine.NET/admin/app/content/blogs/blogView.html @@ -109,9 +109,9 @@

{{lbl.blogs}}

- -
- +
+ +
diff --git a/BlogEngine/BlogEngine.NET/admin/app/settings/settingController.js b/BlogEngine/BlogEngine.NET/admin/app/settings/settingController.js index 2ee198ef1..3f659c93d 100644 --- a/BlogEngine/BlogEngine.NET/admin/app/settings/settingController.js +++ b/BlogEngine/BlogEngine.NET/admin/app/settings/settingController.js @@ -105,6 +105,19 @@ .error(function () { toastr.error($rootScope.lbl.failed); }); } + $scope.clearCache = function () { + dataService.updateItem("/api/settings?action=clearCache", $scope.settings) + .success(function (data) { + if (data) { + toastr.error(data); + } + else { + toastr.success($rootScope.lbl.completed); + } + }) + .error(function () { toastr.error($rootScope.lbl.failed); }); + } + $scope.loadTheme = function () { var theme = $("#selDesktopTheme option:selected").text(); window.location.assign("#/shared/package?id=" + theme); From d37be24ab87096173d2018ebdadc24e8560d4f53 Mon Sep 17 00:00:00 2001 From: Farzin Seyfolahi Date: Mon, 14 Mar 2016 18:37:37 -0700 Subject: [PATCH 007/146] Toggle arrow in sidebar removed and toolbar is open by default and Widgets improved. --- .../admin/app/custom/widgets/widgetView.html | 207 ++++++++---------- .../admin/themes/standard/css/styles.css | 2 +- .../admin/themes/standard/css/styles.css.map | 4 +- .../themes/standard/sass/layout/_header.scss | 16 +- .../themes/standard/sass/layout/_sidebar.scss | 25 --- .../standard/sass/pages/custom/_widgets.scss | 71 ++++++ .../admin/themes/standard/sass/styles.scss | 5 +- .../admin/themes/standard/sidebar.cshtml | 3 +- 8 files changed, 181 insertions(+), 152 deletions(-) create mode 100644 BlogEngine/BlogEngine.NET/admin/themes/standard/sass/pages/custom/_widgets.scss diff --git a/BlogEngine/BlogEngine.NET/admin/app/custom/widgets/widgetView.html b/BlogEngine/BlogEngine.NET/admin/app/custom/widgets/widgetView.html index c76dac93e..fbb6346a1 100644 --- a/BlogEngine/BlogEngine.NET/admin/app/custom/widgets/widgetView.html +++ b/BlogEngine/BlogEngine.NET/admin/app/custom/widgets/widgetView.html @@ -1,151 +1,134 @@ -
- +
+

{{lbl.widgets}}

- +
- -